GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> RIM / V3-1-2 > rim / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

RIM_latp.c File Reference

Functions for performing LATp operations. More...

#include <RIM_p.h>
#include <RIM_number.ic>
#include <RIM_AG_init_p.h>
#include <RIM_AG_fldEnums_p.h>
#include <RIM_AG_regEnums_p.h>
#include <RIM_AG_number_p.h>
#include <RIM/RIM_msgs.h>

Classes

struct  LoadParm
 Functions and resources used to load LAT registers. More...
struct  ReadParm
 Functions and resources used to read LAT registers. More...

Enumerations

enum  { RIM_TFE_MODE = 4 }
 TFE mode register ID - defined here to avoid dependence on LEM. More...

Functions

static unsigned traverseRead (RIM *rim, ReadParm *rParm, RIM_type type, unsigned int *index, RIM_addr *addr, unsigned int depth)
static unsigned traverseLoad (RIM *rim, LoadParm *lParm, RIM_type type, unsigned int *index, RIM_addr *addr, unsigned int depth)
static unsigned loadLayerSplit (void *param, RIM_loadFn **loadFn, const RIM_addr *addr, short low, short high)
static unsigned loadSimple (RIM *rim, LoadParm *lParm, RIM_type type)
static unsigned loadTracker (RIM *rim, LoadParm *lParm, RIM_type type)
static unsigned loadCpt (RIM *rim, LoadParm *lParm, RIM_type type, unsigned int index, const RIM_addr *addr)
static unsigned readSimple (RIM *rim, ReadParm *rParm, RIM_type type)
static unsigned readSplit (RIM *rim, ReadParm *rParm)
static unsigned readTracker (RIM *rim, ReadParm *rParm, RIM_type type)
static unsigned readCpt (RIM *rim, ReadParm *rParm, RIM_type type, unsigned int index, const RIM_addr *addr)
static void fixSplit (short *low, short *high)
unsigned RIM_read (RIM *rim, void *param, RIM_readFn **readFn, RIM_decodeFn **decodeFn)
 Populate the RIM structure with the current state of the LAT.
unsigned RIM_load (RIM *rim, void *param, RIM_loadFn **loadFn)
 Load the LAT with the configuration held in a RIM structure.
unsigned RIM_loadAfeConfig (RIM *rim, unsigned int mask, unsigned int value0, unsigned int value1, unsigned int rcMask, unsigned int feMask, void *param, RIM_loadFn **loadFn)
 Load the AFE configuration register.
unsigned RIM_loadCfeConfig0 (RIM *rim, unsigned int mask, unsigned int value, void *param, RIM_loadFn **loadFn)
 Load CFE configuration register 0.
unsigned RIM_loadCfeConfig1 (RIM *rim, unsigned int mask, unsigned int value0, unsigned int value1, unsigned int cMask, void *param, RIM_loadFn **loadFn)
 Load CFE configuration register 1.
unsigned RIM_loadTfeDac (RIM *rim, unsigned int mask, unsigned int value, int nLow, int nHigh, void *param, RIM_loadFn **loadFn)
 Load the TFE DAC register.
unsigned RIM_loadSplit (RIM *rim, int nLow, int nHigh, void *param, RIM_loadFn **loadFn)
 Load TKR split values.
void RIM_setSplit (short *ptr, unsigned long long value, unsigned int uid)
 Decode the result item used to populate a split.
void RIM_checkSplit (short *ptr, unsigned long long value, unsigned int uid)
 Decode a result item used to check a split.
void RIM_correct (RIM *orig, RIM *capt)
 Copy select portions of an original RIM into a copy, to ensure that the subsequent comparison will succeed.


Detailed Description

Functions for performing LATp operations.

Author:
James Swain & Owen Saxton
$Id: RIM_latp.c,v 1.8 2011/03/27 06:53:19 saxton Exp $

Enumeration Type Documentation

anonymous enum

TFE mode register ID - defined here to avoid dependence on LEM.

Enumerator:
RIM_TFE_MODE  TFE mode register ID for LATp.


