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


Interface   Data Structures   File List   Data Fields   Globals  

QDF_tkrRepack.c File Reference

Reformats one tower in the QDF_tkrEvt to EBF format. More...

#include "dprintf.h"
#include "QSE/QDF_tkrRepack.h"
#include "QDF_tkr_def.h"
#include "LSE/CDF_tkrdef.h"
#include "EDS/FFS.h"
#include "EDS/EDS_endianness.h"
#include "LDT/BFP.h"
#include "LDT/BFU.h"
#include "LDT/BIT.h"
#include "PBS/PARITY.ih"
#include <string.h>
#include "qdf_tkr_repack_dbg.h"

Classes

struct  _LayerHdr_bf
 LayerHdr_bf. More...
union  _LayerHdr
 Union of an uninterpretted 32-bit value with the bit-field representation of the the layer count structure. More...
struct  _LayerCnt_bf
 LayerCnt_bf. More...
union  _LayerCnt
 Union of an uninterpretted 32-bit value with the bit-field representation of the the layer count structure. More...

Typedefs

typedef enum _LAYERHDR_S LAYERHDR_S
 Typedef for enum _LAYERHDR_S.
typedef enum _LAYERHDR_V LAYERHDR_V
 Typedef for enum _LAYERHDR_V.
typedef enum _LAYERHDR_M LAYERHDR_M
 Typedef for enum _LAYERHDR_M.
typedef struct
_LayerHdr_bf 
LayerHdr_bf
 Typedef for struct _NormalHdr_bf.
typedef union _LayerHdr LayerHdr
 Typedef for union _LayerCnt.
typedef enum _LAYERCNT_S LAYERCNT_S
 Typedef for enum _LAYERCNT_S.
typedef enum _LAYERCNT_V LAYERCNT_V
 Typedef for enum _LAYERCNT_V.
typedef enum _LAYERCNT_M LAYERCNT_M
 Typedef for enum _LAYERCNT_M.
typedef struct
_LayerCnt_bf 
LayerCnt_bf
 Typedef for struct _LayerCnt_bf.
typedef union _LayerCnt LayerCnt
 Typedef for union _LayerCnt.

Enumerations

enum  _LAYERHDR_S {
  LAYERHDR_S_PAD = 19,
  LAYERHDR_S_PARITY = 1,
  LAYERHDR_S_SPARE = 2,
  LAYERHDR_S_GTRC_TAG = 2,
  LAYERHDR_S_TAG_ERR = 1,
  LAYERHDR_S_ERROR = 1,
  LAYERHDR_S_DAV = 1,
  LAYERHDR_S_GTRC_ADR = 4,
  LAYERHDR_S_START = 1
}
 Enumerates the sizes of the fields in a GTRC layer header message. More...
enum  _LAYERHDR_V {
  LAYERHDR_V_PAD = 0,
  LAYERHDR_V_PARITY = 19,
  LAYERHDR_V_SPARE = 20,
  LAYERHDR_V_GTRC_TAG = 22,
  LAYERHDR_V_TAG_ERR = 24,
  LAYERHDR_V_ERROR = 25,
  LAYERHDR_V_DAV = 26,
  LAYERHDR_V_GTRC_ADR = 27,
  LAYERHDR_V_START = 31
}
 Enumerates the right-justified bit-field offsets of the fields in a GTRC layer header message. More...
enum  _LAYERHDR_M {
  LAYERHDR_M_PAD = 0X0007FFFF,
  LAYERHDR_M_PARITY = 0x00080000,
  LAYERHDR_M_SPARE = 0x00300000,
  LAYERHDR_M_GTRC_TAG = 0X00C00000,
  LAYERHDR_M_TAG_ERR = 0x01000000,
  LAYERHDR_M_ERROR = 0x02000000,
  LAYERHDR_M_DAV = 0x04000000,
  LAYERHDR_M_GTRC_ADR = 0x78000000,
  LAYERHDR_M_START = 0x80000000
}
 Enumerates the in place masks of the bit fields in a GTRC layer header message. More...
enum  _LAYERCNT_S {
  LAYERCNT_S_PAD = 20,
  LAYERCNT_S_PARITY = 1,
  LAYERCNT_S_NWRDS = 11
}
 Enumerates the sizes of the fields in a GTRC layer count message. More...
enum  _LAYERCNT_V {
  LAYERCNT_V_PAD = 0,
  LAYERCNT_V_PARITY = 20,
  LAYERCNT_V_NWRDS = 21
}
 Enumerates the right-justified bit-field offsets of the fields in a GTRC layer count message. More...
enum  _LAYERCNT_M {
  LAYERCNT_M_PAD = 0X000FFFFF,
  LAYERCNT_M_PARITY = 0x00100000,
  LAYERCNT_M_NWRDS = 0xFFE00000
}
 Enumerates the in place masks of the bit fields in a GTRC layer count message. More...

