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


Interface   Data Structures   File List   Data Fields   Globals  

QDF_acd_std.c File Reference

Decodes the ACD data when in the encoded in standard fashion. More...

#include "QSE/QDF_acd.h"
#include "QSE/QDF_gem.h"
#include "QSE/QDF_esb.h"
#include "QSE/QDF_exc.h"
#include "QDF_acd_def.h"
#include "QDF_exc_def.h"
#include "QSD/QSD_acdMap.h"
#include "EDS/FFS.h"
#include "LDT/BFU.h"
#include "LDT/HDD.h"
#include "dprintf.h"
#include <stdlib.h>

Defines

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

Typedefs

typedef enum _PAT_V PAT_V
 Typedef for enum _PAT_V.
typedef enum _PAT_M PAT_M
 Typedef for enum _PAT_M.

Enumerations

enum  _PAT_V {
  PAT_V_A_ACCEPT = 0,
  PAT_V_B_ACCEPT = 1,
  PAT_V_A_HIT = 2,
  PAT_V_B_HIT = 3,
  PAT_V_VETO = 4
}
 Maps out the 5-bit pattern word, right shift. More...
enum  _PAT_M {
  PAT_M_A_ACCEPT = 1 << PAT_V_A_ACCEPT,
  PAT_M_B_ACCEPT = 1 << PAT_V_B_ACCEPT,
  PAT_M_A_HIT = 1 << PAT_V_A_HIT,
  PAT_M_B_HIT = 1 << PAT_V_B_HIT,
  PAT_M_VETO = 1 << PAT_V_VETO
}
 Maps out the 5-bit pattern word, in place mask. More...

Functions

static __inline BFU acd_std_unpack (QDF_acdCtx *ctx, QDF_acdStdEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the ACD when packed in the standard fashion.
static __inline BFU acd_std_unpack_adrs (QDF_acdCtx *ctx, QDF_acdStdEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the ACD address list.
static __inline BFU acd_std_unpack_pats (QDF_acdCtx *ctx, QDF_acdStdEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the ACD hit patterns.
static __inline BFU acd_std_unpack_phas (QDF_acdCtx *ctx, QDF_acdStdEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the ACD pha values.
static __inline
QSE_aem_chn 
compose (unsigned int echn, unsigned int pat, unsigned int accept, unsigned int hit)
 Composes the initial AEM channel word, filling in the cable number, cable channel number, along with the accept and hit status bits.
static __inline void restore (QSE_aem *aem)
 Restores the channel order of the aem, This uses qsort to do the reordering which may not be the best choice since the array of channels is almost order.
static int compare (const void *p1, const void *p2)
 Callback function for qsort of the AEM channel.
BFU QDF_acdStdDecode (QDF_acdCtx *ctx, QDF_acdEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the ACD.


Detailed Description

Decodes the ACD data when in the encoded in standard fashion.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: QDF_acd_std.c,v 1.4 2008/06/09 21:15:17 russell Exp $

Enumeration Type Documentation

enum _PAT_M

Maps out the 5-bit pattern word, in place mask.

Enumerator:
PAT_M_A_ACCEPT  A side's PHA accept bit is set
PAT_M_B_ACCEPT  B side's PHA accept bit is set
PAT_M_A_HIT  A side's discriminator hit bit is set
PAT_M_B_HIT  B side's discriminator hit bit is set
PAT_M_VETO  GEM's veto bit is set

enum _PAT_V

Maps out the 5-bit pattern word, right shift.

Enumerator:
PAT_V_A_ACCEPT  A side's PHA accept bit is set
PAT_V_B_ACCEPT  B side's PHA accept bit is set
PAT_V_A_HIT  A side's discriminator hit bit is set
PAT_V_B_HIT  B side's discriminator hit bit is set
PAT_V_VETO  GEM's veto bit is set


Function Documentation

static __inline BFU acd_std_unpack ( QDF_acdCtx ctx,
QDF_acdStdEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu 
) [static]

Decodes the ACD when packed in the standard fashion.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The compressed data decoding context
evt The ACD event 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 acd_std_unpack_adrs ( QDF_acdCtx ctx,
QDF_acdStdEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu 
) [static]

Decodes the ACD address list.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The compressed data decoding context
evt The ACD event 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 acd_std_unpack_pats ( QDF_acdCtx ctx,
QDF_acdStdEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu 
) [static]

Decodes the ACD hit patterns.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The compressed data decoding context
evt The ACD event 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
Warning:
This routine is not protected against 0 ACD hits. It is the caller responsibility to screen these events out.

static __inline BFU acd_std_unpack_phas ( QDF_acdCtx ctx,
QDF_acdStdEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu 
) [static]

Decodes the ACD pha values.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The compressed data decoding context
evt The ACD event 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
Warning:
This routine is not protected against 0 ACD hits. It is the caller responsibility to screen these events out.

static int compare ( const void *  p1,
const void *  p2 
) [static]

Callback function for qsort of the AEM channel.

Returns:
p1 - p2, essentially <0, ==0, >0 depending on whether p1 is <, ==, or > p1.
Parameters:
p1 The first channel
p2 The second channel
This scheme works because the cable and channel number are the first fields in the word.

static __inline QSE_aem_chn compose ( unsigned int  echn,
unsigned int  pat,
unsigned int  accept,
unsigned int  hit 
) [static]

Composes the initial AEM channel word, filling in the cable number, cable channel number, along with the accept and hit status bits.

Returns:
The composed channel word
Parameters:
echn The electronics channel number, this is broken down into the cable number and channel number within the cable
pat The 5-bit pattern word
accept The right justified shift value for the accept status bit
hit The right justified shift value for the hit status bit

BFU QDF_acdStdDecode ( QDF_acdCtx ctx,
QDF_acdEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu 
)

Decodes the ACD.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The compressed data decoding context
evt The ACD event 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 void restore ( QSE_aem aem  )  [static]

Restores the channel order of the aem, This uses qsort to do the reordering which may not be the best choice since the array of channels is almost order.

Parameters:
aem The QSE_aem structure to restore


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