GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSE / V2-3-0 > qse / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

QDF_gem.c File Reference

Implements the GEM decoding routines. More...

#include "QSE/QSE_ctx.h"
#include "QSE/QDF_gem.h"
#include "QSE/QDF_esb.h"
#include "QDF_gem_def.h"
#include "QDF_esb_def.h"
#include "LSE/CDF_gemdef.h"
#include "EDS/FFS.h"
#include "LDT/BFU.h"
#include <string.h>

Defines

#define NULL   ((void *)(0))

Functions

static BFU gem_std_decode (QDF_gemCtx *qdf, QDF_gemEvt *gem, const unsigned int *src, unsigned int max, BFU bfu)
 Decodes the GEM when encoded in the standard fashion.
static BFU gem_ped_decode (QDF_gemCtx *qdf, QDF_gemEvt *gem, const unsigned int *src, unsigned int max, BFU bfu)
 Decodes the GEM when encoded in the pedestal (non-physics) fashion.
static __inline BFU gem_unpack_primitives (QDF_gemCtx *qdf, QDF_gemEvt *gem, const unsigned int *src, unsigned int max, BFU bfu)
 Unpacks the GEM trigger primitives.
static __inline BFU gem_unpack_conditions (QDF_gemCtx *qdf, QDF_gemEvt *gem, const unsigned int *src, unsigned int max, BFU bfu)
 Unpacks/restores the GEM trigger conditions.
static __inline BFU gem_unpack_deadzone (QDF_gemCtx *qdf, QDF_gemEvt *gem, const unsigned int *src, unsigned int max, BFU bfu)
 Unpacks/restores the deadzone counter.
static __inline BFU gem_unpack_times (QDF_gemCtx *qdf, QDF_gemEvt *gem, const unsigned int *src, unsigned int max, BFU bfu)
 Unpacks/restores the trigger and livetime counter values.
static __inline BFU gem_unpack_prescaled (QDF_gemCtx *qdf, QDF_gemEvt *gem, const unsigned int *src, unsigned int max, BFU bfu)
 Unpacks/restores the prescale counter.
static __inline BFU gem_unpack_discarded (QDF_gemCtx *qdf, QDF_gemEvt *gem, const unsigned int *src, unsigned int max, BFU bfu)
 Unpacks/restores the discard counter.
static __inline BFU gem_unpack_condtimes (QDF_gemCtx *qdf, QDF_gemEvt *gem, const unsigned int *src, unsigned int max, BFU bfu)
 Unpacks/restores the condition arrival times.
static __inline BFU gem_unpack_dwinevt (QDF_gemCtx *qdf, QDF_gemEvt *gem, const unsigned int *src, unsigned int max, BFU bfu)
 Unpacks/restores the delta window and trigger events times.
static __inline BFU gem_unpack_acd (QDF_gemCtx *qdf, QDF_gemEvt *gem, const unsigned int *src, unsigned int max, BFU bfu)
 Unpacks/restores the list of struck ACD addresses.
int QDF_gemCtxSizeof (unsigned int level, void *prm)
 Returns the size, in bytes of the GEM decoding context needed to support the specified compression level.
QDF_gemCtxQDF_gemCtxConstruct (QDF_gemCtx *ctx, unsigned int level, void *prm, const QSE_ctx *qse)
 Constructs (initializes) the specified GEM decoding context structure.
void QDF_gemCtxUpdate (QDF_gemCtx *ctx, const QFR_fileCtx *qfr, const CDF_gemBdy *bdy)
 Updates the GEM context. This generally called during the root update phase.
int QDF_gemEvtSizeof (unsigned int level, void *prm)
 Returns the size, in bytes of QDF GEM event needed to support the specified compression level.
QDF_gemEvtQDF_gemEvtConstruct (QDF_gemEvt *evt, unsigned int level, void *prm, QDF_exc *exc, const QDF_esbEvt *esb)
 Constructs (initializes) the specified GEM event structure.
const EBF_gem * QDF_gemEvtGemGet (const QDF_gemEvt *evt)
 Returns a pointer to the EBF gem structure.
BFU QDF_gemDecode (QDF_gemCtx *qdf, QDF_gemEvt *gem, const unsigned int *src, unsigned int max, BFU bfu)
 Decodes the GEM.


Detailed Description

Implements the GEM decoding routines.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: QDF_gem.c,v 1.6 2008/06/09 21:17:00 russell Exp $

Function Documentation

BFU gem_ped_decode ( QDF_gemCtx qdf,
QDF_gemEvt gem,
const unsigned int *  src,
unsigned int  max,
BFU  bfu 
) [static]

Decodes the GEM when encoded in the pedestal (non-physics) fashion.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
qdf The compressed data decoding context
gem The GEM block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

BFU gem_std_decode ( QDF_gemCtx qdf,
QDF_gemEvt gem,
const unsigned int *  src,
unsigned int  max,
BFU  bfu 
) [static]

Decodes the GEM when encoded in the standard fashion.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
qdf The compressed data decoding context
gem The GEM block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline BFU gem_unpack_acd ( QDF_gemCtx qdf,
QDF_gemEvt gem,
const unsigned int *  src,
unsigned int  max,
BFU  bfu 
) [static]