Functions

static __inline
unsigned int 
repackTkrHits (unsigned int *dst, unsigned int pos, unsigned char *tots, const QDF_tkrTwr *twr)
 Repacks the strip hits.
static __inline
unsigned int 
repackTkrTots (unsigned int *dst, unsigned int pos, const unsigned char *tots, int ntots)
 Repacks the strip hits.
static __inline
unsigned int 
expandClusters (unsigned int *dst, unsigned int pos, const QDF_tkrCluster *clusters, int nclusters)
 Expands the clusters back to the complete set of strip addresses and commits these strips to the output stream.
static __inline
unsigned int * 
repackTimeout (const QDF_tkrTwrErrTimeout *twr, unsigned int *dst, const EBF_ctb *end)
 Repacks a timeout tower.
static __inline
unsigned int 
layer_hdr_construct (int rc, int dav, int err, int tagerr, int tag, int spare, int parity)
static __inline
unsigned int 
layer_cnt_construct (int cnt)
static __inline
unsigned int 
add_12 (unsigned int *buf, unsigned int pos, unsigned int wrd, unsigned int lomsk, unsigned int himsk)
 Splits the 11 bit val, wrd into 2 pieces, inserting a 0 and adds it to the output buffer.
static __inline
unsigned int 
layer_cnt_add (unsigned int *buf, unsigned int pos, unsigned int cnt)
 Adds the precomposed layer count to the output stream.
static __inline
unsigned int 
layer_hdr_add (unsigned int *buf, unsigned int pos, unsigned int end, unsigned int zleading, unsigned int hdr)
 Adds the precomposed layer header to the output stream, prefacing it with the specified number of leading zeroes.
static __inline
unsigned int 
gtrc_add (unsigned int *buf, unsigned int pos, unsigned int end, unsigned int zleading, int rc, int dav, int tagerr, int err, int tag, int spare, int parity, const unsigned short int *dat)
static __inline
unsigned int 
gtcc_add (unsigned int *buf, unsigned int pos, unsigned char davs, unsigned char tagerrs, unsigned char errors, const unsigned short int *lzs, unsigned int tag, const unsigned short int *dat, const unsigned short int **nxt)
static __inline
unsigned int * 
repackZcopy (const QDF_tkrTwrErrZcopy *twr, unsigned int *dst, const EBF_ctb *end)
 Repacks a zcopy tower.
unsigned int * QDF_tkrRepack (const QDF_tkrEvt *tkr, int tem, unsigned int *dst, const EBF_ctb *end)
 Repacks the TKR event for the specified TEM into its EBF format.


Detailed Description

Reformats one tower in the QDF_tkrEvt to EBF format.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: QDF_tkrRepack.c,v 1.2 2009/05/01 01:37:10 russell Exp $

Enumeration Type Documentation

enum _LAYERCNT_M

Enumerates the in place masks of the bit fields in a GTRC layer count message.

Enumerator:
LAYERCNT_M_PAD  Just to round to a 32-bit word
LAYERCNT_M_PARITY  Odd parity of the message
LAYERCNT_M_NWRDS  Number of words to follow

enum _LAYERCNT_S

Enumerates the sizes of the fields in a GTRC layer count message.

Enumerator:
LAYERCNT_S_PAD  Just to round to a 32-bit word
LAYERCNT_S_PARITY  Odd parity of the message
LAYERCNT_S_NWRDS  Number of words to follow

enum _LAYERCNT_V

Enumerates the right-justified bit-field offsets of the fields in a GTRC layer count message.

Enumerator:
LAYERCNT_V_PAD  Just to round to a 32-bit word
LAYERCNT_V_PARITY  Odd parity of the message
LAYERCNT_V_NWRDS  Number of words to follow

enum _LAYERHDR_M

Enumerates the in place masks of the bit fields in a GTRC layer header message.

Enumerator:
LAYERHDR_M_PAD  Just to round to a 32-bit word
LAYERHDR_M_PARITY  Odd parity of the message
LAYERHDR_M_SPARE  Spare, must be zero bits
LAYERHDR_M_GTRC_TAG  2-bit tag word
LAYERHDR_M_TAG_ERR  TAG compare error
LAYERHDR_M_ERROR  SUM_ERR Status in GTRC control register
LAYERHDR_M_DAV  Data available flag
LAYERHDR_M_GTRC_ADR  4-bit GTRC address
LAYERHDR_M_START  Start bit

enum _LAYERHDR_S

Enumerates the sizes of the fields in a GTRC layer header message.

