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


Interface   Data Structures   File List   Data Fields   Globals  

RIM_lrd.c File Reference

LAT register description helper functions. More...

#include <RIM_p.h>
#include <RIM_AG_types_p.h>
#include <RIM_AG_types_s.h>
#include <RIM_AG_addr_s.h>
#include <RIM_AG_descriptions_s.h>
#include <RIM_AG_number_s.h>
#include <RIM/RIM_msgs.h>
#include <string.h>
#include <ctype.h>

Enumerations

enum  { N_LAYER = N_TRC / (2 * N_TEM) }
 Define some tracker layer constants. More...

Functions

unsigned RIM_nTypes (void)
 Return the number of component types within the LAT register description.
RIM_type RIM_lookupType (const char *string)
 Hunt through the list of component types and return the index of the input string.
unsigned RIM_nameType (char *string, RIM_type type)
 Place the four-character string describing this type into name.
int RIM_compareType (const char *string, RIM_type type)
 Compare string with the name of a type.
unsigned RIM_getAddrRng (const char *string, RIM_addr *addr)
 Finds the address range associated with the type identifed by the string.
unsigned RIM_getIndex (const RIM_addr *addr, unsigned int *index, RIM_type type)
 Convert hierarchical bit addressing to flat addressing.
unsigned RIM_getAddress (RIM_addr *addr, unsigned int index, RIM_type type)
 Convert flat addressing to hierarchical bit addressing.
void RIM_layerLow (const Layer_addr *layer, TEM_addr *tem)
 Convert the conceptual layer addressing of a TFE to the hierarchical form used to communicate with the LAT.
void RIM_layerHigh (const Layer_addr *layer, TEM_addr *tem)
 Convert the conceptual layer addressing of a TFE to the hierarchical form used to communicate with the LAT.
unsigned RIM_getLayerID (const char *name, unsigned int *layer)
 Convert a layer name to a layer ID.
unsigned RIM_getLayerName (unsigned int layer, char *name)
 Form the layer name from the layer ID.
const CptDescriptionRIM_cptDesc (RIM_type type)
 Get the address of a component description.
int RIM_number (RIM_type type)
 Get the number of instances of a component.
const char * RIM_typeName (RIM_type type)
 Get the name of a component.
int RIM_addrRng (RIM_type type, int level)
 Get the address range of a component level.

Variables

static const char tcc_lkup [4][2] = {{0, 1}, {3, 2}, {6, 7}, {5, 4}}
 Gives the TCC ID for a given "end" of the requested layer.


Detailed Description

LAT register description helper functions.

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

Enumeration Type Documentation

anonymous enum

Define some tracker layer constants.

Enumerator:
N_LAYER  Number of layers per tower.


Function Documentation

int RIM_addrRng ( RIM_type  type,
int  level 
)

Get the address range of a component level.

This is an internal routine, so no checking is done on the type.

Parameters:
type The type ID of the component
level The address level
Returns:
The name of the component

Referenced by RIM_loadAfeConfig(), RIM_loadCfeConfig0(), RIM_loadCfeConfig1(), RIM_loadSplit(), RIM_loadTfeDac(), and RIM_setSplit().

int RIM_compareType ( const char *  string,
RIM_type  type 
)

Compare string with the name of a type.

Parameters:
string Name of a component type
type Type to compare to
Return values:
-1 If the type is unknown (exceeds the range of acceptable types)
0 If the type is known, and the name matches the string
1 If the type is known, and the name does not match the string

const CptDescription* RIM_cptDesc ( RIM_type  type  ) 

Get the address of a component description.

This is an internal routine, so no checking is done on the type.

Parameters:
type The type ID of the component
Returns:
The address of the description of the component.

Referenced by RIM_compare(), RIM_construct(), RIM_contrast(), RIM_deleteData(), RIM_export(), RIM_getFld(), RIM_getReg(), RIM_import(), RIM_load(), RIM_loadAfeConfig(), RIM_loadCfeConfig0(), RIM_loadCfeConfig1(), RIM_loadTfeDac(), RIM_read(), RIM_regEnum(), RIM_setFld(), RIM_setReg(), and sizeofStore().

unsigned RIM_getAddress ( RIM_addr addr,
unsigned int  index,
RIM_type  type 
)

Convert flat addressing to hierarchical bit addressing.

Note that GTFEs are usually referred to as being part of an X or Y layer. This identification is converted to an absolute layer number and stored in the rc space by addr->rc = (layerNumber << 1) | isYlayer. This conversion is performed by the XLM->RIM converter, but is documented here since it is a storage convention.

Parameters:
addr Address corresponding to index
index Index to convert
type Type of address to convert
Return values:
RIM_SUCCESS Success
RIM_TYPEUNKN The component type is unknown
RIM_ADDRRNGE The index is outside the allowable range for this type

References _RIM_addr::cpt.

Referenced by RIM_checkSplit(), and RIM_contrast().

unsigned RIM_getAddrRng ( const char *  string,
RIM_addr addr 
)

Finds the address range associated with the type identifed by the string.

Parameters:
string Identifies the address range required
addr Pointer to address stucture to populate with the address range
Return values:
RIM_SUCCESS If the string is a good type name.
RIM_TYPESTR If the string does not match a known type