Unpacks/restores the list of struck ACD addresses.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
qdf The compressed data decoding context
gem The GEM block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline BFU gem_unpack_conditions ( QDF_gemCtx qdf,
QDF_gemEvt gem,
const unsigned int *  src,
unsigned int  max,
BFU  bfu 
) [static]

Unpacks/restores the GEM trigger conditions.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
qdf The compressed data decoding context
gem The GEM block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline BFU gem_unpack_condtimes ( QDF_gemCtx qdf,
QDF_gemEvt gem,
const unsigned int *  src,
unsigned int  max,
BFU  bfu 
) [static]

Unpacks/restores the condition arrival times.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
qdf The compressed data decoding context
gem The GEM block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline BFU gem_unpack_deadzone ( QDF_gemCtx qdf,
QDF_gemEvt gem,
const unsigned int *  src,
unsigned int  max,
BFU  bfu 
) [static]

Unpacks/restores the deadzone counter.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
gem The GEM block to fill in
qdf The compressed data decoding context
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline BFU gem_unpack_discarded ( QDF_gemCtx qdf,
QDF_gemEvt gem,
const unsigned int *  src,
unsigned int  max,
BFU  bfu 
) [static]

Unpacks/restores the discard counter.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
qdf The compressed data decoding context
gem The GEM block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline BFU gem_unpack_dwinevt ( QDF_gemCtx qdf,
QDF_gemEvt gem,
const unsigned int *  src,
unsigned int  max,
BFU  bfu 
) [static]

Unpacks/restores the delta window and trigger events times.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
qdf The compressed data decoding context
gem The GEM block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline BFU gem_unpack_prescaled ( QDF_gemCtx qdf,
QDF_gemEvt gem,
const unsigned int *  src,
unsigned int  max,
BFU  bfu 
) [static]

Unpacks/restores the prescale counter.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
qdf The compressed data decoding context
gem The GEM block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline BFU gem_unpack_primitives ( QDF_gemCtx qdf,
QDF_gemEvt gem,
const unsigned int *  src,
unsigned int  max,
BFU  bfu 
) [static]

Unpacks the GEM trigger primitives.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
qdf The compressed data decoding context
gem The GEM block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline BFU gem_unpack_times ( QDF_gemCtx qdf,
QDF_gemEvt gem,
const unsigned int *  src,
unsigned int  max,
BFU  bfu 
) [static]

Unpacks/restores the trigger and livetime counter values.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
qdf The compressed data decoding context
gem The GEM block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer
Note:
This routine does not exactly parallel the gem_pack_times routine in CDF_gem.c. Since the value of 1 PPS register is carried in the global event context (it only changes once a second), there is no need to store it in the event. Rather it is picked out of the QSE_ctx structure.

QDF_gemCtx * QDF_gemCtxConstruct ( QDF_gemCtx ctx,
unsigned int  level,
void *  prm,
const QSE_ctx qse 
)

Constructs (initializes) the specified GEM decoding context structure.

Returns:
Pointer to the context structure to construct
Parameters:
ctx The context structure to construct.
level The maximum level of compression that will be supported.
prm Additional configuation parameter, unused as of now
qse Pointer to the public/generic QSE context parameter

int QDF_gemCtxSizeof ( unsigned int  level,
void *  prm 
)

Returns the size, in bytes of the GEM decoding context needed to support the specified compression level.

Returns:
The size, in bytes, of the GEM decoding context
Parameters:
level The maximum level of compression that needs to be supported
prm Additional configuation parameter, unused as of now

void QDF_gemCtxUpdate ( QDF_gemCtx ctx,
const QFR_fileCtx *  qfr,
const CDF_gemBdy *  bdy 
)

Updates the GEM context. This generally called during the root update phase.

Returns:
Pointer to the context structure to update
Parameters:
ctx The context structure to update
qfr The file resolution context, unused by the GEM
bdy The update information

BFU QDF_gemDecode ( QDF_gemCtx qdf,
QDF_gemEvt gem,
const unsigned int *  src,
unsigned int  max,
BFU  bfu 
)

Decodes the GEM.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
qdf The compressed data decoding context
gem The GEM block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

QDF_esbCtx * QDF_gemEvtConstruct ( QDF_gemEvt evt,
unsigned int  level,
void *  prm,
QDF_exc exc,
const QDF_esbEvt esb 
)

Constructs (initializes) the specified GEM event structure.

Returns:
Pointer to the context structure to construct
Parameters:
evt The GEM event structure to construct.
level The maximum level of compression that will be supported.
prm Additional configuation parameter, unused as of now
exc Pointer to the global exception handling context
esb Reference pointer to the Event Summary Block

const EBF_gem * QDF_gemEvtGemGet ( const QDF_gemEvt evt  ) 

Returns a pointer to the EBF gem structure.

Returns:
Pointer the EBF gem structure
Parameters:
evt 

int QDF_gemEvtSizeof ( unsigned int  level,
void *  prm 
)

Returns the size, in bytes of QDF GEM event needed to support the specified compression level.

Returns:
The size, in bytes, of the GEM event
Parameters:
level The maximum level of compression that needs to be supported
prm Additional configuation parameter, unused as of now


Generated on Thu Sep 2 14:54:55 2010 by  doxygen 1.5.3