Enumerator:
LAYERHDR_S_PAD  Just to round to a 32-bit word
LAYERHDR_S_PARITY  Odd parity of the message
LAYERHDR_S_SPARE  Spare, must be zero bits
LAYERHDR_S_GTRC_TAG  2-bit tag word
LAYERHDR_S_TAG_ERR  TAG compare error
LAYERHDR_S_ERROR  SUM_ERR Status in GTRC control register
LAYERHDR_S_DAV  Data available flag
LAYERHDR_S_GTRC_ADR  4-bit GTRC address
LAYERHDR_S_START  Start bit

enum _LAYERHDR_V

Enumerates the right-justified bit-field offsets of the fields in a GTRC layer header message.

Enumerator:
LAYERHDR_V_PAD  Just to round to a 32-bit word
LAYERHDR_V_PARITY  Odd parity of the message
LAYERHDR_V_SPARE  Spare, must be zero bits
LAYERHDR_V_GTRC_TAG  2-bit tag word
LAYERHDR_V_TAG_ERR  TAG compare error
LAYERHDR_V_ERROR  SUM_ERR Status in GTRC control register
LAYERHDR_V_DAV  Data available flag
LAYERHDR_V_GTRC_ADR  4-bit GTRC address
LAYERHDR_V_START  Start bit


Function Documentation

static _inline unsigned int add_12 ( unsigned int *  buf,
unsigned int  pos,
unsigned int  wrd,
unsigned int  lomsk,
unsigned int  himsk 
) [static]

Splits the 11 bit val, wrd into 2 pieces, inserting a 0 and adds it to the output buffer.

Returns:
The updated position
Parameters:
buf The output buffer,
pos The current bit position in the output buffer
wrd The 11-bit word value to add
lomsk The mask to extract the low bits of the value.
himsk The mask to extract the high bits of the value.
The values of the lomsk and himsk are precomputed to effectively insert a zero at the proper place.

static __inline unsigned int expandClusters ( unsigned int *  dst,
unsigned int  pos,
const QDF_tkrCluster *  clusters,
int  nclusters 
) [static]

Expands the clusters back to the complete set of strip addresses and commits these strips to the output stream.

Returns:
The next bit position to write to
Parameters:
dst The destination array
pos The current bit position to write to
clusters The list of clusters to expand
nclusters The count of clusters to expand

static __inline unsigned int layer_cnt_add ( unsigned int *  buf,
unsigned int  pos,
unsigned int  cnt 
) [static]

Adds the precomposed layer count to the output stream.

Returns:
The updated position
Parameters:
buf The output buffer,
pos The current bit position in the output buffer
cnt The precomposed layer count to add

static __inline unsigned int layer_hdr_add ( unsigned int *  buf,
unsigned int  pos,
unsigned int  end,
unsigned int  zleading,
unsigned int  hdr 
) [static]

Adds the precomposed layer header to the output stream, prefacing it with the specified number of leading zeroes.

Returns:
The updated position
Parameters:
buf The output buffer,
pos The current bit position in the output buffer
end The maximum bit position that the layer header may occupy. This occurs when the 127 cells are exhausted leaving insufficient space for the layer header word.
zleading The number of leading zero bits to add before adding the layer header
hdr The precomposed layer header to add

unsigned int * QDF_tkrRepack ( const QDF_tkrEvt tkr,
int  tem,
unsigned int *  dst,
const EBF_ctb *  end 
)

Repacks the TKR event for the specified TEM into its EBF format.

Returns:
The next location to fill in
Parameters:
tkr The unpacked TKR event data
tem Which TEM
dst The EBF destination address
end The address just past the last legitimate address

static __inline unsigned int * repackTimeout ( const QDF_tkrTwrErrTimeout twr,
unsigned int *  dst,
const EBF_ctb *  end 
) [static]

Repacks a timeout tower.

Returns:
Pointer to the next destination address
Parameters:
twr The information about the tower to be repacked
dst The EBF destination address
end The address just past the last legitimate address

static __inline unsigned int repackTkrHits ( unsigned int *  dst,
unsigned int  pos,
unsigned char *  tots,
const QDF_tkrTwr *  twr 
) [static]

Repacks the strip hits.

Returns:
The next bit write position
Parameters:
dst The destination array
pos The next bit position to write to
tots Buffer to extract the TOTs into
twr The tower to repack

static __inline unsigned int repackTkrTots ( unsigned int *  dst,
unsigned int  pos,
const unsigned char *  tots,
int  ntots 
) [static]

Repacks the strip hits.

Returns:
The next bit write position
Parameters:
dst The destination array
pos The next bit position to write to
tots The buffer of TOTs to write out
ntots The number of TOTS to write out

static __inline unsigned int repackZcopy ( const QDF_tkrTwrErrZcopy twr,
unsigned int *  dst,
const EBF_ctb *  end 
) [static]

Repacks a zcopy tower.

Returns:
Pointer to the next destination address
Parameters:
twr The information about the tower to be repacked
dst The EBF destination address
end The address just past the last legitimate address


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