GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / V2-11-6 > eds / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

ACD_rec.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  _ACD_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  _ACD_chn_bf
 Maps out the information for one ADC channel as the most primitve bit fields possible. More...
struct  _ACD_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  _ACD_chn_u
struct  _ACD_cableStatus
 Summary cable bit status masks. More...
struct  _ACD_rec
 Holds the unpacked ACD information. More...

Defines

#define ALWAYS_INLINE
#define ACD_CHN_COMPOSE(_field, _val)   ((_val) & ACD_CHN_N_ ## _field) << (ACD_CHN_V_ ## _field)
 Composes the in-place value for the specified field and _val. This can be used to assemble an ACD_chn by ORing the resulting values.
#define ACD_CHN_EXTRACT(_chn, _field)   ((_chn) >> ACD_CHN_V_ ## _field) & (ACD_CHN_N_ ## _field)
 Extracts the specified bit field, _field from the specified ACD_chn word, _chn.

Typedefs

typedef enum _ACD_K ACD_K
 Typedef for enum _ACD_K.
typedef enum _ACD_STATUS_M ACD_STATUS_M
 Typedef for enum _ACD_STATUS_M.
typedef enum _ACD_CHN_S ACD_CHN_S
 Typedef for enum _ACD_CHN_S.
typedef enum _ACD_CHN_V ACD_CHN_V
 Typedef for enum _ACD_CHN_V.
typedef enum _ACD_CHN_N ACD_CHN_N
 Typedef for enum _ACD_CHN_N.
typedef enum _ACD_CHN_M ACD_CHN_M
 Typedef for enum _ACD_CHN_M.
typedef struct _ACD_chn_af ACD_chn_af
 Typedef for struct _ACD_chn_af.
typedef struct _ACD_chn_bf ACD_chn_bf
 Typedef for struct _ACD_chn_bf.
typedef struct _ACD_chn_cf ACD_chn_cf
 Typedef for struct _ACD_chn_cf.
typedef union _ACD_chn_u ACD_chn_u
typedef struct _ACD_cableStatus ACD_cableStatus
 Typedef for _ACD_cableStatus;.
typedef unsigned int ACD_chn
 Typedef for union _ACD_chn.
typedef struct _ACD_rec ACD_rec
 typedef for struct _ACD_record

Enumerations

enum  _ACD_K {
  ACD_K_NCHNS_PER_CABLE = 18,
  ACD_K_NCABLES = 12,
  ACD_K_NCHNS = ACD_K_NCHNS_PER_CABLE * ACD_K_NCABLES
}
 Enumerates the attributes of the ACD EBF record. More...
enum  _ACD_STATUS_M {
  ACD_STATUS_M_FATAL = 0x80000000,
  ACD_STATUS_M_ABORTED = 0x40000000,
  ACD_STATUS_M_RSVD_27 = 0x20000000,
  ACD_STATUS_M_RSVD_28 = 0x10000000,
  ACD_STATUS_M_DAT_OVRRUN = 0x08000000,
  ACD_STATUS_M_DAT_UNDRUN = 0x04000000,
  ACD_STATUS_M_CBL_PARITY = 0x02000000,
  ACD_STATUS_M_CBL_ILL = 0x01000000,
  ACD_STATUS_M_CBL_ORDER = 0x00800000,
  ACD_STATUS_M_CBL_DUP = 0x00400000,
  ACD_STATUS_M_CBL_OVRRUN = 0x00200000,
  ACD_STATUS_M_CBL_TIMEOUT = 0x00100000,
  ACD_STATUS_M_PHA_OVRRUN = 0x00080000,
  ACD_STATUS_M_PHA_UNDRUN = 0x00040000,
  ACD_STATUS_M_PHA_PARITY = 0x00020000
}
 ACD status bits. More...
enum  _ACD_CHN_S {
  ACD_CHN_S_HIT = 1,
  ACD_CHN_S_ACCEPT = 1,
  ACD_CHN_S_VALID = 1,
  ACD_CHN_S_PE = 1,
  ACD_CHN_S_ADC = 12,
  ACD_CHN_S_RNG = 1,
  ACD_CHN_S_RSVD = 6,
  ACD_CHN_S_ECABLE = 4,
  ACD_CHN_S_ECHN = 5,
  ACD_CHN_S_VAH = 3,
  ACD_CHN_S_PVAH = 4,
  ACD_CHN_S_PHA = 13,
  ACD_CHN_S_PHAVEC = 14
}
 The size, in bits, of the various bit fields in the channel information word. More...
