GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSE / V2-4-0 > qse / rhel6-64


Interface   Data Structures   File List   Data Fields   Globals  

QSE_aem.h File Reference

Defines the structure containing the unpacked the ACD record This differs from EDR_acd.h in that the order left in the order of ACD, not the GEM. More...

#include <PBI/Endianness.h>

Classes

struct  _QSE_aem_chn_af
 Maps out the information for one ADC channel as an alternative bit field representation, where the end bit is paired with the tile address to form the extended tile address and where all the fields of the PHA vector (ADC range, ADC value and PHA parity error fields are presented as a single PHA vector field. More...
struct  _QSE_aem_chn_bf
 Maps out the information for one ADC channel as the most primitve bit fields possible. More...
struct  _QSE_aem_chn_cf
 Maps out the information for one channel, as alternative bit field representation favoring consolidating all the state information as a single field and combining the ADC range and ADC value field as a single PHA field. More...
union  _QSE_aem_chn_u
 Maps out the information for one channel, union of bit field with unsigned int. More...
struct  _QSE_aem_cableStatus
 Summary cable bit status masks. More...
struct  _QSE_aem
 Holds the unpacked QSE_aem information. More...

Defines

#define ALWAYS_INLINE
#define QSE_AEM_CHN_COMPOSE(_field, _val)   ((_val) & QSE_AEM_CHN_N_ ## _field) << (QSE_AEM_CHN_V_ ## _field)
 Composes the in-place value for the specified field and _val. This can be used to assemble an QSE_aem_chn by ORing the resulting values.
#define QSE_AEM_CHN_EXTRACT(_chn, _field)   ((_chn) >> QSE_AEM_CHN_V_ ## _field) & (QSE_AEM_CHN_N_ ## _field)
 Extracts the specified bit field, _field from the specified QSE_aem_chn word, _chn.

Typedefs

typedef enum _QSE_AEM_K QSE_AEM_K
 Typedef for enum _AEM_K.
typedef enum _QSE_AEM_STATUS_M QSE_AEM_STATUS_M
 Typedef for enum _QSE_AEM_STATUS_M.
typedef enum _QSE_AEM_CHN_S QSE_AEM_CHN_S
 Typedef for enum _QSE_AEM_CHN_S.
typedef enum _QSE_AEM_CHN_V QSE_AEM_CHN_V
 Typedef for enum _QSE_AEM_CHN_V.
typedef enum _QSE_AEM_CHN_N QSE_AEM_CHN_N
 Typedef for enum _QSE_AEM_CHN_N.
typedef enum _QSE_AEM_CHN_M QSE_AEM_CHN_M
 Typedef for enum _QSE_AEM_CHN_M.
typedef unsigned int QSE_aem_chn
 Typedef for the 32-bit word containing information about a channel.
typedef struct _QSE_aem_chn_af QSE_aem_chn_af
 Typedef for struct _QSE_aem_chn_af.
typedef struct _QSE_aem_chn_bf QSE_aem_chn_bf
 Typedef for struct _QSE_aem_chn_bf.
typedef struct _QSE_aem_chn_cf QSE_aem_chn_cf
 Typedef for struct _QSE_aem_chn_cf.
typedef union _QSE_aem_chn_u QSE_aem_chn_u
 Typedef for union _QSE_aem_chn_u.
typedef struct _QSE_aem_cableStatus QSE_aem_cableStatus
 Typedef for _QSE_aem_cableStatus;.
typedef struct _QSE_aem QSE_aem
 typedef for struct _QSE_aem

Enumerations

enum  _QSE_AEM_K {
  QSE_AEM_K_NCHNS_PER_CABLE = 18,
  QSE_AEM_K_NCABLES = 12,
  QSE_AEM_K_NCHNS
}
 Enumerates the attributes of the AEM EBF record. More...
enum  _QSE_AEM_STATUS_M {
  QSE_AEM_STATUS_M_FATAL = 0x80000000,
  QSE_AEM_STATUS_M_ABSENT = 0x40000000,
  QSE_AEM_STATUS_M_ABORTED = 0x20000000,
  QSE_AEM_STATUS_M_RSVD_27 = 0x10000000,
  QSE_AEM_STATUS_M_DAT_OVRRUN = 0x08000000,
  QSE_AEM_STATUS_M_DAT_UNDRUN = 0x04000000,
  QSE_AEM_STATUS_M_CBL_PARITY = 0x02000000,
  QSE_AEM_STATUS_M_CBL_ILL = 0x01000000,
  QSE_AEM_STATUS_M_CBL_ORDER = 0x00800000,
  QSE_AEM_STATUS_M_CBL_DUP = 0x00400000,
  QSE_AEM_STATUS_M_CBL_OVRRUN = 0x00200000,
  QSE_AEM_STATUS_M_CBL_TIMEOUT = 0x00100000,
  QSE_AEM_STATUS_M_PHA_OVRRUN = 0x00080000,
  QSE_AEM_STATUS_M_PHA_UNDRUN = 0x00040000,
  QSE_AEM_STATUS_M_PHA_PARITY = 0x00020000
}
 QSE_AEM status bits. More...
enum  _QSE_AEM_CHN_S {
  QSE_AEM_CHN_S_HIT = 1,
  QSE_AEM_CHN_S_ACCEPT = 1,
  QSE_AEM_CHN_S_VALID = 1,
  QSE_AEM_CHN_S_PE = 1,
  QSE_AEM_CHN_S_ADC = 12,
  QSE_AEM_CHN_S_RNG = 1,
  QSE_AEM_CHN_S_RSVD = 6,
  QSE_AEM_CHN_S_ECABLE = 4,
  QSE_AEM_CHN_S_ECHN = 5,
  QSE_AEM_CHN_S_VAH = 3,
  QSE_AEM_CHN_S_PVAH = 4,
  QSE_AEM_CHN_S_PHA = 13,
  QSE_AEM_CHN_S_PHAVEC = 14
}
 The size, in bits, of the various bit fields in the channel information word. More...
enum  _QSE_AEM_CHN_V {
  QSE_AEM_CHN_V_HIT = 0,
  QSE_AEM_CHN_V_ACCEPT = 1,
  QSE_AEM_CHN_V_VALID = 2,
  QSE_AEM_CHN_V_PE = 3,
  QSE_AEM_CHN_V_ADC = 4,
  QSE_AEM_CHN_V_RNG = 16,
  QSE_AEM_CHN_V_RSVD = 17,
  QSE_AEM_CHN_V_ECHN = 23,
  QSE_AEM_CHN_V_ECABLE = 28,
  QSE_AEM_CHN_V_VAH = QSE_AEM_CHN_V_HIT,
  QSE_AEM_CHN_V_PVAH = QSE_AEM_CHN_V_HIT,
  QSE_AEM_CHN_V_PHA = QSE_AEM_CHN_V_ADC,
  QSE_AEM_CHN_V_PHAVEC = QSE_AEM_CHN_V_PE
}
 The right justified bit offset, of the various bit fields in the channel information word. More...
enum  _QSE_AEM_CHN_N {
  QSE_AEM_CHN_N_HIT = ((1 << QSE_AEM_CHN_S_HIT ) - 1),
  QSE_AEM_CHN_N_ACCEPT = ((1 << QSE_AEM_CHN_S_ACCEPT) - 1),
  QSE_AEM_CHN_N_VALID = ((1 << QSE_AEM_CHN_S_VALID ) - 1),
  QSE_AEM_CHN_N_PE = ((1 << QSE_AEM_CHN_S_PE ) - 1),
  QSE_AEM_CHN_N_ADC = ((1 << QSE_AEM_CHN_S_ADC ) - 1),
  QSE_AEM_CHN_N_RNG = ((1 << QSE_AEM_CHN_S_RNG ) - 1),
  QSE_AEM_CHN_N_RSVD = ((1 << QSE_AEM_CHN_S_RSVD ) - 1),
  QSE_AEM_CHN_N_ECHN = ((1 << QSE_AEM_CHN_S_ECHN ) - 1),
  QSE_AEM_CHN_N_ECABLE = ((1 << QSE_AEM_CHN_S_ECABLE) - 1),
  QSE_AEM_CHN_N_VAH = ((1 << QSE_AEM_CHN_S_VAH ) - 1),
  QSE_AEM_CHN_N_PVAH = ((1 << QSE_AEM_CHN_S_PVAH ) - 1),
  QSE_AEM_CHN_N_PHA = ((1 << QSE_AEM_CHN_S_PHA ) - 1),
  QSE_AEM_CHN_N_PHAVEC = ((1 << QSE_AEM_CHN_S_PHAVEC) - 1)
}
 The right justified bit masks of the various bit fields in the channel information word. More...
enum  _QSE_AEM_CHN_M {
  QSE_AEM_CHN_M_HIT,
  QSE_AEM_CHN_M_ACCEPT,
  QSE_AEM_CHN_M_VALID,
  QSE_AEM_CHN_M_PE,
  QSE_AEM_CHN_M_ADC,
  QSE_AEM_CHN_M_RNG,
  QSE_AEM_CHN_M_RSVD,
  QSE_AEM_CHN_M_ECHN,
  QSE_AEM_CHN_M_ECABLE,
  QSE_AEM_CHN_M_VAH,
  QSE_AEM_CHN_M_PVAH,
  QSE_AEM_CHN_M_PHA,
  QSE_AEM_CHN_M_PHAVEC
}
 The in place bit masks of the various bit fields in the channel information word. More...

Functions

static __inline unsigned int QSE_aem_chn__hit (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__accept (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__valid (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__pe (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__adc (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__rng (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__end (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__ecable (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__echn (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__vah (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__pvah (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__pha (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__hit_compose (unsigned int hit) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__accept_compose (unsigned int accept) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__valid_compose (unsigned int valid) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__pe_compose (unsigned int pe) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__adc_compose (unsigned int adc) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__rng_compose (unsigned int rng) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__ecable_compose (unsigned int ecable) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__echn_compose (unsigned int ecable) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__vah_compose (unsigned int vah) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__pvah_compose (unsigned int pvah) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__pha_compose (unsigned int pha) ALWAYS_INLINE
static __inline unsigned int QSE_aem_chn__phavec (unsigned int chn)
static __inline unsigned int QSE_aem_chn__phavec_compose (unsigned int phavec)


Detailed Description

Defines the structure containing the unpacked the ACD record This differs from EDR_acd.h in that the order left in the order of ACD, not the GEM.

Author:
JJRussell - russell@slac.stanford.edu
    CVS $Id: QSE_aem.h,v 1.4 2011/03/27 01:45:43 russell Exp $

Define Documentation

#define QSE_AEM_CHN_COMPOSE ( _field,
_val   )     ((_val) & QSE_AEM_CHN_N_ ## _field) << (QSE_AEM_CHN_V_ ## _field)

Composes the in-place value for the specified field and _val. This can be used to assemble an QSE_aem_chn by ORing the resulting values.

Returns:
The in-place value for the specified _field and _val
Parameters:
_field The name of the field to compose. This is just the suffix of the enum QSE_AEM_CHN_M.
_val The value of the field. This value will be masked to fit in the width of the field and then shifted into the proper bit position.
Example
To compose a QSE_aem_chn word

#define QSE_AEM_CHN_EXTRACT ( _chn,
_field   )     ((_chn) >> QSE_AEM_CHN_V_ ## _field) & (QSE_AEM_CHN_N_ ## _field)

Extracts the specified bit field, _field from the specified QSE_aem_chn word, _chn.

Returns:
The extracted field. All fields are treated as unsigned integers.
Parameters:
_chn The QSE_aem_chn word to extract the field from
_field The name of the field to compose. This is just the suffix of the enum QSE_AEM_CHN_M.
Example
       ecable    = QSE_AEM_CHN_EXTRACT (chn, ECABLE);
       echn      = QSE_AEM_CHN_EXTRACT (chn, ECHN);
       rng       = QSE_AEM_CHN_EXTRACT (chn, RNG);
       adc       = QSE_AEM_CHN_EXTRACT (chn, ADC);
       adc_pe    = QSE_AEM_CHN_EXTRACT (chn, PE);
       adc_valid = QSE_AEM_CHN_EXTRACT (chn, VALID);
       accept    = QSE_AEM_CHN_EXTRACT (chn, ACCEPT);
       hit       = QSE_AEM_CHN_EXTRACT (chn, HIT);


Typedef Documentation

Typedef for _QSE_aem_cableStatus;.

For the most part this structure captures the various errors that can be encountered when serially unpacking the data. The unpacker generally classifies errors into 3 classes

  1. Fatal and abortable
  2. Fatal but not abortable
  3. Data quality errors

Fatal and Abortable
These are errors serious enough that the unpacker, in all likelihood can no longer navigate the data stream. Once an error of this type is encountered, the parsing of the input data stream is aborted and bits indicating a fatal abortable of the relevant type has been encountered are added to the status word. Also the bit mask that is bookkeeping errors of this type has the relevant bit set.
Fatal, but not Abortable
These are serious errors, but the unpacker still feels it can continue to parse the event, in the hopes of gathering more information about the exact nature of the error. When an error of this type is encountered, the bits indicating a fatal error of the relevant type has been encountered are added to the status word. Also the bit mask that is bookkeeping errors of this type has the relevant bit set. The unpacker continues to parse the event.
Data Quality Errors
These are errors that do not affect the ability of the unpacker to navigate the event. These errors affect data quality. Since the level of data quality is particular to the consumer of the data, the unpacker merely marks up the error in the status word and sets the relevant bit in the cable error word. One should note that it is not clear whether a data header parity error should be treated as structural, and therefore fatal error, or, as has been chosen, as a data quality error.


Enumeration Type Documentation

The in place bit masks of the various bit fields in the channel information word.

Enumerator:
QSE_AEM_CHN_M_HIT  Right justified bit offset of the hit status field
QSE_AEM_CHN_M_ACCEPT  Right justified bit offset of the accept status field
QSE_AEM_CHN_M_VALID  Right justified bit offset of the pha valid field
QSE_AEM_CHN_M_PE  Right justified bit offset of the pha parity error field
QSE_AEM_CHN_M_ADC  Right justified bit offset of the PHA ADC value
QSE_AEM_CHN_M_RNG  Right justified bit offset of the PHA range bit field
QSE_AEM_CHN_M_RSVD  Right justified bit offset of the reserved field
QSE_AEM_CHN_M_ECHN  Right justified bit offset of the electronics channel number field. This identifies the source channel on the free board. Legitimate value are 0-17.
QSE_AEM_CHN_M_ECABLE  Right justified bit offset of the electronics cable number field. The least significant bit of this field overlaps with the end field. Legitimate values for this field are 0-11
QSE_AEM_CHN_M_VAH  Right justified bit offset of the combined PHA valid, accept and hit status fields
QSE_AEM_CHN_M_PVAH  Right justified bit offset the combined PHA parity, PHA valid, accept and hit status fields
QSE_AEM_CHN_M_PHA  Right justified bit offset of the combined PHA range and PHA ADC value fields
QSE_AEM_CHN_M_PHAVEC  Right justified bit offset of the combined PHA range, PHA ADC value and PHA parity error fields

The right justified bit masks of the various bit fields in the channel information word.

Enumerator:
QSE_AEM_CHN_N_HIT  Right justified bit offset of the hit status field
QSE_AEM_CHN_N_ACCEPT  Right justified bit offset of the accept status field
QSE_AEM_CHN_N_VALID  Right justified bit offset of the pha valid field
QSE_AEM_CHN_N_PE  Right justified bit offset of the pha parity error field
QSE_AEM_CHN_N_ADC  Right justified bit offset of the PHA ADC value
QSE_AEM_CHN_N_RNG  Right justified bit offset of the PHA range bit field
QSE_AEM_CHN_N_RSVD  Right justified bit offset of the reserved field
QSE_AEM_CHN_N_ECHN  Right justified bit offset of the electronics channel number field. This identifies the source channel on the free board. Legitimate value are 0-17.
QSE_AEM_CHN_N_ECABLE  Right justified bit offset of the electronics cable number field. The least significant bit of this field overlaps with the end field. Legitimate values for this field are 0-11
QSE_AEM_CHN_N_VAH  Right justified bit offset of the combined PHA valid, accept and hit status fields
QSE_AEM_CHN_N_PVAH  Right justified bit offset the combined PHA parity, PHA valid, accept and hit status fields
QSE_AEM_CHN_N_PHA  Right justified bit offset of the combined PHA range and PHA ADC value fields
QSE_AEM_CHN_N_PHAVEC  Right justified bit offset of the combined PHA range, PHA ADC value and PHA parity error fields

The size, in bits, of the various bit fields in the channel information word.

Enumerator:
QSE_AEM_CHN_S_HIT  Size, in bits, of the hit status field
QSE_AEM_CHN_S_ACCEPT  Size, in bits, of the accept status field
QSE_AEM_CHN_S_VALID  Size, in bits, of the pha valid field
QSE_AEM_CHN_S_PE  Size, in bits, of the pha parity error field
QSE_AEM_CHN_S_ADC  Size, in bits, of the PHA ADC value
QSE_AEM_CHN_S_RNG  Size, in bits, of the PHA ADC range bit field
QSE_AEM_CHN_S_RSVD  Size, in bits, of the reserved field
QSE_AEM_CHN_S_ECABLE  Size, in bits, of the electronics cable number field. The least significant bit of this field gives the cable end (A=-0, B=1)
QSE_AEM_CHN_S_ECHN  Size, in bits, of the electronics channel number field. This identifies the source channel on the free board. Legitimate value are 0-17.
QSE_AEM_CHN_S_VAH  Size, in bits, of the combined PHA valid, accept and hit status fields
QSE_AEM_CHN_S_PVAH  Size, in bits, of the combined PHA parity, PHA valid, accept and hit status fields
QSE_AEM_CHN_S_PHA  Size, in bits, of the combined PHA ADC range and PHA ADC fields
QSE_AEM_CHN_S_PHAVEC  Size, in bits, of the combined PHA ADC range, PHA ADC fields and PHA parity error fields

The right justified bit offset, of the various bit fields in the channel information word.

Enumerator:
QSE_AEM_CHN_V_HIT  Right justified bit offset of the hit status field
QSE_AEM_CHN_V_ACCEPT  Right justified bit offset of the accept status field
QSE_AEM_CHN_V_VALID  Right justified bit offset of the pha valid field
QSE_AEM_CHN_V_PE  Right justified bit offset of the pha parity error field
QSE_AEM_CHN_V_ADC  Right justified bit offset of the PHA ADC value
QSE_AEM_CHN_V_RNG  Right justified bit offset of the PHA range bit field
QSE_AEM_CHN_V_RSVD  Size, in bits, of the reserved field
QSE_AEM_CHN_V_ECHN  Right justified bit offset of the electronics channel number field. This identifies the source channel on the free board. Legitimate value are 0-17.
QSE_AEM_CHN_V_ECABLE  Right justified bit offset of the electronics cable number field. The least significant bit of this field gives the cable end (A=-0, B=1)
QSE_AEM_CHN_V_VAH  Right justified bit offset of the combined PHA valid, accept and hit status fields
QSE_AEM_CHN_V_PVAH  Right justified bit offset the combined PHA parity, PHA valid, accept and hit status fields
QSE_AEM_CHN_V_PHA  Right justified bit offset of the combined PHA range and PHA ADC value fields
QSE_AEM_CHN_V_PHAVEC  Right justified bit offsetof the combined PHA range and PHA ADC value and PHA parity error fields

enum _QSE_AEM_K

Enumerates the attributes of the AEM EBF record.

Enumerator:
QSE_AEM_K_NCHNS_PER_CABLE  Number of channels per cable
QSE_AEM_K_NCABLES  Number of boards in AEM
QSE_AEM_K_NCHNS  Total number of electronics channels

QSE_AEM status bits.

Enumerator:
QSE_AEM_STATUS_M_FATAL  Fatal error
QSE_AEM_STATUS_M_ABSENT  No ACD contribution
QSE_AEM_STATUS_M_ABORTED  Unpacking was aborted
QSE_AEM_STATUS_M_RSVD_27  Reserved
QSE_AEM_STATUS_M_DAT_OVRRUN  Overran available data
QSE_AEM_STATUS_M_DAT_UNDRUN  Underran available data
QSE_AEM_STATUS_M_CBL_PARITY  Parity error on a cable
QSE_AEM_STATUS_M_CBL_ILL  Bad cable number
QSE_AEM_STATUS_M_CBL_ORDER  Bad cable order
QSE_AEM_STATUS_M_CBL_DUP  Duplicate cable number
QSE_AEM_STATUS_M_CBL_OVRRUN  Too much stuff on a cable
QSE_AEM_STATUS_M_CBL_TIMEOUT  Timeout on the cable
QSE_AEM_STATUS_M_PHA_OVRRUN  Overran available PHAs
QSE_AEM_STATUS_M_PHA_UNDRUN  Underran available PHAs
QSE_AEM_STATUS_M_PHA_PARITY  Parity error on a PHA


Generated on Thu Sep 27 16:44:51 2012 by  doxygen 1.5.8