GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > GNAT / V2-0-0
Constituent: gnat_cio     Tag: mv2304
This graph shows which files directly or indirectly include this file:
Data Structures | |
struct | __BFcellHeader |
layout of a control cell header More... | |
union | __cellHeader |
union for 16-bit control cell header More... | |
struct | _BFrspErr |
Contains error info regarding LATp responses. More... | |
union | _generic_Cell |
union for 128-bit LATp cell -- either control or data cell. More... | |
struct | _gResponse |
Contains info for LATp responses. More... | |
struct | _LATp_Cell |
LATp cell structure. More... | |
struct | _LATp_ControlCell |
layout of a 128-bit LATp control cell. More... | |
struct | _LATp_DataCell |
layout of a 128-bit LATp data cell. More... | |
union | _LATp_RXstats |
Union for 16-bit LATp receiver statistics word. More... | |
struct | _LATp_RXstatsBF |
Structure that defines the LATp receiver statistics word. More... | |
union | _LATp_TXstats |
Union for 16-bit LATp transmitter statistics word. More... | |
struct | _LATp_TXstatsBF |
Structure that defines the LATp transmitter statistics word. More... | |
union | _rspErr |
union for 32-bit response error flags More... | |
Defines | |
#define | WAIT_FOREVER (0) |
Defined for local host compilation. | |
#define | MAX_EVENT_SIZE (4096) |
Maximum event size in bytes. | |
#define | LATP_CELL_SIZE_BYTES (sizeof(LATp_DataCell)) |
Size of LATp cell in bytes. | |
#define | ODD_PARITY(p) (~(BITCOUNT(p)) & 0x1) |
Computes odd parity of 32-bit argument. | |
#define | EVEN_PARITY(p) ((BITCOUNT(p)) & 0x1) |
Computes even parity of 32-bit argument. | |
#define | BITCOUNT(x) (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255) |
Computes the number of bits set (1) in 32-but argument. | |
#define | BX_(x) |
Replaces each 4-bit sequence in arg by the number of bits in sequence. | |
Typedefs | |
typedef _LATp_TXstats | LATp_TXstats |
typedef for union _LATp_TXstats | |
typedef _LATp_RXstats | LATp_RXstats |
typedef for union _LATp_RXstats | |
typedef _rspErr | rspErr |
typedef for union _rspErr | |
typedef _gResponse | gResponse |
Typedef for struct _gResponse. | |
typedef __cellHeader | cellHeader |
typedef for union _cellHeader | |
typedef _LATp_ControlCell | LATp_ControlCell |
typedef for struct _LATp_ControlCell | |
typedef _LATp_DataCell | LATp_DataCell |
typedef for struct _LATp_DataCell | |
typedef enum _CellType | CellType |
typedef of enum _CellType | |
Enumerations | |
enum | _CellType { dataCell = 0, ctrlCell = 1 } |
Enumeration of cell types: control or data. | |
Functions | |
int | gSendPacket (gnatHandle gh, gResponse *rspInfo, unsigned short dest, unsigned short nWord16, unsigned short *payload) |
Sends a LATp packet on the LAT network. | |
int | gLoadPacket (gnatHandle gh, gResponse *rspInfo, unsigned short dest, unsigned short nWord16, unsigned short *payload) |
Loads a LATp packet into the COMM board FIFO. | |
int | gSendLAM (gnatHandle gh, unsigned short destAddr) |
Sends the "Look At Me" message to the LAT node destAddr. | |
int | gSetAddr (gnatHandle gh, unsigned short addr) |
Sets the source address of the LATp interface associated with gh. | |
int | gGetAddr (gnatHandle gh, unsigned short *addr) |
Gets the source address of the LATp interface associated with gh. | |
int | gResetCommStats (gnatHandle gh) |
Resets the network statistics for the LATp interface associated with gh. | |
int | gGetTXstats (gnatHandle gh, LATp_TXstats *txStats) |
Returns the current transmission statistics. | |
int | gSetTXstats (gnatHandle gh, LATp_TXstats *txStats) |
Sets the current transmission statistics from txStats. | |
int | gGetRXstats (gnatHandle gh, LATp_RXstats *rxStats) |
Returns the current recieve statistics. | |
int | gSetRXstats (gnatHandle gh, LATp_RXstats *rxStats) |
Sets the current recieve statistics from rxStats. | |
int | gSetLATpChnl (gnatHandle gh, unsigned char chnl) |
Sets the incoming LATp channel number for the board. | |
int | gSetLATpMode (gnatHandle gh, unsigned char mode) |
Sets the running mode of the board. | |
int | gSetProtocol (gnatHandle gh, unsigned short proto) |
Sets the protocol to use. | |
int | gGetProtocol (gnatHandle gh, unsigned short *proto) |
Gets the current LATp protocol. | |
int | gSetTimeout (gnatHandle gh, unsigned short timeout) |
Sets the timeout to use for LATp interface. | |
int | gReadRsp (gnatHandle gh, gResponse *rspInfo) |
Transfers data from the record FIFO to the rspInfo structure. | |
int | gWaitPacketIRQ (gnatHandle gh) |
Blocks on the ISR semaphore waiting for LATp packet ready IRQ. | |
int | setLATpCellHeaderParity (gnatHandle gh, unsigned short p) |
p determines if the LATp CellHeader Parity is inverted | |
int | getLATpCellHeaderParity (gnatHandle gh, unsigned short *p) |
Returns the current LATp cell header parity setting in p. | |
int | setLATpCellBodyParity (gnatHandle gh, unsigned short p) |
p determines if the LATp CellBody Parity is inverted | |
int | getLATpCellBodyParity (gnatHandle gh, unsigned short *p) |
Returns current LATp CellBody Parity in p. | |
int | setLATpSkipRspWords (gnatHandle gh, unsigned short nSkip) |
nSkip controls how many FIFO words to skip before storing read back data. | |
int | calcParity (unsigned int nWords, unsigned int *arr) |
Calculates the odd parity in arr. |
|
Computes the number of bits set (1) in 32-but argument.
The definition of BITCOUNT is based on an algorithm condensed from one extracted from a graph coloring register allocator which manipulates bitvectors. It was inspired by an analogous algorithm for counting bits in 36 bit words in MIT's HAKMEM, designed by Chris Smith, and written by Jane Hoffman. The original conversion to a form suitable for C on a VAX was by Brad Merrill; that code was fixed and re-written by Jerry Leichter. It assumes a 32-bit word. Note that the argument is evaluated multiple times, so should not have side-effects. A full explanation of the algorithm is too long to include here; in summary, BX_(x) replaces each 4-bit sequence in x by the number of bits in that sequence (which will, of course, fit in 4 bits). BITCOUNT folds the 4-bit sequences into 8-bit sequences. The 8-bit sequences are then added up by recognizing that they can be viewed as a base 256 number, and the sum of the digits of a base b number is the same mod b-1 as the number mod b-1. The original implementation produce results in groups of 3, then 6 bits. While natural on a PDP-10's 36-bit word, this requires special case handling of the sign bit on a VAX, since the top 3-bit sequence is really only 2 bits long. |
|
Value: ((x) - (((x)>>1)&0x77777777) \ - (((x)>>2)&0x33333333) \ - (((x)>>3)&0x11111111))
|
|
Calculates the odd parity in arr.
|
|
Returns current LATp CellBody Parity in p.
|
|
Returns the current LATp cell header parity setting in p.
|
|
Gets the source address of the LATp interface associated with gh.
|
|
Gets the current LATp protocol.
|
|
Returns the current recieve statistics.
|
|
Returns the current transmission statistics.
|
|
Loads a LATp packet into the COMM board FIFO.
Loads a LATp packet into the COMM board FIFO. Using rspInfo, dest, source it constructs a 16 bit header word for the control cell of the packet. It fills the remainder of the 128-bit control cell with data from payload (up to 14 bytes). The control cell is preceded by a 2 bit delineator and follow by a truncate bit and parity bit -- if the payload is larger than 14 bytes then additional data cells are created and injected with the appropriate delineator and suffix bits. Caller is responsible for initializing FIFO and for initiating the playback. |
Here is the call graph for this function:
|
Transfers data from the record FIFO to the rspInfo structure.
The routine checks bits 17 and 18 of every 9th FIFO word to determine when the last packet has been processed -- when these bits are both zero we have reached the end of the packet chain (potentially multiple packets, if the packets are back-to-back). Updates the LATp interface reciever statistics for packets received, cell parity errors and cell header parity errors. The response could contain multiple packets. Coming off the response FIFO LATp cells are 9 words long. Word 1 has the cell announce and cell type bits, while word 9 has the truncate and parity error bits. Additionally word 1 also has the cell header if the cell type is a control cell. |
Here is the call graph for this function:
|
Resets the network statistics for the LATp interface associated with gh.
|
|
Sends the "Look At Me" message to the LAT node destAddr.
|
Here is the call graph for this function:
|
Sends a LATp packet on the LAT network.
Sends a LATp packet on the network. Using rspInfo, dest, source it constructs a 16 bit header word for the control cell of the packet. It fills the remainder of the 128-bit control cell with data from payload (up to 14 bytes). The control cell is injected in the network preceded by a 2 bit delineator and follow by a truncate bit and parity bit -- if the payload is larger than 14 bytes then additional data cells are created and injected with the appropriate delineator and suffix bits. |
Here is the call graph for this function:
|
Sets the source address of the LATp interface associated with gh.
|
|
Sets the incoming LATp channel number for the board.
|
|
Sets the running mode of the board.
|
|
Sets the protocol to use.
|
|
Sets the current recieve statistics from rxStats.
|
|
Sets the timeout to use for LATp interface.
|
|
Sets the current transmission statistics from txStats.
|
|
Blocks on the ISR semaphore waiting for LATp packet ready IRQ.
|
|
p determines if the LATp CellBody Parity is inverted
|
|
p determines if the LATp CellHeader Parity is inverted
|
|
nSkip controls how many FIFO words to skip before storing read back data.
Setting nSkip to a non-zero value causes the read back routine to skip nSkip FIFO words (read and discard) before storing the data. This allows us to arbitrarily fill the record FIFO with N junk words and then instruct the read back routines to skip over the N junk words before reading and storing the data. With this technique we can probe the TEM to COMM flow control based on the Almost Full Flag of the record FIFO. |