enum  _ACD_CHN_V {
  ACD_CHN_V_HIT = 0,
  ACD_CHN_V_ACCEPT = 1,
  ACD_CHN_V_VALID = 2,
  ACD_CHN_V_PE = 3,
  ACD_CHN_V_ADC = 4,
  ACD_CHN_V_RNG = 16,
  ACD_CHN_V_RSVD = 17,
  ACD_CHN_V_ECHN = 23,
  ACD_CHN_V_ECABLE = 28,
  ACD_CHN_V_VAH = ACD_CHN_V_HIT,
  ACD_CHN_V_PVAH = ACD_CHN_V_HIT,
  ACD_CHN_V_PHA = ACD_CHN_V_ADC,
  ACD_CHN_V_PHAVEC = ACD_CHN_V_PE
}
 The right justified bit offset, of the various bit fields in the channel information word. More...
enum  _ACD_CHN_N {
  ACD_CHN_N_HIT = ((1 << ACD_CHN_S_HIT ) - 1),
  ACD_CHN_N_ACCEPT = ((1 << ACD_CHN_S_ACCEPT) - 1),
  ACD_CHN_N_VALID = ((1 << ACD_CHN_S_VALID ) - 1),
  ACD_CHN_N_PE = ((1 << ACD_CHN_S_PE ) - 1),
  ACD_CHN_N_ADC = ((1 << ACD_CHN_S_ADC ) - 1),
  ACD_CHN_N_RNG = ((1 << ACD_CHN_S_RNG ) - 1),
  ACD_CHN_N_RSVD = ((1 << ACD_CHN_S_RSVD ) - 1),
  ACD_CHN_N_ECHN = ((1 << ACD_CHN_S_ECHN ) - 1),
  ACD_CHN_N_ECABLE = ((1 << ACD_CHN_S_ECABLE) - 1),
  ACD_CHN_N_VAH = ((1 << ACD_CHN_S_VAH ) - 1),
  ACD_CHN_N_PVAH = ((1 << ACD_CHN_S_PVAH ) - 1),
  ACD_CHN_N_PHA = ((1 << ACD_CHN_S_PHA ) - 1),
  ACD_CHN_N_PHAVEC = ((1 << ACD_CHN_S_PHAVEC) - 1)
}
 The right justified bit masks of the various bit fields in the channel information word. More...
enum  _ACD_CHN_M {
  ACD_CHN_M_HIT = ((1 << ACD_CHN_S_HIT ) - 1) << ACD_CHN_V_HIT,
  ACD_CHN_M_ACCEPT = ((1 << ACD_CHN_S_ACCEPT) - 1) << ACD_CHN_V_ACCEPT,
  ACD_CHN_M_VALID = ((1 << ACD_CHN_S_VALID ) - 1) << ACD_CHN_V_VALID,
  ACD_CHN_M_PE = ((1 << ACD_CHN_S_PE ) - 1) << ACD_CHN_V_PE,
  ACD_CHN_M_ADC = ((1 << ACD_CHN_S_ADC ) - 1) << ACD_CHN_V_ADC,
  ACD_CHN_M_RNG = ((1 << ACD_CHN_S_RNG ) - 1) << ACD_CHN_V_RNG,
  ACD_CHN_M_RSVD = ((1 << ACD_CHN_S_RSVD ) - 1) << ACD_CHN_V_RSVD,
  ACD_CHN_M_ECHN = ((1 << ACD_CHN_S_ECHN ) - 1) << ACD_CHN_V_ECHN,
  ACD_CHN_M_ECABLE = ((1 << ACD_CHN_S_ECABLE) - 1) << ACD_CHN_V_ECABLE,
  ACD_CHN_M_VAH = ((1 << ACD_CHN_S_VAH ) - 1) << ACD_CHN_V_VAH,
  ACD_CHN_M_PVAH = ((1 << ACD_CHN_S_PVAH ) - 1) << ACD_CHN_V_PVAH,
  ACD_CHN_M_PHA = ((1 << ACD_CHN_S_PHA ) - 1) << ACD_CHN_V_PHA,
  ACD_CHN_M_PHAVEC = ((1 << ACD_CHN_S_PHAVEC) - 1) << ACD_CHN_V_PHAVEC
}
 The in place bit masks of the various bit fields in the channel information word. More...

Functions

static __inline unsigned int ACD__chn_hit (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int ACD__chn_accept (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int ACD__chn_valid (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int ACD__chn_pe (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int ACD__chn_adc (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int ACD__chn_rng (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int ACD__chn_end (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int ACD__chn_ecable (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int ACD__chn_echn (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int ACD__chn_vah (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int ACD__chn_pvah (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int ACD__chn_pha (unsigned int chn) ALWAYS_INLINE
static __inline unsigned int ACD__chn_hit_compose (unsigned int hit) ALWAYS_INLINE
static __inline unsigned int ACD__chn_accept_compose (unsigned int accept) ALWAYS_INLINE
static __inline unsigned int ACD__chn_valid_compose (unsigned int valid) ALWAYS_INLINE
static __inline unsigned int ACD__chn_pe_compose (unsigned int pe) ALWAYS_INLINE
static __inline unsigned int ACD__chn_adc_compose (unsigned int adc) ALWAYS_INLINE
static __inline unsigned int ACD__chn_rng_compose (unsigned int rng) ALWAYS_INLINE
static __inline unsigned int ACD__chn_ecable_compose (unsigned int ecable) ALWAYS_INLINE
static __inline unsigned int ACD__chn_echn_compose (unsigned int ecable) ALWAYS_INLINE
static __inline unsigned int ACD__chn_vah_compose (unsigned int vah) ALWAYS_INLINE
static __inline unsigned int ACD__chn_pvah_compose (unsigned int pvah) ALWAYS_INLINE
static __inline unsigned int ACD__chn_pha_compose (unsigned int pha) ALWAYS_INLINE
static __inline unsigned int ACD__chn_phavec (unsigned int chn)
static __inline unsigned int ACD__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: ACD_rec.h,v 1.4 2011/03/25 22:16:54 russell Exp $

Define Documentation

#define ACD_CHN_COMPOSE ( _field,
_val   )     ((_val) & ACD_CHN_N_ ## _field) << (ACD_CHN_V_ ## _field)

Composes the in-place value for the specified field and _val. This can be used to assemble an ACD_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 ACD_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 ACD_chn word
        acd_chn = ACD_CHN_COMPOSE (ECABLE, 1)
                | ACD_CHN_COMPOSE (ECHN,  12)
                | ACD_CHN_COMPOSE (RNG,    0)
                | ACD_CHN_COMPOSE (ADC,  100)
                | ACD_CHN_COMPOSE (PE,     0)
                | ACD_CHN_COMPOSE (VALID,  1)
                | ACD_CHN_COMPOSE (ACCEPT, 1)
                | ACD_CHN_COMPOSE (HIT,    1)

#define ACD_CHN_EXTRACT ( _chn,
_field   )     ((_chn) >> ACD_CHN_V_ ## _field) & (ACD_CHN_N_ ## _field)

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

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


Typedef Documentation

Typedef for _ACD_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.

unsigned int ACD_chn

Typedef for union _ACD_chn.

Typedef for the 32-bit word containing information about a channel.


Enumeration Type Documentation

enum _ACD_CHN_M

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

Enumerator:
ACD_CHN_M_HIT  Right justified bit offset of the hit status field
ACD_CHN_M_ACCEPT  Right justified bit offset of the accept status field
ACD_CHN_M_VALID  Right justified bit offset of the pha valid field
ACD_CHN_M_PE  Right justified bit offset of the pha parity error field
ACD_CHN_M_ADC  Right justified bit offset of the PHA ADC value
ACD_CHN_M_RNG  Right justified bit offset of the PHA range bit field
ACD_CHN_M_RSVD  Right justified bit offset of the reserved field
ACD_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.
ACD_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
ACD_CHN_M_VAH  Right justified bit offset of the combined PHA valid, accept and hit status fields
ACD_CHN_M_PVAH  Right justified bit offset the combined PHA parity, PHA valid, accept and hit status fields
ACD_CHN_M_PHA  Right justified bit offset of the combined PHA range and PHA ADC value fields
ACD_CHN_M_PHAVEC  Right justified bit offset of the combined PHA range, PHA ADC value and PHA parity error fields

enum _ACD_CHN_N

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

Enumerator:
ACD_CHN_N_HIT  Right justified bit offset of the hit status field
ACD_CHN_N_ACCEPT  Right justified bit offset of the accept status field
ACD_CHN_N_VALID  Right justified bit offset of the pha valid field
ACD_CHN_N_PE  Right justified bit offset of the pha parity error field
ACD_CHN_N_ADC  Right justified bit offset of the PHA ADC value
ACD_CHN_N_RNG  Right justified bit offset of the PHA range bit field
ACD_CHN_N_RSVD  Right justified bit offset of the reserved field
ACD_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.
ACD_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
ACD_CHN_N_VAH  Right justified bit offset of the combined PHA valid, accept and hit status fields
ACD_CHN_N_PVAH  Right justified bit offset the combined PHA parity, PHA valid, accept and hit status fields
ACD_CHN_N_PHA  Right justified bit offset of the combined PHA range and PHA ADC value fields
ACD_CHN_N_PHAVEC  Right justified bit offset of the combined PHA range, PHA ADC value and PHA parity error fields

enum _ACD_CHN_S

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

Enumerator:
ACD_CHN_S_HIT  Size, in bits, of the hit status field
ACD_CHN_S_ACCEPT  Size, in bits, of the accept status field
ACD_CHN_S_VALID  Size, in bits, of the pha valid field
ACD_CHN_S_PE  Size, in bits, of the pha parity error field
ACD_CHN_S_ADC  Size, in bits, of the PHA ADC value
ACD_CHN_S_RNG  Size, in bits, of the PHA ADC range bit field
ACD_CHN_S_RSVD  Size, in bits, of the reserved field
ACD_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)
ACD_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.
ACD_CHN_S_VAH  Size, in bits, of the combined PHA valid, accept and hit status fields
ACD_CHN_S_PVAH  Size, in bits, of the combined PHA parity, PHA valid, accept and hit status fields
ACD_CHN_S_PHA  Size, in bits, of the combined PHA ADC range and PHA ADC fields
ACD_CHN_S_PHAVEC  Size, in bits, of the combined PHA ADC range, PHA ADC fields and PHA parity error fields

enum _ACD_CHN_V

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

Enumerator:
ACD_CHN_V_HIT  Right justified bit offset of the hit status field
ACD_CHN_V_ACCEPT  Right justified bit offset of the accept status field
ACD_CHN_V_VALID  Right justified bit offset of the pha valid field
ACD_CHN_V_PE  Right justified bit offset of the pha parity error field
ACD_CHN_V_ADC  Right justified bit offset of the PHA ADC value
ACD_CHN_V_RNG  Right justified bit offset of the PHA range bit field
ACD_CHN_V_RSVD  Size, in bits, of the reserved field
ACD_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.
ACD_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)
ACD_CHN_V_VAH  Right justified bit offset of the combined PHA valid, accept and hit status fields
ACD_CHN_V_PVAH  Right justified bit offset the combined PHA parity, PHA valid, accept and hit status fields
ACD_CHN_V_PHA  Right justified bit offset of the combined PHA range and PHA ADC value fields
ACD_CHN_V_PHAVEC  Right justified bit offsetof the combined PHA range and PHA ADC value and PHA parity error fields

enum _ACD_K

Enumerates the attributes of the ACD EBF record.

Enumerator:
ACD_K_NCHNS_PER_CABLE  Number of channels per cable
ACD_K_NCABLES  Number of boards in ACD

ACD status bits.

Enumerator:
ACD_STATUS_M_FATAL  Fatal error
ACD_STATUS_M_ABORTED  Unpacking was aborted
ACD_STATUS_M_RSVD_27  Not unpacked yet
ACD_STATUS_M_RSVD_28  Reserved
ACD_STATUS_M_DAT_OVRRUN  Overran the available data
ACD_STATUS_M_DAT_UNDRUN  Underran the available data
ACD_STATUS_M_CBL_PARITY  Parity error on a cable
ACD_STATUS_M_CBL_ILL  Bad cable number
ACD_STATUS_M_CBL_ORDER  Bad cable order
ACD_STATUS_M_CBL_DUP  Duplicate cable number
ACD_STATUS_M_CBL_OVRRUN  Too much stuff on a cable
ACD_STATUS_M_CBL_TIMEOUT  Timeout on the cable
ACD_STATUS_M_PHA_OVRRUN  Overran the available PHAs
ACD_STATUS_M_PHA_UNDRUN  Underran the available PHAs
ACD_STATUS_M_PHA_PARITY  Parity error on a PHA


Generated on Fri Dec 9 16:49:42 2011 by  doxygen 1.5.8