Function Documentation

void RIM_checkSplit ( short *  ptr,
unsigned long long  value,
unsigned int  uid 
)

Decode a result item used to check a split.

The read value of a TFE mode register is compared with the expected value and the split value set to indicate an error if it doesn't match

Parameters:
ptr Pointer to split registers instance
value Value read from the TFE mode register
uid The unique ID of the TFE mode register

References _Layer_addr::fe, _RIM_addr::lyr, RIM_getAddress(), UID_INDEX, and UID_SPT_HIGH.

void RIM_correct ( RIM orig,
RIM capt 
)

Copy select portions of an original RIM into a copy, to ensure that the subsequent comparison will succeed.

Parameters:
orig Orignal RIM
capt New copy of the RIM (probably captured from the LAT)

References checkBit(), RIM_getReg(), and RIM_setReg().

unsigned RIM_load ( RIM rim,
void *  param,
RIM_loadFn **  loadFn 
)

Load the LAT with the configuration held in a RIM structure.

Parameters:
rim Pointer to the RIM structure to populate from the LAT
param Pointer passed through to the loadRegFn
loadFn Type ordered array of pointers to functions that load the LAT registers
Return values:
RIM_SUCCESS if all goes well
LEM_* if there is an error arising from one of the register load commands

References LoadParm::loadFn, LoadParm::param, RIM_cptDesc(), and RIM_loadSplit().

unsigned RIM_loadAfeConfig ( RIM rim,
unsigned int  mask,
unsigned int  value0,
unsigned int  value1,
unsigned int  rcMask,
unsigned int  feMask,
void *  param,
RIM_loadFn **  loadFn 
)

Load the AFE configuration register.

The AFE configuration register is loaded with a modified version of the value from the LAT configuration, with the specified bits replaced.

Parameters:
rim Pointer to the cached in-memory model of the LATC registers
mask Mask of bits to be changed from the configuration.
value0 The value to be masked and merged with the configuration value for front-ends not selected by the RC and FE masks.
value1 The value to be masked and merged with the configuration value for front-ends selected by the RC and FE masks.
rcMask Mask of bits, one per RC, specifying which RCs are selected.
feMask Mask of bits, one per FE, specifying which FEs within selected RCs are selected.
param Parameter to be passed to the load routine.
loadFn Type ordered array of pointers to functions that load the LAT registers
Return values:
RIM_SUCCESS if all goes well
LEM_* if there is an error arising from one of the register load commands

References _RIM_addr::acd, checkBit(), _ACD_addr::fe, _ACD_addr::rc, CptDescription::rd, RegDescription::regId, RIM_addrRng(), RIM_cptDesc(), and RIM_getReg().

unsigned RIM_loadCfeConfig0 ( RIM rim,
unsigned int  mask,
unsigned int  value,
void *  param,
RIM_loadFn **  loadFn 
)

Load CFE configuration register 0.

CFE configuration register 0 is loaded with a modified version of the value from the LAT configuration, with the specified bits replaced.

Parameters:
rim Pointer to the cached in-memory model of the LATC registers
mask Mask of bits to be changed from the configuration.
value The value to be masked and merged with the configuration value.
param Parameter to be passed to the load routine.
loadFn Type ordered array of pointers to functions that load the LAT registers
Return values:
RIM_SUCCESS if all goes well
LEM_* if there is an error arising from one of the register load commands

References _TEM_addr::cc, checkBit(), _TEM_addr::fe, _TEM_addr::rc, CptDescription::rd, RegDescription::regId, RIM_addrRng(), RIM_cptDesc(), RIM_getReg(), _RIM_addr::tem, and _TEM_addr::to.

unsigned RIM_loadCfeConfig1 ( RIM rim,
unsigned int  mask,
unsigned int  value0,
unsigned int  value1,
unsigned int  cMask,
void *  param,
RIM_loadFn **  loadFn 
)

Load CFE configuration register 1.

CFE configuration register 1 is loaded with a modified version of the value from the LAT configuration, with the specified bits replaced.

