GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSEP / V3-5-1 > qsep / sun-gcc
#include <SIV.h>
#include <QSEP/QSEP_evt0.h>
#include <QSEP_pvtdef.h>
#include <QDFP_evt.h>
#include <QSE/QSE_evt.h>
#include <QSE/QSE_ctxUpdate.h>
#include <QSE/QDF_exc.h>
#include <LSEP/LSEP_evtCtb0.h>
#include <EDS/EBF_cid.h>
#include <EDS/EBF_pkt.h>
#include <EDS/EBF_ctb.h>
#include <EDS/EBF_evt.h>
#include <EDS/EBF_edw.h>
#include <EDS/EBF_cal.h>
#include <EDS/EBF_gem.h>
#include <EDS/EBF_gemLocate.h>
#include <PBI/Endianness.h>
#include <PBI/FFS.ih>
#include <PBI/Fletcher.h>
#include <PBI/Unions.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <dprintf.h>
Classes | |
struct | _Rsb |
Return Status Block, binds a status and length. More... | |
Defines | |
#define | PARITY_K_ODD 0x9669 |
A vector of bits whose bit number (counting from least significant bit = 0) gives the odd parity of a nibble of that bit number. | |
#define | GEM_CTB_SIZE (sizeof (EBF_ctbHdr) + sizeof (EBF_gem)) |
Convenience symbol for the size of a GEM contribution plus the Event Builder and Event Summary Words. | |
#define | RND_LEN32_TO_CELL(_n32) (((_n32) + 3) & ~0x3) |
Round a length, in 32-bit ints, to a 16 byte cell. | |
#define | _extractL(_bfu, _wrds, _position, _width) |
#define | _extractR(_bfu, _wrds, _position, _width) |
#define | KNOWN |
Defines a bit mask of the known. | |
#define | ADVANCE(_ptr, _nbytes) (void *)((unsigned char *)(_ptr) + (_nbytes)) |
Advances the specified pointer, _ptr by _nbytes. | |
Typedefs | |
typedef struct _Rsb | Rsb |
Typedef for struct _Rsb. | |
typedef int(* | QSEP_evt_updater )(QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ctxUpdateInfo *info) |
Call back signature for an event decoding routine. | |
typedef int(* | QSEP_evt_decoder )(QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ebfEvt *ebf, int ebf_size, unsigned int *ret_size) |
Call back signature for an event decoding routine. | |
Functions | |
static __inline unsigned int | checksum_compute (const unsigned int *data, int ndata) |
Compute the Fletcher checksum on the data array. | |
static __inline unsigned int | checksum_check (QSEP_dtxChecksum *checksum, unsigned int *data, int ndata) |
Computes the checksum over the indicated data and compares it with the checksum in the checksum context structure. | |
static __inline int | parityOdd16Calc (unsigned short int hword) |
Calculates the odd parity over the 16 bits in the specified half word. | |
static int | evtA_0_decode (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ebfEvt *ebf, int ebf_size, unsigned int *ret_size) |
Decodes Version 0, Format 0 events. | |
static int | evtA_1_decode (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ebfEvt *ebf, int ebf_size, unsigned int *ret_size) |
Decodes Version 0, Format 1 events. | |
static int | evtA_2_decode (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ebfEvt *ebf, int ebf_size, unsigned int *ret_size) |
Decodes Version 0, Format 2 events. | |
static int | evtA_3_decode (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ebfEvt *ebf, int ebf_size, unsigned int *ret_size) |
Decodes Version 0, Format 3 events. | |
static int | evtA_4_decode (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ebfEvt *ebf, int ebf_size, unsigned int *ret_size) |
Decodes Version 0, Format 4 events. | |
static int | evtA_5_decode (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ebfEvt *ebf, int ebf_size, unsigned int *ret_size) |
Decodes Version 0, Format 5 events. | |
static int | evtA_8_decode (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ebfEvt *ebf, int ebf_size, unsigned int *ret_size) |
Decodes Version 0, Format 8 events. | |
static int | evtA_decode_noop (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ebfEvt *ebf, int ebf_size, unsigned int *ret_size) |
Punts on unknown Version 0, formats. | |
static int | evtA_0_update (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ctxUpdateInfo *info) |
Provides update information Version 0, Format 0 events. | |
static int | evtA_1_update (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ctxUpdateInfo *info) |
Provides update information Version 0, Format 1 events. | |
static int | evtA_2_update (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ctxUpdateInfo *info) |
Provides update information Version 0, Format 2 events. | |
static int | evtA_3_update (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ctxUpdateInfo *info) |
Provides update information Version 0, Format 3 events. | |
static int | evtA_4_update (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ctxUpdateInfo *info) |
Provides update information Version 0, Format 4 events. | |
static int | evtA_5_update (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ctxUpdateInfo *info) |
static int | evtA_8_update (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ctxUpdateInfo *info) |
static int | evtB_8_update (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ctxUpdateInfo *info) |
static int | evtC_8_update (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ctxUpdateInfo *info) |
static int | evtA_update_noop (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ctxUpdateInfo *info) |
Punts on unknown Version 0 formats. | |
static __inline void * | copy (void *dst, const void *src, size_t nbytes) |
Copies the specified number of bytes from the source to the destination. | |
static __inline unsigned int | pad_to_cell (unsigned int *dst, unsigned int nbytes) |
Pads the destination address up to the next cell (16-byte) boundary. The number of pad bytes is computed by how short nbytes is from a 16-byte boundary. It is assumed that nbytes is a multiple of 4. | |
static __inline unsigned int | esw_reconstruct0_4 (LSEP_evtToc0_4_ctl ctl, unsigned int no_tack) |
Reconstruct the Event Summary Word from a version 0, format 4 control word. | |
static __inline unsigned int | ebw_reconstruct (const QSEP_dtx *dtx, unsigned int dstu) |
Reconstruct the Event Builder Word. | |
static int | is_known (unsigned char level) |
Tests if the format/compression level is known. | |
static __inline int | update_check (int rsd_bytes, int gem_bytes, unsigned char bridge, int nbytes) |
Checks if there is enough input data to accomodate both a possible result summary data block and a GEM contribution. | |
static __inline const unsigned int * | checksum_fill (QSEP_dtxChecksum *checksum, const unsigned int *cur, int bridge) |
Fills the checksum structure. | |
static const void * | rsd_fill (QSEP_ctxRsd *rsd, unsigned char bridge, const unsigned int *src) |
Copies the result summary data into the memory pointed to by the valid descriptors. | |
int | QSEP_evt0_update (QSEP_dtx *dtx, const LSF_record *ievt, QSE_ctxUpdateInfo *info) |
Dispatches the input event to the proper update handler. | |
int | QSEP_evt2_update (QSEP_dtx *dtx, const LSF_record *ievt, QSE_ctxUpdateInfo *info) |
Dispatches the input event to the proper update handler. | |
int | QSEP_evt3_update (QSEP_dtx *dtx, const LSF_record *ievt, QSE_ctxUpdateInfo *info) |
Dispatches the input event to the proper update handler for version 3 events. This events have a different error decoder to handle the TKR FIFO overflow error contributions. | |
static int | evt_8_update (QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ctxUpdateInfo *info, QDFP_evtUpdate update) |
int | QSEP_evt0_decode (QSEP_dtx *dtx, const LSF_record *ievt, QSE_ebfEvt *ebf, int ebf_size, unsigned int *ret_size) |
Dispatches the input event to the proper handler. | |
int | QSEP_evt2_decode (QSEP_dtx *dtx, const LSF_record *ievt, QSE_ebfEvt *ebf, int ebf_size, unsigned int *ret_size) |
Dispatches the input event to the proper handler. | |
int | QSEP_evt3_decode (QSEP_dtx *dtx, const LSF_record *ievt, QSE_ebfEvt *ebf, int ebf_size, unsigned int *ret_size) |
Dispatches the input event to the proper handler for version 3 events. This events have a different error decoder to handle the TKR FIFO overflow error contributions. | |
static __inline unsigned int * | header_add (unsigned int *dst) |
Adds the padding for the 8-word LCB header. | |
static __inline unsigned char * | pad (unsigned char *dst, int lwrd_cnt) |
Zeroes the specified number of longwords. | |
static unsigned int | decode0_4_5 (QSEP_dtx *dtx, const unsigned int *src, LSEP_evtToc0_4_ctl ctl, unsigned int dstu, unsigned int no_tack, const LSEP_evtToc0_4_tem tems[16], QSE_ebfEvt *ebf) |
Workhorse routine to decode version 0, format 4 and 5 events. | |
static __inline Rsb | toc5_fill (LSEP_evtToc0_4_tem tems[16], const LSEP_evtBdy0_5 *evt5, int bridge, const unsigned int *src_end, int dst_bytes) |
Fills a format 4 style table of contents from a format 5 style. | |
Variables | |
static const QSEP_evt_decoder | Decode0_1_2_3 [16] |
The dispatch table for the 16 levels of event format 0, 1, 2 encoded events. | |
static const QSEP_evt_updater | Update0_1 [16] |
The dispatch table for the 16 levels of format 0 and 1 events. | |
static const QSEP_evt_updater | Update2 [16] |
The dispatch table for the 16 levels for format 2 events. | |
static const QSEP_evt_updater | Update3 [16] |
The dispatch table for the 16 levels for format 3 events. |
CVS $Id: QSEP_evt0.c,v 1.26 2012/09/22 00:17:20 russell Exp $
#define _extractL | ( | _bfu, | |||
_wrds, | |||||
_position, | |||||
_width | ) |
Value:
(_bfu = BFU_wordL (_wrds, _bfu.cur, _position, _width),\ _position += _width, \ _bfu.val)
#define _extractR | ( | _bfu, | |||
_wrds, | |||||
_position, | |||||
_width | ) |
Value:
(_bfu = BFU_wordR (_wrds, _bfu.cur, _position, _width),\ _position += _width, \ _bfu.val)
#define ADVANCE | ( | _ptr, | |||
_nbytes | ) | (void *)((unsigned char *)(_ptr) + (_nbytes)) |
Advances the specified pointer, _ptr by _nbytes.
_ptr | The pointer to advance | |
_nbytes | The number of bytes to advance the pointer |
Referenced by copy(), decode0_4_5(), evtA_3_decode(), evtA_3_update(), evtA_4_decode(), evtA_5_decode(), and rsd_fill().
#define KNOWN |
Value:
((1 << 0) | \ (1 << 1) | \ (1 << 2) | \ (1 << 3) | \ (1 << 4) | \ (1 << 5) | \ (0 << 6) | \ (0 << 7) | \ (1 << 8))
Referenced by is_known().
#define PARITY_K_ODD 0x9669 |
A vector of bits whose bit number (counting from least significant bit = 0) gives the odd parity of a nibble of that bit number.
Idx Parity Index Parity Index Parity Index Parity C 1 8 0 4 0 0 1 D 0 9 1 5 1 1 0 E 0 A 1 6 1 2 0 F 1 B 0 7 0 3 1 0x 9 6 6 9
Referenced by parityOdd16Calc().
#define RND_LEN32_TO_CELL | ( | _n32 | ) | (((_n32) + 3) & ~0x3) |
Round a length, in 32-bit ints, to a 16 byte cell.
_n32 | The 32-bit length to round |
Referenced by evtA_4_decode(), and toc5_fill().
int(* QSEP_evt_decoder)(QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ebfEvt *ebf, int ebf_size, unsigned int *ret_size) |
Call back signature for an event decoding routine.
dtx | Decoding context | |
evt | The event data to decode | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. This contains up to 8 bits of format specific decoding information. | |
ebf | The output event structure to fill | |
ebf_size | The number of bytes available in ebf | |
ret_size | The number of bytes actually used in ebf. |
int(* QSEP_evt_updater)(QSEP_dtx *dtx, const unsigned int *edata, size_t nbytes, int bridge, QSE_ctxUpdateInfo *info) |
Call back signature for an event decoding routine.
dtx | Decoding context | |
evt | The event data to use in filling the update information | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. This contains up to 8 bits of format specific decoding information. | |
info | The update information structure to fill |
static __inline unsigned int checksum_check | ( | QSEP_dtxChecksum * | checksum, | |
unsigned int * | data, | |||
int | ndata | |||
) | [static] |
Computes the checksum over the indicated data and compares it with the checksum in the checksum context structure.
0,if | the checksums compare | |
QSEP_STATUS_K_CHECKSUM,if | the checksums do not compare |
checksum | The checksum context. Contains a flag indicating whether the checksum should be checked and the comparision value of the checksum | |
data | The 32-bit data array to checksum | |
ndata | The number of 32-bit elements in the data array |
References checksum_compute(), _QSEP_dtxChecksum::computed, _QSEP_dtxChecksum::datagram, QSEP_STATUS_K_CHECKSUM, and _QSEP_dtxChecksum::valid.
Referenced by evtA_8_decode().
static __inline unsigned int checksum_compute | ( | const unsigned int * | data, | |
int | ndata | |||
) | [static] |
Compute the Fletcher checksum on the data array.
data | The array of 32-bit data to checksum | |
ndata | The number of elements in the data array |
Referenced by checksum_check().
static __inline const unsigned int * checksum_fill | ( | QSEP_dtxChecksum * | checksum, | |
const unsigned int * | cur, | |||
int | bridge | |||
) | [static] |
Fills the checksum structure.
checksum | The checksum context to fill | |
cur | The current decoding location | |
bridge | The event record's bridge word |
References _QSEP_dtxChecksum::datagram, and _QSEP_dtxChecksum::valid.
Referenced by evt_8_update().
static __inline void * copy | ( | void * | dst, | |
const void * | src, | |||
size_t | nbytes | |||
) | [static] |
Copies the specified number of bytes from the source to the destination.
dst | The destination | |
src | The source | |
nbytes | The number of bytes to copy. This must be a multiple of 4 bytes |
References ADVANCE.
Referenced by evtA_1_decode(), evtA_2_decode(), and evtA_3_decode().
static unsigned int decode0_4_5 | ( | QSEP_dtx * | dtx, | |
const unsigned int * | src, | |||
LSEP_evtToc0_4_ctl | ctl, | |||
unsigned int | dstu, | |||
unsigned int | no_tack, | |||
const LSEP_evtToc0_4_tem | tems[16], | |||
QSE_ebfEvt * | ebf | |||
) | [static] |
Workhorse routine to decode version 0, format 4 and 5 events.
dtx | The decoding context | |
src | The start of input event data, this is the common piece of format 4 and 5 events, just past the header | |
ctl | The template for restoring the Event Summary Word. | |
dstu | The unique piece of the destination adddress | |
no_tack | The value of NOT TACK. | |
tems | The header information. This is in the format of event 4 events, so format 5 events must be first translated to this format before calling this routine | |
ebf | The output EBF event structure to fill |
References ADVANCE, ebw_reconstruct(), esw_reconstruct0_4(), header_add(), and parityOdd16Calc().
Referenced by evtA_4_decode(), and evtA_5_decode().
static __inline unsigned int ebw_reconstruct | ( | const QSEP_dtx * | dtx, | |
unsigned int | dstu | |||
) | [static] |
Reconstruct the Event Builder Word.
dtx | The event context information. This contains the original CPU number | |
dstu | The unique piece of the destination node address |
Referenced by decode0_4_5().
static unsigned int esw_reconstruct0_4 | ( | LSEP_evtToc0_4_ctl | ctl, | |
unsigned int | no_tack | |||
) | [static] |
Reconstruct the Event Summary Word from a version 0, format 4 control word.
ctl | The control word | |
no_tack | The value of no_tack. This value is inverted and stored as the value of the tack bit of the ESW. |
Referenced by decode0_4_5().
static int evt_8_update | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ctxUpdateInfo * | info, | |||
QDFP_evtUpdate | update | |||
) | [inline, static] |
dtx | The decoding context | |
edata | The input event data to get the update info from | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. If the LSB is set, this indicates the presence of the TEM contribution word immediately after the table of contents. | |
info | The event update structure to complete | |
update | The version specify update routine. |
References _QSEP_dtxEvt::beg, _QSEP_dtxEvt::bfu, _QSEP_dtxCtx::checksum, checksum_fill(), _QSEP_dtx::ctx, _QSEP_dtx::evt, _QSEP_dtxRsd::mbytes, _QSEP_dtxEvt::qdfp, _QSEP_dtxCtx::qdfp, _QSEP_dtxCtx::qsep, QSEP_STATUS_K_UNDRUN, _QSEP_ctx::rsd, _QSEP_dtxCtx::rsd, and rsd_fill().
Referenced by evtA_8_update(), and evtB_8_update().
static int evtA_0_decode | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ebfEvt * | ebf, | |||
int | ebf_size, | |||
unsigned int * | ret_size | |||
) | [static] |
Decodes Version 0, Format 0 events.
dtx | The decoding context | |
edata | The input event data to decode | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. Unused for format 0. | |
ebf | The output EBF event structure to fill | |
ebf_size | The number of bytes available in ebf | |
ret_size | The number of bytes actually used in ebf. |
ADVANCE (edata, rsd_bytes);
References _QSEP_dtxEvt::beg, _QSEP_dtx::evt, QSEP_STATUS_K_OVRRUN, QSEP_STATUS_K_TOO_SMALL, QSEP_STATUS_K_UNDRUN, SIV__hasErrors(), SIV__isLast(), SIV__isNotFirst(), SIV_init(), and SIV_update().
static int evtA_0_update | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ctxUpdateInfo * | info | |||
) | [static] |
Provides update information Version 0, Format 0 events.
dtx | The decoding context | |
edata | The input event data to get the update info from | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. Unused for format 0 | |
info | The event update structure to complete |
References _QSEP_dtxEvt::beg, _QSEP_dtx::ctx, _QSEP_dtx::evt, GEM_CTB_SIZE, _QSEP_dtxRsd::mbytes, _QSEP_dtxCtx::qsep, QSEP_STATUS_K_NOGEM, _QSEP_ctx::rsd, _QSEP_dtxCtx::rsd, rsd_fill(), and update_check().
static int evtA_1_decode | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ebfEvt * | ebf, | |||
int | ebf_size, | |||
unsigned int * | ret_size | |||
) | [static] |
Decodes Version 0, Format 1 events.
dtx | The decoding context | |
edata | The input event data to decode | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. Unused for format 1. | |
ebf | The output EBF event structure to fill | |
ebf_size | The number of bytes available in ebf | |
ret_size | The number of bytes actually used in ebf. |
ADVANCE (edata, rsd_bytes);
References _QSEP_dtxEvt::beg, copy(), _QSEP_dtx::evt, pad_to_cell(), and QSEP_STATUS_K_TOO_SMALL.
static int evtA_1_update | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ctxUpdateInfo * | info | |||
) | [static] |
Provides update information Version 0, Format 1 events.
dtx | The decoding context | |
edata | The input event data to get the update info from | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. Unused for format 1. | |
info | The event update structure to complete |
References _QSEP_dtxEvt::beg, _QSEP_dtx::ctx, _QSEP_dtx::evt, GEM_CTB_SIZE, _QSEP_dtxRsd::mbytes, _QSEP_dtxCtx::qsep, QSEP_STATUS_K_NOGEM, _QSEP_ctx::rsd, _QSEP_dtxCtx::rsd, rsd_fill(), and update_check().
static int evtA_2_decode | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ebfEvt * | ebf, | |||
int | ebf_size, | |||
unsigned int * | ret_size | |||
) | [static] |
Decodes Version 0, Format 2 events.
dtx | The decoding context | |
edata | The input event data to decode | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. Unused for format 2. | |
ebf | The output EBF event structure to fill | |
ebf_size | The number of bytes available in ebf | |
ret_size | The number of bytes actually used in ebf. |
ADVANCE (edata, rsd_bytes);
References _QSEP_dtxEvt::beg, copy(), _QSEP_dtx::evt, pad_to_cell(), and QSEP_STATUS_K_TOO_SMALL.
static int evtA_2_update | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ctxUpdateInfo * | info | |||
) | [static] |
Provides update information Version 0, Format 2 events.
dtx | The decoding context | |
edata | The input event data to get the update info from | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. Unused for format 2. | |
info | The event update structure to complete |
References _QSEP_dtxEvt::beg, _QSEP_dtx::ctx, _QSEP_dtx::evt, GEM_CTB_SIZE, _QSEP_dtxRsd::mbytes, _QSEP_dtxCtx::qsep, QSEP_STATUS_K_NOGEM, _QSEP_ctx::rsd, _QSEP_dtxCtx::rsd, rsd_fill(), and update_check().
static int evtA_3_decode | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ebfEvt * | ebf, | |||
int | ebf_size, | |||
unsigned int * | ret_size | |||
) | [static] |
Decodes Version 0, Format 3 events.
-1,Serious | decode error. |
dtx | The decoding context | |
edata | The input event data to decode | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. Unused for format 3. | |
ebf | The output EBF event structure to fill | |
ebf_size | The number of bytes available in ebf | |
ret_size | The number of bytes actually used in ebf. |
References ADVANCE, _QSEP_dtxEvt::beg, copy(), _QSEP_dtx::evt, header_add(), pad(), QSEP_STATUS_K_OVRRUN, QSEP_STATUS_K_TOO_SMALL, and QSEP_STATUS_K_UNDRUN.
static int evtA_3_update | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ctxUpdateInfo * | info | |||
) | [static] |
Provides update information Version 0, Format 3 events.
dtx | The decoding context | |
edata | The input event data to get the update info from | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. Unused for format 3. | |
info | The event update structure to complete |
References ADVANCE, _QSEP_dtxEvt::beg, _QSEP_dtx::ctx, _QSEP_dtx::evt, GEM_CTB_SIZE, _QSEP_dtxRsd::mbytes, _QSEP_dtxCtx::qsep, QSEP_STATUS_K_NOGEM, _QSEP_ctx::rsd, _QSEP_dtxCtx::rsd, rsd_fill(), and update_check().
static int evtA_4_decode | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ebfEvt * | ebf, | |||
int | ebf_size, | |||
unsigned int * | ret_size | |||
) | [static] |
Decodes Version 0, Format 4 events.
-1,Serious | decode error. |
dtx | The decoding context | |
edata | The input event data to decode | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. Unused for format 4. | |
ebf | The output EBF event structure to fill | |
ebf_size | The number of bytes available in ebf | |
ret_size | The number of bytes actually used in ebf. |
References ADVANCE, _QSEP_dtxEvt::beg, decode0_4_5(), _QSEP_dtx::evt, GEM_CTB_SIZE, QSEP_STATUS_K_DECOMPRESS, QSEP_STATUS_K_INCLEN, QSEP_STATUS_K_OVRRUN, QSEP_STATUS_K_TOO_SMALL, QSEP_STATUS_K_UNDRUN, and RND_LEN32_TO_CELL.
static int evtA_4_update | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ctxUpdateInfo * | info | |||
) | [static] |
Provides update information Version 0, Format 4 events.
dtx | The decoding context | |
edata | The input event data to get the update info from | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. Unused for format 4. | |
info | The event update structure to complete |
References _QSEP_dtxEvt::beg, _QSEP_dtx::ctx, _QSEP_dtx::evt, _QSEP_dtxRsd::mbytes, _QSEP_dtxCtx::qsep, QSEP_STATUS_K_NOGEM, _QSEP_ctx::rsd, _QSEP_dtxCtx::rsd, rsd_fill(), and update_check().
static int evtA_5_decode | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ebfEvt * | ebf, | |||
int | ebf_size, | |||
unsigned int * | ret_size | |||
) | [static] |
Decodes Version 0, Format 5 events.
-1,Serious | decode error. |
dtx | The decoding context | |
edata | The input event data to decode | |
bridge | The bridge word. If the LSB is set, this indicates the presence of the TEM contribution word immediately after the table of contents. | |
nbytes | The number of bytes in the event | |
ebf | The output EBF event structure to fill | |
ebf_size | The number of bytes available in ebf | |
ret_size | The number of bytes actually used in ebf. |
References ADVANCE, _QSEP_dtxEvt::beg, decode0_4_5(), _QSEP_dtx::evt, _Rsb::len32, QSEP_STATUS_K_DECOMPRESS, QSEP_STATUS_K_INCLEN, _Rsb::status, and toc5_fill().
static int evtA_5_update | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ctxUpdateInfo * | info | |||
) | [static] |
dtx | The decoding context | |
edata | The input event data to get the update info from | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. If the LSB is set, this indicates the presence of the TEM contribution word immediately after the table of contents. | |
info | The event update structure to complete |
References _QSEP_dtxEvt::beg, _QSEP_dtx::ctx, _QSEP_dtx::evt, _QSEP_dtxRsd::mbytes, _QSEP_dtxCtx::qsep, QSEP_STATUS_K_NOGEM, _QSEP_ctx::rsd, _QSEP_dtxCtx::rsd, rsd_fill(), and update_check().
static int evtA_8_decode | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ebfEvt * | ebf, | |||
int | ebf_size, | |||
unsigned int * | ret_size | |||
) | [static] |
Decodes Version 0, Format 8 events.
-1,Serious | decode error. |
dtx | The decoding context | |
edata | The input event data to decode | |
bridge | The bridge word. | |
nbytes | The number of bytes in the event | |
ebf | The output EBF event structure to fill | |
ebf_size | The number of bytes available in ebf | |
ret_size | The number of bytes actually used in ebf. |
References _QSEP_dtxEvt::bfu, _QSEP_dtxCtx::checksum, checksum_check(), _QSEP_dtx::ctx, _QDFP_evt::decode, _QSEP_dtx::evt, _QDFP_evt::exc, _QSEP_dtxEvt::qdfp, _QSEP_dtxCtx::qdfp, QSEP_STATUS_K_DECOMPRESS, and _QDFP_evt::repack.
static int evtA_8_update | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ctxUpdateInfo * | info | |||
) | [static] |
dtx | The decoding context | |
edata | The input event data to get the update info from | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. If the LSB is set, this indicates the presence of the TEM contribution word immediately after the table of contents. | |
info | The event update structure to complete |
References evt_8_update(), and QDFP_evtAUpdate().
static int evtA_decode_noop | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ebfEvt * | ebf, | |||
int | ebf_size, | |||
unsigned int * | ret_size | |||
) | [static] |
Punts on unknown Version 0, formats.
-1,Serious | decode error. |
dtx | The decoding context, ignored | |
edata | The input event data to decode, ignored | |
bridge | The bridge word. Unused for NOOP. | |
nbytes | The number of bytes in the event, ignored | |
ebf | The output EBF event structure to fill, ignored | |
ebf_size | The number of bytes available in ebf | |
ret_size | The number of bytes actually used in ebf. |
References QSEP_STATUS_K_UNKLVL.
static int evtA_update_noop | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ctxUpdateInfo * | info | |||
) | [static] |
Punts on unknown Version 0 formats.
-1,Serious | decode error. |
dtx | The decoding context, ignored | |
edata | The input event data to decode, ignored | |
bridge | The bridge word,ignored | |
nbytes | The number of bytes in the event, ignored | |
info | The event update structure to complete, ignored |
References QSEP_STATUS_K_UNKLVL.
static int evtB_8_update | ( | QSEP_dtx * | dtx, | |
const unsigned int * | edata, | |||
size_t | nbytes, | |||
int | bridge, | |||
QSE_ctxUpdateInfo * | info | |||
) | [static] |
dtx | The decoding context | |
edata | The input event data to get the update info from | |
nbytes | The number of bytes in the event | |
bridge | The bridge word. If the LSB is set, this indicates the presence of the TEM contribution word immediately after the table of contents. | |
info | The event update structure to complete |
References evt_8_update(), and QDFP_evtBUpdate().
static __inline unsigned int * header_add | ( | unsigned int * | dst | ) | [static] |
Adds the padding for the 8-word LCB header.
dst | Pointer to where to add the header |
Referenced by decode0_4_5(), and evtA_3_decode().
static int is_known | ( | unsigned char | level | ) | [static] |
Tests if the format/compression level is known.
== | 0 if not known | |
!= | 0 if known |
level | The compression lelve to check |
References KNOWN.
Referenced by QSEP_evt0_decode(), QSEP_evt0_update(), QSEP_evt2_decode(), QSEP_evt2_update(), QSEP_evt3_decode(), and QSEP_evt3_update().
static __inline unsigned char * pad | ( | unsigned char * | dst, | |
int | lwrd_cnt | |||
) | [static] |
Zeroes the specified number of longwords.
dst | The destination address | |
lwrd_cnt | The number of 32-bit words to zero |
Referenced by evtA_3_decode().
static __inline unsigned int pad_to_cell | ( | unsigned int * | dst, | |
unsigned int | nbytes | |||
) | [static] |
Pads the destination address up to the next cell (16-byte) boundary. The number of pad bytes is computed by how short nbytes is from a 16-byte boundary. It is assumed that nbytes is a multiple of 4.
dst | The destination address | |
nbytes | The number of bytes. (As an explanatory note, the beginning of the buffer is at (char *)dst - nbytes. This most be a multiple of 4 bytes |
Referenced by evtA_1_decode(), and evtA_2_decode().
int parityOdd16Calc | ( | unsigned short int | hword | ) | [static] |
Calculates the odd parity over the 16 bits in the specified half word.
hword | The half word (short int) to calculate the parity of. |
References PARITY_K_ODD.
Referenced by decode0_4_5().
int QSEP_evt0_decode | ( | QSEP_dtx * | dtx, | |
const LSF_record * | ievt, | |||
QSE_ebfEvt * | ebf, | |||
int | ebf_size, | |||
unsigned int * | ret_size | |||
) |
Dispatches the input event to the proper handler.
dtx | The decoding context | |
ievt | The input event data to decode | |
ebf | The output EBF event structure | |
ebf_size | The number of bytes available in ebf | |
ret_size | The number of bytes actually used. |
References _QSEP_dtx::ctx, Decode0_1_2_3, is_known(), _QSEP_dtxCtx::max_level, QSEP_STATUS_K_INSRSC, and QSEP_STATUS_K_UNKLVL.
Referenced by QSEP_evt0_update(), and QSEP_evt2_update().
int QSEP_evt0_update | ( | QSEP_dtx * | dtx, | |
const LSF_record * | ievt, | |||
QSE_ctxUpdateInfo * | info | |||
) |
Dispatches the input event to the proper update handler.
dtx | The decoding context | |
ievt | The input event data | |
info | The event update structure to complete |
References _QSEP_dtx::ctx, _QSEP_dtxEvt::decode, _QSEP_dtx::evt, is_known(), _QSEP_dtxCtx::max_level, QSEP_evt0_decode(), QSEP_STATUS_K_INSRSC, QSEP_STATUS_K_UNKLVL, and Update0_1.
Referenced by QSEP_updateAtContribution().
int QSEP_evt2_decode | ( | QSEP_dtx * | dtx, | |
const LSF_record * | ievt, | |||
QSE_ebfEvt * | ebf, | |||
int | ebf_size, | |||
unsigned int * | ret_size | |||
) |
Dispatches the input event to the proper handler.
dtx | The decoding context | |
ievt | The input event data to decode | |
ebf | The output EBF event structure | |
ebf_size | The number of bytes available in ebf | |
ret_size | The number of bytes actually used. |
References _QSEP_dtx::ctx, Decode0_1_2_3, is_known(), _QSEP_dtxCtx::max_level, QSEP_STATUS_K_INSRSC, and QSEP_STATUS_K_UNKLVL.
int QSEP_evt2_update | ( | QSEP_dtx * | dtx, | |
const LSF_record * | ievt, | |||
QSE_ctxUpdateInfo * | info | |||
) |
Dispatches the input event to the proper update handler.
dtx | The decoding context | |
ievt | The input event data | |
info | The event update structure to complete |
References _QSEP_dtx::ctx, _QSEP_dtxEvt::decode, _QSEP_dtx::evt, is_known(), _QSEP_dtxCtx::max_level, QSEP_evt0_decode(), QSEP_STATUS_K_INSRSC, QSEP_STATUS_K_UNKLVL, and Update2.
Referenced by QSEP_updateAtContribution().
int QSEP_evt3_decode | ( | QSEP_dtx * | dtx, | |
const LSF_record * | ievt, | |||
QSE_ebfEvt * | ebf, | |||
int | ebf_size, | |||
unsigned int * | ret_size | |||
) |
Dispatches the input event to the proper handler for version 3 events. This events have a different error decoder to handle the TKR FIFO overflow error contributions.
dtx | The decoding context | |
ievt | The input event data to decode | |
ebf | The output EBF event structure | |
ebf_size | The number of bytes available in ebf | |
ret_size | The number of bytes actually used. |
References _QSEP_dtx::ctx, Decode0_1_2_3, is_known(), _QSEP_dtxCtx::max_level, QSEP_STATUS_K_INSRSC, and QSEP_STATUS_K_UNKLVL.
Referenced by QSEP_evt3_update().
int QSEP_evt3_update | ( | QSEP_dtx * | dtx, | |
const LSF_record * | ievt, | |||
QSE_ctxUpdateInfo * | info | |||
) |
Dispatches the input event to the proper update handler for version 3 events. This events have a different error decoder to handle the TKR FIFO overflow error contributions.
dtx | The decoding context | |
ievt | The input event data | |
info | The event update structure to complete |
References _QSEP_dtx::ctx, _QSEP_dtxEvt::decode, _QSEP_dtx::evt, is_known(), _QSEP_dtxCtx::max_level, QSEP_evt3_decode(), QSEP_STATUS_K_INSRSC, QSEP_STATUS_K_UNKLVL, and Update3.
Referenced by QSEP_updateAtContribution().
static const void * rsd_fill | ( | QSEP_ctxRsd * | rsd, | |
unsigned char | bridge, | |||
const unsigned int * | src | |||
) | [static] |
Copies the result summary data into the memory pointed to by the valid descriptors.
rsd | The result summary data structure to fill | |
bridge | The bridge word, carries status information, in this case whether the event carries a result summary data. | |
src | The source data |
References ADVANCE, _QSEP_ctxRsd::dat_list, _QSEP_ctxRsd::dscs, _QSEP_rsdDsc::len, _QSEP_rsdDsc::ptr, _QSEP_rsdDsc::state, and _QSEP_ctxRsd::state_list.
Referenced by evt_8_update(), evtA_0_update(), evtA_1_update(), evtA_2_update(), evtA_3_update(), evtA_4_update(), and evtA_5_update().
static __inline Rsb toc5_fill | ( | LSEP_evtToc0_4_tem | tems[16], | |
const LSEP_evtBdy0_5 * | evt5, | |||
int | bridge, | |||
const unsigned int * | src_end, | |||
int | dst_bytes | |||
) | [static] |
Fills a format 4 style table of contents from a format 5 style.
tems | The array of TOC 4 style entries to fill | |
evt5 | Pointer to the input event | |
bridge | If bit 0 is set, then src[0] contains a bit mask of the containing missing contributors. | |
src_end | The ending source address | |
dst_bytes | The number of bytes in the destination data |
References GEM_CTB_SIZE, _Rsb::len32, QSEP_STATUS_K_OVRRUN, QSEP_STATUS_K_TOO_SMALL, QSEP_STATUS_K_UNDRUN, RND_LEN32_TO_CELL, and _Rsb::status.
Referenced by evtA_5_decode().
static __inline int update_check | ( | int | rsd_bytes, | |
int | gem_bytes, | |||
unsigned char | bridge, | |||
int | nbytes | |||
) | [static] |
Checks if there is enough input data to accomodate both a possible result summary data block and a GEM contribution.
0 | The is enough data | |
QSEP_STATUS_K_UNDRUN | More data is needed than is available |
rsd_bytes | Number of bytes in the result summary data block | |
gem_bytes | Number of bytes in the GEM contribution | |
bridge | The bridge word, carries status information, in this case whether the event carries a result summary data. | |
nbytes | The number of bytes that are available |
References QSEP_STATUS_K_UNDRUN.
Referenced by evtA_0_update(), evtA_1_update(), evtA_2_update(), evtA_3_update(), evtA_4_update(), and evtA_5_update().
static const QSEP_evt_decoder Decode0_1_2_3[16] [static] |
Initial value:
{ evtA_0_decode, evtA_1_decode, evtA_2_decode, evtA_3_decode, evtA_4_decode, evtA_5_decode, evtA_decode_noop, evtA_decode_noop, evtA_8_decode, evtA_decode_noop, evtA_decode_noop, evtA_decode_noop, evtA_decode_noop, evtA_decode_noop, evtA_decode_noop, evtA_decode_noop }
Referenced by QSEP_evt0_decode(), QSEP_evt2_decode(), and QSEP_evt3_decode().
static const QSEP_evt_updater Update0_1[16] [static] |
Initial value:
{ evtA_0_update, evtA_1_update, evtA_2_update, evtA_3_update, evtA_4_update, evtA_5_update, evtA_update_noop, evtA_update_noop, evtA_8_update, evtA_update_noop, evtA_update_noop, evtA_update_noop, evtA_update_noop, evtA_update_noop, evtA_update_noop, evtA_update_noop }
Referenced by QSEP_evt0_update().
static const QSEP_evt_updater Update2[16] [static] |
Initial value:
{ evtA_0_update, evtA_1_update, evtA_2_update, evtA_3_update, evtA_4_update, evtA_5_update, evtA_update_noop, evtA_update_noop, evtB_8_update, evtA_update_noop, evtA_update_noop, evtA_update_noop, evtA_update_noop, evtA_update_noop, evtA_update_noop, evtA_update_noop }
Referenced by QSEP_evt2_update().
static const QSEP_evt_updater Update3[16] [static] |
Initial value:
{ evtA_0_update, evtA_1_update, evtA_2_update, evtA_3_update, evtA_4_update, evtA_5_update, evtA_update_noop, evtA_update_noop, evtC_8_update, evtA_update_noop, evtA_update_noop, evtA_update_noop, evtA_update_noop, evtA_update_noop, evtA_update_noop, evtA_update_noop }
Referenced by QSEP_evt3_update().