References _RIM_addr::cpt, and RIM_lookupType().

unsigned RIM_getIndex ( const RIM_addr addr,
unsigned int *  index,
RIM_type  type 
)

Convert hierarchical bit addressing to flat addressing.

Note that GTFEs are usually referred to as being part of an X or Y layer. This identification is converted to an absolute layer number and stored in the rc space by addr->rc = (layerNumber << 1) | isYlayer. This conversion is performed by the XLM->binary converter, but is documented here since it is a storage convention.

Parameters:
addr Address to convert
index Index corresponding to address
type Type of address to convert
Return values:
RIM_SUCCESS Success
RIM_TYPEUNKN The component type is unknown
RIM_ADDRBCST The address contains a mixture of broadcast and unicast components
RIM_ADDRRNGE A component of the address is outside the allowable range for this type

References _RIM_addr::cpt.

Referenced by mapIndex(), RIM_deleteData(), RIM_get(), and RIM_set().

unsigned RIM_getLayerID ( const char *  name,
unsigned int *  layer 
)

Convert a layer name to a layer ID.

A three-character layer name of the form [sign][xory][index] is converted to a layer ID.

Parameters:
name The address of the three-byte layer name.
layer Location to store the layer ID
Return values:
RIM_SUCCESS If the layer ID was successfully found
RIM_ADDRLSIG If the layer sign is nonsensical
RIM_ADDRLXY If the layer xy value is nonsensical
RIM_ADDRLIND If the layer index is nonsensical

unsigned RIM_getLayerName ( unsigned int  layer,
char *  name 
)

Form the layer name from the layer ID.

The name has the form [sign][xory][index], e.g. +y5, -x1.

Parameters:
layer ID of the layer to name
name The address of a 4-byte array to hold the layer name (3 bytes) plus the trailing null.
Return values:
RIM_SUCCESS If the layer is located
RIM_ADDRLAYR If the layer is out of range

References N_LAYER.

void RIM_layerHigh ( const Layer_addr layer,
TEM_addr tem 
)

Convert the conceptual layer addressing of a TFE to the hierarchical form used to communicate with the LAT.

Note that GTFEs are usually referred to as being part of an X or Y layer. This identification is converted to an absolute layer number and stored in the rc space by addr->rc = (layerNumber << 1) | isYlayer. This conversion is performed by the XLM->RIM converter, but is documented here since it is a storage convention.

Parameters:
layer Address of the TFE / SPT in terms of layers
tem Address of the TFE / TRC in terms of CC/RC

References _TEM_addr::cc, _Layer_addr::fe, _TEM_addr::fe, _Layer_addr::la, _TEM_addr::rc, _Layer_addr::to, and _TEM_addr::to.

Referenced by RIM_loadTfeDac().

void RIM_layerLow ( const Layer_addr layer,
TEM_addr tem 
)

Convert the conceptual layer addressing of a TFE to the hierarchical form used to communicate with the LAT.

Note that GTFEs are usually referred to as being part of an X or Y layer. This identification is converted to an absolute layer number and stored in the rc space by addr->rc = (layerNumber << 1) | isYlayer. This conversion is performed by the XLM->RIM converter, but is documented here since it is a storage convention.

Parameters:
layer Address of the TFE / SPT in terms of layers
tem Address of the TFE / TRC in terms of CC/RC

References _TEM_addr::cc, _Layer_addr::fe, _TEM_addr::fe, _Layer_addr::la, _TEM_addr::rc, _Layer_addr::to, and _TEM_addr::to.

Referenced by RIM_loadTfeDac().

RIM_type RIM_lookupType ( const char *  string  ) 

Hunt through the list of component types and return the index of the input string.

Parameters:
string String corresponding to one of the component types used in the LAT register description
Returns:
integer corresponding to the type identified by string or RIM_BAD_TYPE if the string does not match any on the list

Referenced by RIM_getAddrRng().

unsigned RIM_nameType ( char *  string,
RIM_type  type 
)

Place the four-character string describing this type into name.

Parameters:
type Type to be named
string Location to place name
Return values:
RIM_SUCCESS If the type is known to RIM
RIM_TYPEUNKN If the type is unknown

unsigned RIM_nTypes ( void   ) 

Return the number of component types within the LAT register description.

Returns:
Number of component types

int RIM_number ( RIM_type  type  ) 

Get the number of instances of a component.

This is an internal routine, so no checking is done on the type.

Parameters:
type The type ID of the component
Returns:
The number of instances of the component,

Referenced by mapIndex(), RIM_compare(), RIM_construct(), RIM_contrast(), RIM_deleteData(), RIM_export(), RIM_get(), RIM_import(), RIM_read(), RIM_set(), sizeofMap(), and sizeofStore().

const char* RIM_typeName ( RIM_type  type  ) 

Get the name of a component.

This is an internal routine, so no checking is done on the type.

Parameters:
type The type ID of the component
Returns:
The name of the component


Variable Documentation

const char tcc_lkup[4][2] = {{0, 1}, {3, 2}, {6, 7}, {5, 4}} [static]

Gives the TCC ID for a given "end" of the requested layer.

Since the pattern is repeating, take the layer index modulo 4 as the first index to the table and 0 for low or 1 for high as the second index to the table.


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