GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSE / V2-1-0 > lsew / linux-gcc
#include <LSE/CDF_dgn.h>
#include <LSE/CDF_dgn_std.h>
#include <LSE/CDF_dgn_ped.h>
#include <CDF_dgn_def.h>
#include <EDS/EBF_dir.h>
#include <PBI/FFS.ih>
#include <string.h>
#include <dprintf.h>
#include <EDS/EDR_tkrUnpack.h>
Defines | |
#define | unpack_tkr(_tkr, _dir, _map) |
#define | analyze_tkr_twr(_stats, _tkr, _accept_0, _accept_1, _accept_2) |
#define | print_tkr_stats(_stats) |
Typedefs | |
typedef struct _EDR_tkrTower | EDR_tkrTower |
Functions | |
int | CDF_dgnCfg_sizeof (int level) |
Returns the size, in bytes of the DGN compression configuration needed to support the specified level. | |
int | CDF_dgnCfg_construct (CDF_dgnCfg *cfg, int level, void **mem) |
Constructs the CDF_dgnCfg compression configuration. | |
int | CDF_dgn_sizeof (int level, const CDF_dgnCfg *cfg) |
Returns the size, in bytes of the DGN compression structure needed to support the specified level. | |
int | CDF_dgn_construct (CDF_dgn *cdf, int level, const CDF_dgnCfg *cfg, const LSEW_dgmFw *dgmFw, void **mem) |
Constructs the CDF_dgn compression context. | |
CDF_dgn_std * | CDF_dgn_std_locate (CDF_dgn *cdf) |
CDF_dgn_ped * | CDF_dgn_ped_locate (CDF_dgn *cdf) |
unsigned int | CDF_dgn_gen_header_compress (unsigned int *buf, unsigned int pos, unsigned int xCalHiLo, unsigned int xCtids) |
Encodes the tower summary indicating which
| |
unsigned long long int | CDF_dgn_cal_tkr_nonempty_find (const unsigned int **dgns_p, unsigned int map, const EBF_dirCtbDsc *dscs, const EBF_dirAuxDsc *auxs) |
Compose a list of non-empty CAL and TKR diagnostic blocks. | |
static __inline unsigned int | trg_encode16 (unsigned int *buf, unsigned int pos, unsigned int trg) |
static __inline unsigned int | trg_encode32 (unsigned int *buf, unsigned int pos, unsigned int trg) |
Encodes the CAL HI/LO trigger word when both the CAL HI and CAL LO are non-zero. | |
unsigned int | CDF_dgn_gen_trg_compress (unsigned int *buf, unsigned int pos, const unsigned int *trgs, int cnt) |
Encodes the CAL log trigger diagnostic trigger data for all towers. This is a generic routine that can be used for both standard physics and pedestal evetns. | |
static int | encode_tkr_10 (unsigned int *buf, unsigned int pos, unsigned int cnt, unsigned int acnt, unsigned int xor, unsigned int tkr) |
static int | encode_tkr_11 (unsigned int *buf, unsigned int pos, int status, int cnt, int acnt, unsigned int xor, unsigned int tkr) |
static __inline unsigned short int | reverse9 (const char *rmap, unsigned int w) |
Reverses bit ordering of the lower 9 bits of w. | |
static __inline int | compressDgnTkrTwr (unsigned int *buf, unsigned int pos, int tem, unsigned int tkr_0, unsigned int tkr_1, unsigned int tkr_2, unsigned int dgn_0, unsigned int dgn_1, unsigned int dgn_2) |
static __inline unsigned int | encodeTkrDgn (CDF_dgn_gen_tkr *cdf, unsigned int *buf, unsigned int pos, const unsigned int *dgn, const EBF_dirCtbDsc *dsc, int tem) |
static __inline unsigned int | encodeTkrDgnErr (CDF_dgn_gen_tkr *cdf, unsigned int *buf, unsigned int pos, const unsigned int *dgn) |
unsigned int | CDF_dgn_gen_tkr_compress (CDF_dgn_gen_tkr *cdf, unsigned int *buf, unsigned int pos, unsigned int const **dgns, const EBF_dir *dir, unsigned int map, unsigned int err_ids) |
Variables | |
static const char | Reverse4 [16] |
Lookup table to reverse a 4-bit field. |
CVS $Id: CDF_dgn.c,v 1.5 2011/03/26 17:35:23 russell Exp $
int CDF_dgn_construct | ( | CDF_dgn * | cdf, | |
int | level, | |||
const CDF_dgnCfg * | cfg, | |||
const LSEW_dgmFw * | dgmFw, | |||
void ** | mem | |||
) |
Constructs the CDF_dgn compression context.
Status |
cdf | The CDF_dgn 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_dgn, else this routine will believe that the only the variable allocation of cdf needs to be allocated. |
References CDF_dgn_ped_construct(), CDF_dgn_std_construct(), _CDF_dgn::ped, and _CDF_dgn::std.
unsigned int CDF_dgn_gen_header_compress | ( | unsigned int * | buf, | |
unsigned int | pos, | |||
unsigned int | xCalHiLo, | |||
unsigned int | xCtids | |||
) |
Encodes the tower summary indicating which
buf | The output buffer | |
pos | The bit index | |
xCalHiLo | Bit mask of the non-matching CAL HI and CAL LO towers | |
xCtids | Bit mask of the non-matching CAL and TKR towers |
The number of the mismatches depends on the quantity
The encoding attempts to take advantage of these statistics. It treats the incoming data as three values
0 - all zero 10 - CAL ids zero, xCaLHiLo zero, TKR ids non-zero 110 - CAL ids zero, xCalHiLo nonzero, TKR_ids zero 1110 - CAL ids zero, xCalHiLo nonzero, TKR_ids nonzero 1111xx - CAL ids nonzero, xx gives non zero status
Referenced by CDF_dgn_ped_compress(), and CDF_dgn_std_compress().
unsigned int CDF_dgn_gen_trg_compress | ( | unsigned int * | buf, | |
unsigned int | pos, | |||
const unsigned int * | trgs, | |||
int | cnt | |||
) |
Encodes the CAL log trigger diagnostic trigger data for all towers. This is a generic routine that can be used for both standard physics and pedestal evetns.
buf | The output bit buffer | |
pos | The output bit index | |
trgs | The array of prepared trigger data for the list of towers with non-empty trigger data. | |
cnt | The count of dgn |
References trg_encode32().
Referenced by CDF_dgn_ped_cal_compress(), and CDF_dgn_std_cal_compress().
int CDF_dgn_sizeof | ( | int | level, | |
const CDF_dgnCfg * | cfg | |||
) |
Returns the size, in bytes of the DGN compression structure needed to support the specified level.
level | The maximum compression level to support | |
cfg | Target specific configuration |
References CDF_dgn_ped_sizeof(), and CDF_dgn_std_sizeof().
int CDF_dgnCfg_construct | ( | CDF_dgnCfg * | cfg, | |
int | level, | |||
void ** | mem | |||
) |
Constructs the CDF_dgnCfg 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_dgnCfg else this routine will believe that the only the variable allocation of cdf needs to be allocated. |
References CDF_dgn_ped_cfg_construct(), and CDF_dgn_std_cfg_construct().
int CDF_dgnCfg_sizeof | ( | int | level | ) |
Returns the size, in bytes of the DGN compression configuration needed to support the specified level.
level | The maximum compression level to support |
References CDF_dgn_ped_cfg_sizeof(), and CDF_dgn_std_cfg_sizeof().
static __inline unsigned short int reverse9 | ( | const char * | rmap, | |
unsigned int | w | |||
) | [static] |
Reverses bit ordering of the lower 9 bits of w.
rmap | The reversal map. This is purely a bow to efficiency so that the address does not have to keep getting reloaded each call. | |
w | The 9-bit value to bit-reverse. |
static __inline unsigned int trg_encode32 | ( | unsigned int * | buf, | |
unsigned int | pos, | |||
unsigned int | trg | |||
) | [static] |
Encodes the CAL HI/LO trigger word when both the CAL HI and CAL LO are non-zero.
buf | The output buffer | |
pos | The current bit position | |
trg | The 32-bit CAL HI/LO trigger word to encode. This word must be encoded as 4 x 1 byte quantities. The 4 bytes, from MSB to LSB are
|
Referenced by CDF_dgn_gen_trg_compress().
static const char Reverse4[16] [static] |
Initial value:
{ 0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe, 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf }