GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / V2-12-1 > eds / rhel6-32


Interface   Data Structures   File List   Data Fields   Globals  

EDR_errUnpack.c File Reference

Routines to unpack the ERR data for all towers in the LAT. More...

#include <EDS/EDR_errUnpack.h>
#include <EDS/EDR_err.h>
#include <EDS/EBF_err.h>
#include <EDS/EBF_dir.h>
#include <EDS/EBF_tem.h>
#include <EDS/EBF_ctb.h>
#include <EDS/EBF_cid.h>
#include <PBI/FFS.ih>

Defines

#define dprintf(format,...)
#define declare(statement)

Functions

static __inline int edr_err_gccc_status_compose (int reason, int cc, int rc, int idx)
 Convenience function to compose a EDR_errGCCCStatus word.
static __inline int edr_err_gtcc_status_compose (int reason, int cc, int rc, int idx)
 Convenience function to compose a EDR_errGTCCStatus word.
static __inline int edr_err_cal_parse (EDR_errCal *cal, unsigned int mask, const unsigned short int *err, int curStatus, int max)
 Unpacks the CAL error contribution.
static __inline int edr_err_tkr_parse (EDR_errTkr *tkr, unsigned int mask, const unsigned short int *err, int curStatus, int max)
 Unpacks the TKR error contribution.
static __inline int edr_err_tkr_tov_parse (EDR_errTkr *tkr, unsigned int mask, const unsigned short int *err)
 Unpacks the TKR error contribution in th special case when it is known (from previous information carried in the EBF_dir) that the errors in this TKR error contribution are due solely to FIFO overflows.
static __inline int edr_err_tem_phase_parse (EDR_errTemPhase *phase, const unsigned short int *err, int curStatus, int max)
 Unpacks the TEM PHASE error contribution.
static __inline int edr_err_tem_timeout_parse (EDR_errTemTimeout *timeout, const unsigned short int *err, int curStatus, int max)
 Unpacks the TEM PHASE error contribution.
static __inline int edr_err_tem_parse (EDR_errTem *tem, const unsigned short int *err, int max, int tov)
 Produces a formatted dump of the error record.
int EDR_errUnpack (EDR_err *err, const EBF_dir *dir, unsigned int map)
 Unpacks the error records for the components specified by map of TEMs.
int EDR_errUnpackInit (EDR_err *err)
 One-time initialization an EDR_err structure.
void EDR_errUnpackReset (EDR_err *err)
 Resets the EDR_err structure, preparing it for a new event.
int EDR_errUnpackSizeof (void)
 Returns the size, in bytes, of a ERR LAT record.


Detailed Description

Routines to unpack the ERR data for all towers in the LAT.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: EDR_errUnpack.c,v 1.4 2012/09/12 23:39:40 russell Exp $

Function Documentation

static __inline int edr_err_cal_parse ( EDR_errCal cal,
unsigned int  calMask,
const unsigned short int *  err,
int  curStatus,
int  max 
) [static]

Unpacks the CAL error contribution.

Parameters:
cal The data structure to receive the parsed data
calMask The bit vector of which cable controls are in error
err The beginning of the error record
curStatus The current status of the decode. This includes the index to beginning of the CAL error record and the decoding status. This routine augments the decoding status and the index and returns this value.
max The maximum index

References _EDR_errCalStatus_bf::aborted, _EBF_errGCCC::bf, _EDR_errCalStatus::bf, _EDR_errCalStatus_bf::cc, _EDR_errCalStatus_bf::cc_err, _EDR_errStatus::ci, EDR_ERR_CAL_REASON_K_ILLWC, EDR_ERR_CAL_REASON_K_OVRRUN, EDR_ERR_COMPONENT_K_CAL, EDR_ERR_GCCC_REASON_K_MBZ, EDR_ERR_GCCC_REASON_K_TYPE, edr_err_gccc_status_compose(), _EDR_errCal::gcccs, _EBF_errGCCC_bf::gcrcs, _EDR_errCalStatus_bf::idx, _EDR_errCal::mask, _EBF_errGCCC_bf::mbz, _EDR_errCal::msgs, _EDR_errCalStatus_bf::reason, _EDR_errGCCCStatus::si, _EDR_errStatus::si, _EDR_errCalStatus::si, _EDR_errCal::status, _EBF_errGCCC_bf::sweep, _EBF_errGCCC_bf::type, and _EBF_errGCCC::us.

Referenced by edr_err_tem_parse().

static __inline int edr_err_gccc_status_compose ( int  reason,
int  cc,
int  rc,
int  idx 
) [static]

Convenience function to compose a EDR_errGCCCStatus word.

Returns:
The composed status word
Parameters:
reason The reason for the error, see EDR_ERR_GCCC_REASON_K,
cc The offending cable controller
rc The offending readout controller
idx The 16-bit word index of the offending word

References _EDR_errGCCCStatus::bf, _EDR_errGCCCStatus_bf::cc, _EDR_errGCCCStatus_bf::idx, _EDR_errGCCCStatus_bf::rc, _EDR_errGCCCStatus_bf::reason, _EDR_errGCCCStatus_bf::rsvd, and _EDR_errGCCCStatus::si.

Referenced by edr_err_cal_parse().

static __inline int edr_err_gtcc_status_compose ( int  reason,
int  cc,
int  rc,
int  idx 
) [static]

Convenience function to compose a EDR_errGTCCStatus word.

Returns:
The composed status word
Parameters:
reason The reason for the error, see EDR_ERR_GTCC_REASON_K,
cc The offending cable controller
rc The offending readout controller
idx The 16-bit word index of the offending word

References _EDR_errGTCCStatus::bf, _EDR_errGTCCStatus_bf::cc, _EDR_errGTCCStatus_bf::idx, _EDR_errGTCCStatus_bf::rc, _EDR_errGTCCStatus_bf::reason, _EDR_errGTCCStatus_bf::rsvd, and _EDR_errGTCCStatus::si.

Referenced by edr_err_tkr_parse().

static __inline int edr_err_tem_parse ( EDR_errTem tem,
const unsigned short int *  err,
int  max,
int  tov 
) [static]

Produces a formatted dump of the error record.

Parameters:
tem The structure to receive the unpacked data for this tem
err The error source data record
max The length, in 16-bit words of the err
tov Flag indicating this tem only has a TKR FIFO overflow error

References _EBF_errTemSummary::bf, _EDR_errTem::cal, _EBF_errTemSummary_bf::cal, EDR__errStatusIsAbort(), edr_err_cal_parse(), edr_err_tem_phase_parse(), edr_err_tem_timeout_parse(), edr_err_tkr_parse(), edr_err_tkr_tov_parse(), _EDR_errTem::esum, _EDR_errTemSummary::flags, _EDR_errTemSummary::msg, _EDR_errTem::phase, _EBF_errTemSummary_bf::phase, _EDR_errTem::rec, _EDR_errStatus::si, _EDR_errTem::timeout, _EBF_errTemSummary_bf::timeout, _EDR_errTem::tkr, _EBF_errTemSummary_bf::tkr, and _EBF_errTemSummary::us.

Referenced by EDR_errUnpack().

static __inline int edr_err_tem_phase_parse ( EDR_errTemPhase phase,
const unsigned short int *  err,
int  curStatus,
int  max 
) [static]

Unpacks the TEM PHASE error contribution.

Parameters:
phase The data structure to receive the parsed data
err The beginning of the error record
curStatus The current status of the decode. This includes the index to beginning of the PHASE error record and the decoding status. This routine augments the decoding status and the index and returns this value.
max The maximum index

References _EDR_errTemPhaseStatus_bf::aborted, _EDR_errTemPhaseStatus::bf, _EDR_errStatus::ci, _EDR_errTemPhaseStatus_bf::component, EDR_ERR_COMPONENT_K_TEM_PHASE, EDR_ERR_TEM_PHASE_REASON_K_OVRRUN, _EDR_errTemPhase::idx, _EDR_errTemPhaseStatus_bf::idx, _EDR_errTemPhaseStatus_bf::l0_err, _EDR_errTemPhase::msg, _EDR_errTemPhaseStatus_bf::reason, _EDR_errTemPhaseStatus::si, _EDR_errStatus::si, _EDR_errTemPhase::status, and _EBF_errTemPhase::us.

Referenced by edr_err_tem_parse().

static __inline int edr_err_tem_timeout_parse ( EDR_errTemTimeout timeout,
const unsigned short int *  err,
int  curStatus,
int  max 
) [static]

Unpacks the TEM PHASE error contribution.

Parameters:
timeout The data structure to receive the parsed data
err The beginning of the error record
curStatus The current status of the decode. This includes the index to beginning of the PHASE error record and the decoding status. This routine augments the decoding status and the index and returns this value.
max The maximum index

References _EDR_errTemTimeoutStatus_bf::aborted, _EBF_errTemTimeout::bf, _EDR_errTemTimeoutStatus::bf, _EDR_errStatus::ci, _EDR_errTemTimeoutStatus_bf::component, EDR_ERR_COMPONENT_K_TEM_TIMEOUT, EDR_ERR_TEM_TIMEOUT_REASON_K_MBZ, EDR_ERR_TEM_TIMEOUT_REASON_K_NOERR, EDR_ERR_TEM_TIMEOUT_REASON_K_OVRRUN, _EDR_errTemTimeout::idx, _EDR_errTemTimeoutStatus_bf::idx, _EDR_errTemTimeoutStatus_bf::l0_err, _EBF_errTemTimeout_bf::mbz, _EDR_errTemTimeout::msg, _EDR_errTemTimeoutStatus_bf::reason, _EDR_errTemTimeoutStatus::si, _EDR_errStatus::si, _EDR_errTemTimeout::status, and _EBF_errTemTimeout::us.

Referenced by edr_err_tem_parse().

static __inline int edr_err_tkr_parse ( EDR_errTkr tkr,
unsigned int  mask,
const unsigned short int *  err,
int  curStatus,
int  max 
) [static]

Unpacks the TKR error contribution.

Parameters:
tkr The data structure to receive the parsed data
mask The bit vector of which cable controls are in error
err The beginning of the error record
curStatus The current status of the decode. This includes the index to beginning of the TKR error record and the decoding status. This routine augments the decoding status and the index and returns this value.
max The maximum index

References _EDR_errTkrStatus_bf::aborted, _EBF_errGTRC::bf, _EDR_errTkrStatus::bf, _EDR_errTkrStatus_bf::cc, _EDR_errTkrStatus_bf::cc_err, _EDR_errStatus::ci, EBF__errGTRCStackCount(), EBF_ERR_GTCC_K_MAX_WC, EDR_ERR_COMPONENT_K_TKR, EDR_ERR_GTCC_REASON_K_BADRC, EDR_ERR_GTCC_REASON_K_NOERR, EDR_ERR_GTCC_REASON_K_ORDERRC, EDR_ERR_GTCC_REASON_K_OVRFLW, edr_err_gtcc_status_compose(), EDR_ERR_TKR_REASON_K_ILLWC, EDR_ERR_TKR_REASON_K_OVRRUN, _EDR_errTkr::esum, _EDR_errGTCC::esum, _EDR_errTkr::gtccs, _EDR_errGTCC::gtrcs, _EBF_errGTRC_bf::id, _EDR_errGTRC::idx, _EDR_errTkrStatus_bf::idx, _EDR_errGTCC::idx, _EDR_errTkrStatus_bf::rc_err, _EDR_errGTCC::rcs, _EDR_errTkrStatus_bf::reason, _EDR_errGTCCStatus::si, _EDR_errStatus::si, _EDR_errTkrStatus::si, _EDR_errTkr::status, _EDR_errGTCC::status, _EBF_errGTRC::us, and _EDR_errTkr::valid.

Referenced by edr_err_tem_parse().

static __inline int edr_err_tkr_tov_parse ( EDR_errTkr tkr,
unsigned int  mask,
const unsigned short int *  err 
) [static]

Unpacks the TKR error contribution in th special case when it is known (from previous information carried in the EBF_dir) that the errors in this TKR error contribution are due solely to FIFO overflows.

Parameters:
tkr The data structure to receive the parsed data
mask The bit vector of which cable controls are in error
err The beginning of the error record
Since this error contribution has been previously parsed, much of the usual error and consistency checking is unnecessary. Furthermore, since this a pure FIFO overflow, the count word can be believed so all that is really necessary is to stash away the status of this GTCC (i.e. it is pure FIFO overflow) and the indices in the error block of the beginning of each GTRCs.

References _EDR_errStatus::ci, _EDR_errTkr::esum, _EDR_errGTCC::esum, _EDR_errTkr::gtccs, _EDR_errGTCC::gtrcs, _EDR_errGTRC::idx, _EDR_errGTCC::idx, _EDR_errGTCC::rcs, _EDR_errStatus::si, _EDR_errTkrStatus::si, _EDR_errTkr::status, and _EDR_errTkr::valid.

Referenced by edr_err_tem_parse().

int EDR_errUnpack ( EDR_err err,
const EBF_dir dir,
unsigned int  map 
)

int EDR_errUnpackInit ( EDR_err err  ) 

One-time initialization an EDR_err structure.

Returns:
0, always
Parameters:
err The EDR_err structure to initialize

References _EDR_err::tem_ids, and _EDR_err::tems.

Referenced by initIxbObjTbl().

void EDR_errUnpackReset ( EDR_err err  ) 

Resets the EDR_err structure, preparing it for a new event.

Parameters:
err The EDR_err structure to reset

References _EDR_err::tem_ids.

Referenced by initIxbObjTbl().

int EDR_errUnpackSizeof ( void   ) 

Returns the size, in bytes, of a ERR LAT record.

Returns:
The size, in bytes, of a ERR LAT record.
This function should be called to determine the size of an EDR_err structure. This allows the calling program to avoid including the structure definition an EDR_err.

After allocating an EDR_err structure, the structure should be initialized using EDR_errUnpackInit().


Generated on Thu Sep 27 13:51:03 2012 by  doxygen 1.5.8