Parameters:
rim Pointer to the cached in-memory model of the LATC registers
mask Mask of bits to be changed from the configuration.
value0 The value to be masked and merged with the configuration value for front-ends whose bit is clear in the column mask.
value1 The value to be masked and merged with the configuration value for front-ends whose bit is set in the column mask.
cMask Mask of bits, one per column, specifying which value is to be used for loading the config register.
param Parameter to be passed to the load routine.
loadFn Type ordered array of pointers to functions that load the LAT registers
Return values:
RIM_SUCCESS if all goes well
LEM_* if there is an error arising from one of the register load commands

References _TEM_addr::cc, checkBit(), _TEM_addr::fe, _TEM_addr::rc, CptDescription::rd, RegDescription::regId, RIM_addrRng(), RIM_cptDesc(), RIM_getReg(), _RIM_addr::tem, and _TEM_addr::to.

unsigned RIM_loadSplit ( RIM rim,
int  nLow,
int  nHigh,
void *  param,
RIM_loadFn **  loadFn 
)

Load TKR split values.

The tracker RC and FE registers are loaded to reflect the given split values.

Parameters:
rim RIM structure containing the values to load onto the LAT
nLow Number of TFEs to talk on the low side, or -1 if the configured values are to be used.
nHigh Number of TFEs to talk on the high side, or -1 if the configured values are to be used.
param Parameter to be passed to the load function.
loadFn Type ordered array of pointers to functions that load the LAT registers
Return values:
RIM_SUCCESS if all goes well
LEM_* if there is an error arising from one of the register load commands

References checkBit(), _Layer_addr::la, _RIM_addr::lyr, RIM_addrRng(), RIM_getReg(), and _Layer_addr::to.

Referenced by RIM_load().

unsigned RIM_loadTfeDac ( RIM rim,
unsigned int  mask,
unsigned int  value,
int  nLow,
int  nHigh,
void *  param,
RIM_loadFn **  loadFn 
)

Load the TFE DAC register.

The TFE DAC register is loaded with a modified version of the value from the LAT configuration, with the specified bits replaced.

Parameters:
rim Pointer to the cached in-memory model of the LATC registers
mask Mask of bits to be changed from the configuration.
value The value to be masked and merged with the configuration value.
nLow Number of TFEs talking on the low side, or -1 if the configured values are being used.
nHigh Number of TFEs talking on the high side, or -1 if the configured values are being used.
param Parameter to be passed to the load routine.
loadFn Type ordered array of pointers to functions that load the LAT registers
Return values:
RIM_SUCCESS if all goes well
LEM_* if there is an error arising from one of the register load commands

References checkBit(), _Layer_addr::fe, _Layer_addr::la, _RIM_addr::lyr, CptDescription::rd, RegDescription::regId, RIM_addrRng(), RIM_cptDesc(), RIM_getReg(), RIM_layerHigh(), RIM_layerLow(), _RIM_addr::tem, and _Layer_addr::to.

unsigned RIM_read ( RIM rim,
void *  param,
RIM_readFn **  readFn,
RIM_decodeFn **  decodeFn 
)

Populate the RIM structure with the current state of the LAT.

Parameters:
rim Pointer to the RIM structure to populate from the LAT
param Pointer passed through to the readRegFn
readFn Type ordered array of pointers to functions that read the LAT registers
decodeFn Type ordered array of pointers to functions that decode the register responses
Return values:
RIM_SUCCESS if all goes well
LEM_* if there is an error arising from one of the register load commands

References ReadParm::decodeFn, ReadParm::param, ReadParm::readFn, RIM_cptDesc(), and RIM_number().

void RIM_setSplit ( short *  ptr,
unsigned long long  value,
unsigned int  uid 
)

Decode the result item used to populate a split.

The value from the TRC register is converted and assigned to the appropriate split register.

Parameters:
ptr Pointer to split registers instance
value Value read from the TRC register
uid The unique ID of the SPT register

References RIM_addrRng(), and UID_SPT_HIGH.


Generated on Fri Sep 30 18:27:32 2011 by  doxygen 1.5.8