GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSE / V2-2-3 > lsew / rhel5-32
#include <LSE/CDF_err.h>
#include <LSE/CDF_errdef.h>
#include <CDF_err_def.h>
#include <EDS/EBF_tem.h>
#include <EDS/EBF_err.h>
#include <EDS/EBF_tkr.h>
#include <EDS/EBF_dir.h>
#include <EDS/EBF_cid.h>
#include <EDS/EDR_tkr.h>
#include <EDS/EDR_err.h>
#include <LDT/BFP.h>
#include <PBI/FFS.ih>
#include <string.h>
#include <dprintf.h>
Defines | |
#define | dbg_report_header(tag) |
#define | dbg_report_tem(tem, cid, nbits) |
#define | TAG0 0xd |
#define | TAG1 0x2 |
#define | TAG2 0x7 |
#define | TAG3 0x8 |
#define | TAGS ((TAG3<<12) | (TAG2<<8) | (TAG1<<4) | TAG0) |
Typedefs | |
typedef unsigned int(* | cdf_err_tem_compress_rtn )(CDF_errTem *err, unsigned int *buf, unsigned int pos, unsigned int tag) |
Functions | |
int | CDF_errCfg_sizeof (int level) |
Returns the size, in bytes of the GEM compression configuration needed to support the specified level. | |
int | CDF_errCfg_construct (CDF_errCfg *cfg, int level, void **mem) |
Constructs the CDF_erfCfg compression configuration. | |
int | CDF_err_sizeof (int level, const CDF_errCfg *cfg) |
Returns the size, in bytes of the ERR compression structure needed to support the specified level. | |
int | CDF_err_construct (CDF_err *cdf, int level, const CDF_errCfg *cfg, const LSEW_dgmFw *dgmFw, void **mem) |
Constructs the CDF_err compression context. | |
static __inline void | cdf_err_tkr_analyze_timeout (CDF_errTkrTimeout *timeout, const unsigned short *err, const EDR_errTkr *tkr) |
static __inline unsigned int | cdf_err_analyze_rc_pe (CDF_errTkrRc_pe *pe_rec, const unsigned short int *err, const EDR_errTkr *tkr, unsigned int tag) |
static __inline unsigned int | cdf_err_tem_analyze (CDF_errTem *tem_rec, const EDR_errTem *tem, unsigned int tag, unsigned int msk) |
unsigned int | CDF_err_compose (CDF_err *cdf, const EDR_err *err) |
Analyzes the error contribution of TEMs. | |
static __inline int | cdf_err_tem_cable_phase_match (unsigned short int pe, unsigned int tag) |
Checks if the TEM cable phase error word has the same value for all tag members and that value matches the value predicted from the event tag. | |
unsigned int | collapse (unsigned int lo, unsigned int hi) |
unsigned int | expand4to32 (int w) |
static __inline int | cdf_err_gtcc_find_width (const EBF_err *err, int idx, int wc) |
Ors the number of bits that will be used to pack the overflows on this GTCC. This is determined by or'ing the overflow count for each GTRC and using this to determine the number of bits it takes to pack th maximum overflow count. | |
static __inline unsigned int | cdf_err_gtcc_pack (unsigned int *buf, unsigned int pos, const EBF_err *err, int idx, int wc, int nbits) |
Finds the maximum number of overflows in a GTRC. | |
static unsigned int | cdf_err_tem_compress_tov (CDF_errTem *tem, unsigned int *buf, unsigned int pos, unsigned int tag) |
Compresses error records consisting only of FIFO full. | |
static unsigned int | cdf_err_tem_compress_copy (CDF_errTem *tem, unsigned int *buf, unsigned int pos, unsigned int tag) |
Compresses all other (not TEM BUG A or B) error records. | |
static unsigned int | cdf_err_tem_compress_bug_a (CDF_errTem *tem, unsigned int *buf, unsigned int pos, unsigned int tag) |
Compresses the TEM BUG A error records. | |
static unsigned int | cdf_err_tem_compress_bug_b (CDF_errTem *tem, unsigned int *buf, unsigned int pos, unsigned int tag) |
Compresses the TEM BUG B error records. | |
static __inline cdf_err_tem_compress_rtn | cdf_err_tem_classify (const CDF_errTem *tem, unsigned int tag) |
Compresses the fixed length information an error event. | |
unsigned int | CDF_err_compress (CDF_err *cdf, unsigned int *buf, unsigned int pos) |
Compresses the ERR contributions. |
CVS $Id: CDF_err.c,v 1.7 2012/11/30 17:31:59 russell Exp $
unsigned int CDF_err_compose | ( | CDF_err * | cdf, | |
const EDR_err * | err | |||
) |
Analyzes the error contribution of TEMs.
cdf | The error context block to compose | |
err | The unpacked error records |
cdf->to = ctids;
References _CDF_err::cal, _CDF_err::map, _CDF_err::tag, _CDF_err::tems, and _CDF_err::tkr.
unsigned int CDF_err_compress | ( | CDF_err * | cdf, | |
unsigned int * | buf, | |||
unsigned int | pos | |||
) |
Compresses the ERR contributions.
cdf | The ERR compression data formatting handle | |
buf | The output buffer | |
pos | The position of the next bit to fill |
References cdf_err_tem_classify(), _CDF_err::map, _CDF_err::tag, and _CDF_err::tems.
int CDF_err_construct | ( | CDF_err * | cdf, | |
int | level, | |||
const CDF_errCfg * | cfg, | |||
const LSEW_dgmFw * | dgmFw, | |||
void ** | mem | |||
) |
Constructs the CDF_err compression context.
Status |
cdf | The CDF_err compress context structure to fill | |
level | The maximum compression level that needs to be supported | |
cfg | Target specific configuration parameter | |
dgmFw | The datagram framework handle | |
mem | Pointer to free memory pointer, return as the the updated pointer. If cdf is equal to the current contents of mem, then mem will be advanced by the size of CDF_err, else this routine will believe that the only the variable allocation of cdf needs to be allocated. |
static __inline int cdf_err_gtcc_find_width | ( | const EBF_err * | err, | |
int | idx, | |||
int | wc | |||
) | [static] |
Ors the number of bits that will be used to pack the overflows on this GTCC. This is determined by or'ing the overflow count for each GTRC and using this to determine the number of bits it takes to pack th maximum overflow count.
[in] | err | The error record |
[in] | idx | The index to the beginning of this GTRC |
[in] | wc | The count of words in this GTRC |
(ncnt < pcnt ? ncnt : pcnt) + 1;
Referenced by cdf_err_tem_compress_tov().
static __inline unsigned int cdf_err_gtcc_pack | ( | unsigned int * | buf, | |
unsigned int | pos, | |||
const EBF_err * | err, | |||
int | idx, | |||
int | wc, | |||
int | nbits | |||
) | [static] |
Finds the maximum number of overflows in a GTRC.
[in] | buf | The output buffer |
[in] | pos | The current bit position in the output buffer |
[in] | err | The error record |
[in] | idx | The index to the beginning of this GTRC |
[in] | wc | The count of words in this GTRC |
[in] | nbits | The number of bits to use in packing the overflow count |
Referenced by cdf_err_tem_compress_tov().
int CDF_err_sizeof | ( | int | level, | |
const CDF_errCfg * | cfg | |||
) |
Returns the size, in bytes of the ERR compression structure needed to support the specified level.
level | The maximum compression level to support | |
cfg | Target specific configuration |
static __inline int cdf_err_tem_cable_phase_match | ( | unsigned short int | pe, | |
unsigned int | tag | |||
) | [static] |
Checks if the TEM cable phase error word has the same value for all tag members and that value matches the value predicted from the event tag.
== | 0, matches the value | |
!= | 0, does not match |
pe | The value of the cable phase error word | |
tag | The predicted tag value |
Referenced by cdf_err_tem_classify().
static __inline cdf_err_compress_rtn cdf_err_tem_classify | ( | const CDF_errTem * | tem, | |
unsigned int | tag | |||
) | [static] |
Compresses the fixed length information an error event.
tem | The information to be added to the header | |
tag | The event tag |
References cdf_err_tem_cable_phase_match(), cdf_err_tem_compress_bug_a(), cdf_err_tem_compress_bug_b(), cdf_err_tem_compress_copy(), cdf_err_tem_compress_tov(), _CDF_errTem::hdr, _CDF_errTemHeader::phase, _CDF_errTkr::summary, _CDF_errTemHeader::summary, and _CDF_errTem::tkr.
Referenced by CDF_err_compress().
static unsigned int cdf_err_tem_compress_bug_a | ( | CDF_errTem * | tem, | |
unsigned int * | buf, | |||
unsigned int | pos, | |||
unsigned int | tag | |||
) | [static] |
Compresses the TEM BUG A error records.
tem | The unpacked TEM error record | |
buf | The output buffer | |
pos | The position of the next bit to fill | |
tag | The event tag |
References _CDF_errTkrTimeout0::b, cdf_err_tem_compress_copy(), CDF_ERR_TEM_TYPE_K_BUG_A, _CDF_errTem::hdr, _CDF_errTkrTimeout::rc0, _CDF_errTkr::rc_pe, _CDF_errTkrTimeout::rcn, _CDF_errTkr::summary, _CDF_errTemHeader::summary, _CDF_errTkr::timeout, _CDF_errTem::tkr, and _CDF_errTem::type.
Referenced by cdf_err_tem_classify().
static unsigned int cdf_err_tem_compress_bug_b | ( | CDF_errTem * | tem, | |
unsigned int * | buf, | |||
unsigned int | pos, | |||
unsigned int | tag | |||
) | [static] |
Compresses the TEM BUG B error records.
tem | The unpacked error record | |
buf | The output buffer | |
pos | The position of the next bit to fill | |
tag | The event tag |
References CDF_ERR_TEM_TYPE_K_BUG_B, and _CDF_errTem::type.
Referenced by cdf_err_tem_classify().
static unsigned int cdf_err_tem_compress_copy | ( | CDF_errTem * | tem, | |
unsigned int * | buf, | |||
unsigned int | pos, | |||
unsigned int | tag | |||
) | [static] |
Compresses all other (not TEM BUG A or B) error records.
tem | The unpacked error record | |
buf | The output buffer | |
pos | The position of the next bit to fill | |
tag | The event tag |
References CDF_ERR_TEM_TYPE_K_OTHER, _CDF_errTem::edr, and _CDF_errTem::type.
Referenced by cdf_err_tem_classify(), and cdf_err_tem_compress_bug_a().
static unsigned int cdf_err_tem_compress_tov | ( | CDF_errTem * | tem, | |
unsigned int * | buf, | |||
unsigned int | pos, | |||
unsigned int | tag | |||
) | [static] |
Compresses error records consisting only of FIFO full.
tem | The unpacked error record | |
buf | The output buffer | |
pos | The position of the next bit to fill | |
tag | The event tag |
References cdf_err_gtcc_find_width(), cdf_err_gtcc_pack(), _CDF_errTem::edr, and _CDF_errTem::type.
Referenced by cdf_err_tem_classify().
int CDF_errCfg_construct | ( | CDF_errCfg * | cfg, | |
int | level, | |||
void ** | mem | |||
) |
Constructs the CDF_erfCfg compression configuration.
Status |
cfg | Target specific configuration | |
level | The maximum compression level that needs to be supported | |
mem | Pointer to free memory pointer, return as the the updated pointer. If cfg is equal to the current contents of mem, then mem will be advanced by the size of CDF_errCfg else this routine will believe that the only the variable allocation of cdf needs to be allocated. |
int CDF_errCfg_sizeof | ( | int | level | ) |
Returns the size, in bytes of the GEM compression configuration needed to support the specified level.
level | The maximum compression level to support |