GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LCBT / dev

Constituent: lcbtOld     Tag: linux-gcc


Interface   Compound List   File List   Compound Members   File Members  

LCBT.h File Reference

Regression test for LCB LAT COmmunication boards. More...

#include "LCBT/LCBT_initBoard.h"
#include "src/RND.h"
#include "src/TDATA.h"
#include "PBS/WCT.h"

Include dependency graph for LCBT.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Defines

#define xLCBx   LCB
 defines used to point to LCB on old driver and LCBD on new driver


Typedefs

typedef enum _LCBT_OPTION LCBT_OPTION
 Masks for test option mask.

typedef enum _LCBT_AVAIL LCBT_AVAIL
 defines used with sHwAvail to determine what HW is connected for LCBT_cmdExternalTest()


Enumerations

enum  _LCBT_OPTION {
  LCBT_OPTION_BUSYPRINT = 1,
  LCBT_OPTION_VERBOSE = 2,
  LCBT_OPTION_FOREVER = 4,
  LCBT_OPTION_INCTESTPARM = 0x10
}
enum  _LCBT_AVAIL {
  LCBT_TEM_AVAIL = 1,
  LCBT_EBM_AVAIL = 2
}

Functions

int LCBT_init (int latpAddr, int useRedundantPath)
 inits LCB driver and start 2 tasks associated with driver

int LCBT_testAll (int num, int nLoops, int latpAddr, int useTem)
 overall test, does complete regression test of LCB

void LCBT_setOption (unsigned int optionMask)
 set test option mask, see LCBT.h for values

void LCBT_setEventWatermarks (int eventQWatermark, int eventBuffWatermark)
 Set watermarks to cause interrupts from EventQueue and EventBuff fifos.

int LCBT_localRegTest (int num, TDATA_DTEST testType, unsigned int testParm)
 Read/write/compare test on all PCI accessable registers on LCB board.

int LCBT_cmdLocalTest (int num, TDATA_DTEST testType, unsigned int testParm)
 read test on LCB local registers that require Cmd list DMA

int LCBT_cmdLocalTest2 (int num, TDATA_DTEST testType, unsigned int testParm)
 2 task read test on LCB local registers that require Cmd list DMA

int LCBT_cmdLocalTest3 (int num, TDATA_DTEST testType, unsigned int testParm)
 3 task read test on LCB local registers that require Cmd list DMA

int LCBT_cmdExternalTest (int num, int singleAccess, TDATA_DTEST testType, unsigned int testParm, int disableHwDetect)
 read test on LCB local registers that require Cmd list DMA

int LCBT_eventTest (int num, int maxLen, int latpAddr, int randomLen, int ccsds, TDATA_DTEST testType, unsigned int testParm)
 Test to send/recv/compare event data thru loopback on LCB board.

int LCBT_eventTest2 (int num, int maxLen, int latpAddr, int randomLen, int ccsds, TDATA_DTEST testType, unsigned int testParm)
 2 concurrent task test to send/recv/compare event data thru loopback on LCB board

int LCBT_eventTest3 (int num, int maxLen, int latpAddr, int randomLen, int ccsds, TDATA_DTEST testType, unsigned int testParm)
 3 concurrent task test to send/recv/compare event data thru loopback on LCB board

int LCBT_comboTest (int num, int maxLen, int latpAddr, int randomLen, int ccsds, TDATA_DTEST testType, unsigned int testParm)
 2 concurrent tasks running event and localCmdReg test

int LCBT_eventWatermarkTest (int num, int latpAddr)
 Check for proper operation of watermarks on Event and EventData queues.

unsigned int LCBT_cmdExternalDetermineHw ()
 get mask determined by LCBT_cmdExternalDetermineHw() for use in LCBT_cmdExternalDetermineHw () determine which HW is connected to the LCB

unsigned int LCBT_cmdExternalHwAvail ()
 get mask determined by LCBT_cmdExternalDetermineHw() for use in LCBT_cmdExternalTest()

int LCBT_clearErrorTotals ()
 clear the global error counts

int LCBT_printErrorTotals (char *title)
 print the global error counts

int LCBT_updateErrorTotals (int access, int rErr, int wErr, int cErr)
 update the global error counts

int LCBT_saveErrorForDeltas ()
 stash global error counts to use with LCBT_printErrorDeltas()

int LCBT_printErrorDeltas (char *title)
 print the delta error counts since LCBT_saveErrorForDeltas()

int LCBT_eventRecv (int numRecv, int ccsds)
 Setup to receive and compare data from LCBT_eventSend().

int LCBT_eventSend (int numEvents, int maxEvtSize, int latpAddr, int randomLen, int ccsds, TDATA_DTEST testType, unsigned int testParm)
 Send out test event data to be received by LCBT_eventRecv().

int LCBT_eventEcho (int forkPri)
 Setup to echo event data back to sender.

void LCBT_regs ()
 print vals of all registers in LCB

unsigned int LCBT_readCsr ()
 Read CSR register.

unsigned int LCBT_readIrq ()
 Read IRQ register which has interrupt status.

unsigned int LCBT_readEventBase ()
 Read Event Base register which is start of Event circular buffer.

unsigned int LCBT_readEventFree ()
 Read Event Free register which is offset in Event circular buffer HW will write to.

unsigned int LCBT_readEventQ ()
 Read eventQueue NOTE this will pull value from queue and effect operation.

unsigned int LCBT_readResultQ ()
 Read resultQueue NOTE this will pull value from queue and effect operation.

unsigned int LCBT_readRequestQ ()
 Read requestQueue, 0=notEMpty, not0=empty NOTE this will pull value from queue and effect operation.

unsigned int LCBT_readDebug ()
 Read debug register NOTE this will pull value from queue and effect operation.

unsigned int LCBT_readLatpCsr ()
 read LATp CSR register (requires a DMA)

unsigned int LCBT_readFifoFault ()
 read Fifo Fault registers (requires a DMA)

void LCBT_readHwInfo ()
 Read hwInfo register.

unsigned int LCBT_writeCsr (unsigned int data)
 Write given value to register.

unsigned int LCBT_writeEventBase (unsigned int data)
 Write given value to register.

unsigned int LCBT_writeEventFree (unsigned int data)
 Write given value to register.

unsigned int LCBT_writeLatpCsr (unsigned int data, unsigned int mask)
 write LATp CSR register (requires a DMA)

unsigned int LCBT_writeFifoFault (unsigned int data, unsigned int mask)
 write Fifo Fault register (requires a DMA)

unsigned int LCBT_readReg (int latpAddr, int block, int reg, unsigned int *value)
 read a single register over the cmdResponse fabric

unsigned int LCBT_writeReg (int latpAddr, int block, int reg, unsigned int value, int broadcast)
 write to single register over the cmdResponse fabric


Detailed Description

Regression test for LCB LAT COmmunication boards.

Author:
Ed Bacho - ebacho@slac.stanford.edu

    These are the main subroutines for running LCB regression tests. They
    are intended to be run on VxWorks through the WindSh or across the
    network via LTX.
   
    The subroutines are structured to be used thru the WindSh rather than
    be called by other progs. They assume a single LCB board.

   CVS $Id: LCBT.h,v 1.10 2004/09/01 18:34:07 ebacho Exp $

Enumeration Type Documentation

enum _LCBT_AVAIL
 

Enumeration values:
LCBT_EBM_AVAIL  TEM connected to LCB

enum _LCBT_OPTION
 

Enumeration values:
LCBT_OPTION_BUSYPRINT  print count every 1000 accesses
LCBT_OPTION_VERBOSE  lots of printouts
LCBT_OPTION_FOREVER  ignore count and loop forever
LCBT_OPTION_INCTESTPARM  increment test parm every loop


Function Documentation

LCBT_clearErrorTotals  ) 
 

clear the global error counts

Returns:
total error count before clearing

unsigned int LCBT_cmdExternalDetermineHw  ) 
 

get mask determined by LCBT_cmdExternalDetermineHw() for use in LCBT_cmdExternalDetermineHw () determine which HW is connected to the LCB

This routine is used to determine what HW is connected to the LCB so that the LCBT_cmdExternalTest() can be run. The most likly configurations are: LCB to TEM (teststand) LCB to GASU (i.e. EBM) LCB to GASU to TEM (i.e. EBM and TEM)

Here is the call graph for this function:

unsigned int LCBT_cmdExternalHwAvail  ) 
 

get mask determined by LCBT_cmdExternalDetermineHw() for use in LCBT_cmdExternalTest()

Returns:
mask of HW connected to LCB

int LCBT_cmdExternalTest int  num,
int  singleAccess,
TDATA_DTEST  testType,
unsigned int  testParm,
int  disableHwDetect
 

read test on LCB local registers that require Cmd list DMA

Parameters:
num Number of accesses to do in the test
singleAccess 1=single acess per DMA, all reg are access within single DMA
testType Specifies the data sequence for test
testParm Parm to use with testType
disableHwDetect Disable HW probing too determine HW availible
Returns:
total errs
This test excersizes LCB board and driver by write/read/compare to registers on the TEMP or EBM if HW is availible. The registers are NOT set to reasonable values and only those register where this is not problematic are used.

Here is the call graph for this function:

int LCBT_cmdLocalTest int  num,
TDATA_DTEST  testType,
unsigned int  testParm
 

read test on LCB local registers that require Cmd list DMA

Parameters:
num Number of accesses to do in the test
testType Specifies the data sequence for test
testParm Parm to use with testType
Returns:
total errs

Here is the call graph for this function:

int LCBT_cmdLocalTest2 int  num,
TDATA_DTEST  testType,
unsigned int  testParm
 

2 task read test on LCB local registers that require Cmd list DMA

Parameters:
num Number of accesses to do in the test
testType Specifies the data sequence for test
testParm Parm to use with testType
Returns:
total errs
This is similar to LCBT_cmdLocalTest except that two tasks are spawned and do the test concurrently.

Here is the call graph for this function:

int LCBT_cmdLocalTest3 int  num,
TDATA_DTEST  testType,
unsigned int  testParm
 

3 task read test on LCB local registers that require Cmd list DMA

Parameters:
num Number of accesses to do in the test
testType Specifies the data sequence for test
testParm Parm to use with testType
Returns:
total errs
This is similar to LCBT_cmdLocalTest except that three tasks are spawned and do the test concurrently.

Here is the call graph for this function:

int LCBT_comboTest int  num,
int  maxLen,
int  latpAddr,
int  randomLen,
int  ccsds,
TDATA_DTEST  testType,
unsigned int  testParm
 

2 concurrent tasks running event and localCmdReg test

Parameters:
num number of events to send
maxLen max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767
latpAddr - LATp address of board to send to, 0=self
randomLen 1=packet range from 4 to maxEvtSize, 0=packets are maxEvtSize
ccsds 1=put CCSDS header on data sent out as event
testType Specifies the data sequence for test
testParm Parm to use with testType
Returns:
none
This test is intended to run only when loopback cable is attached to LCB board. Test combines localCmdReg test and event test to prove board properly handles this case. Both these tests use the Cmd list and send to the Request Queue. Num should be set to a high value to guarantee overlap of tests.

Here is the call graph for this function:

int LCBT_eventEcho int  forkPri  ) 
 

Setup to echo event data back to sender.

Parameters:
forkPri priority of forked task to send event data back
Returns:
none

int LCBT_eventRecv int  numRecv,
int  ccsds
 

Setup to receive and compare data from LCBT_eventSend().

Parameters:
numRecv 0=sets up and return, 1=waits for numRecv events
ccsds 1=expect CCSDS header on event data received
Returns:
none
This test sets up the receive end for data from LCBT_eventSend(). The data received is self describing so compares can be dome on it.

int LCBT_eventSend int  numEvents,
int  maxEvtSize,
int  latpAddr,
int  randomLen,
int  ccsds,
TDATA_DTEST  testType,
unsigned int  testParm
 

Send out test event data to be received by LCBT_eventRecv().

Parameters:
numEvents number of events to send
maxEvtSize max event size in int32 (4 to 120), 0 will set to maximum size for loopback which is 767
latpAddr - LATp address of board to send to, 0=self
randomLen 1=packet range from 4 to maxEvtSize, 0=packets are maxEvtSize
ccsds 1=put CCSDS header on data sent out as event
testType Specifies the data sequence for test
testParm Parm to use with testType
Returns:
none
This test creates and send self-describing test data over the event fabric. THe len of the event packet is random over legal values. LCBT_eventRecv() sets up LCB to receive and interpret the data packets sent by LCBT_eventSend()

Here is the call graph for this function:

int LCBT_eventTest int  num,
int  maxLen,
int  latpAddr,
int  randomLen,
int  ccsds,
TDATA_DTEST  testType,
unsigned int  testParm
 

Test to send/recv/compare event data thru loopback on LCB board.

Parameters:
num number of events to send
maxLen max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767
latpAddr - LATp address of board to send to, 0=self
randomLen 1=packet range from 4 to maxEvtSize, 0=packets are maxEvtSize
ccsds 1=put CCSDS header on data sent out as event
testType Specifies the data sequence for test
testParm Parm to use with testType
Returns:
none
This test is intended to run only when loopback cable is attached to LCB board. Events are sent in random legal sizes. LCBT_eventRecv() and LCBT_eventSend() can be used for testing between LCB boards.

Here is the call graph for this function:

int LCBT_eventTest2 int  num,
int  maxLen,
int  latpAddr,
int  randomLen,
int  ccsds,
TDATA_DTEST  testType,
unsigned int  testParm
 

2 concurrent task test to send/recv/compare event data thru loopback on LCB board

Parameters:
num number of events to send
maxLen max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767
latpAddr - LATp address of board to send to, 0=self
randomLen 1=packet range from 4 to maxEvtSize, 0=packets are maxEvtSize
ccsds 1=put CCSDS header on data sent out as event
testType Specifies the data sequence for test
testParm Parm to use with testType
Returns:
none
This test is intended to run only when loopback cable is attached to LCB board. LCBT_eventRecv() and LCBT_eventSend() can be used for testing between LCB boards. Test is similar to LCBT_eventTest except two tasks are spawned to do the same test. Num should be set to a high value to guarantee overlap of tests.

Here is the call graph for this function:

int LCBT_eventTest3 int  num,
int  maxLen,
int  latpAddr,
int  randomLen,
int  ccsds,
TDATA_DTEST  testType,
unsigned int  testParm
 

3 concurrent task test to send/recv/compare event data thru loopback on LCB board

Parameters:
num number of events to send
maxLen max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767
latpAddr - LATp address of board to send to, 0=self
randomLen 1=packet range from 4 to maxEvtSize, 0=packets are maxEvtSize
ccsds 1=put CCSDS header on data sent out as event
testType Specifies the data sequence for test
testParm Parm to use with testType
Returns:
none
This test is intended to run only when loopback cable is attached to LCB board. LCBT_eventRecv() and LCBT_eventSend() can be used for testing between LCB boards. Test is similar to LCBT_eventTest except three tasks are spawned to do the same test. Num should be set to a high value to guarantee overlap of tests.

Here is the call graph for this function:

int LCBT_eventWatermarkTest int  num,
int  latpAddr
 

Check for proper operation of watermarks on Event and EventData queues.

Parameters:
num Number of times to do the test
latpAddr - LATp address of board to send to, 0=self
Returns:
0=sucess, otherwise returns number of failed tests
This test checks that the watermark event come when expected given the settings of the watermarks on the queues.

NOTE: This test will not work with the current driver. The problem is that the eventSend causes the ISR/BH to run to handle eventSendDOne. While in the BH for DmaDOne it checks and drains the eventQueue. Therefore the eventQueue and eventBuff will never have a chance to fill to 25,50,or 75% since it is immediately drained !!!!!

Here is the call graph for this function:

int LCBT_init int  latpAddr,
int  useRedundantPath
 

inits LCB driver and start 2 tasks associated with driver

Parameters:
latpAddr LATp addr to assign to this board
useRedundantPath 0=normal path, 1=redundant path
Returns:
0=sucess else indicates errors in init
This routine inits the LCBT module. It must be called once after boot to setup the LCB driver for tests. (currently there is no way to shut down the driver, therefore to change the above parms, like latpAddr, one needs to reboot and call with new parameters. If this is called multiple times, the current LCB driver will create multiple tasks trying to listen to the ISR)

Here is the call graph for this function:

int LCBT_localRegTest int  num,
TDATA_DTEST  testType,
unsigned int  testParm
 

Read/write/compare test on all PCI accessable registers on LCB board.

Parameters:
num Number of events to do in the test
testType Specified the data sequence used for test data
testParm Parm to use with testType
Returns:
none

Here is the call graph for this function:

LCBT_printErrorDeltas char *  title  ) 
 

print the delta error counts since LCBT_saveErrorForDeltas()

Parameters:
title title to print before totals
Returns:
total error count

LCBT_printErrorTotals char *  title  ) 
 

print the global error counts

Parameters:
title title to print before totals
Returns:
total error count

LCBT_readCsr  ) 
 

Read CSR register.

Returns:
Value of register

LCBT_readDebug  ) 
 

Read debug register NOTE this will pull value from queue and effect operation.

Returns:
Value of register

LCBT_readEventBase  ) 
 

Read Event Base register which is start of Event circular buffer.

Returns:
Value of register

LCBT_readEventFree  ) 
 

Read Event Free register which is offset in Event circular buffer HW will write to.

Returns:
Value of register

LCBT_readEventQ  ) 
 

Read eventQueue NOTE this will pull value from queue and effect operation.

Returns:
Value of register

int LCBT_readFifoFault  ) 
 

read Fifo Fault registers (requires a DMA)

Returns:
value in register

LCBT_readHwInfo  ) 
 

Read hwInfo register.

Returns:
Value of register

LCBT_readIrq  ) 
 

Read IRQ register which has interrupt status.

Returns:
Value of register

int LCBT_readLatpCsr  ) 
 

read LATp CSR register (requires a DMA)

Returns:
value in register

unsigned int LCBT_readReg int  latpAddr,
int  block,
int  reg,
unsigned int *  value
 

read a single register over the cmdResponse fabric

Parameters:
latpAddr LCB address to access, HW type is inferred from addr
block Register block to access
reg Register number to access
value value to return, if 0 it will printf() value
Returns:
status
This routine does a syncronous read from a single register on HW connected thru LCB. Format of message is determined from latpAddr (so expectes standard assignments).

LCBT_readRequestQ  ) 
 

Read requestQueue, 0=notEMpty, not0=empty NOTE this will pull value from queue and effect operation.

Returns:
Value of register

LCBT_readResultQ  ) 
 

Read resultQueue NOTE this will pull value from queue and effect operation.

Returns:
Value of register

LCBT_regs  ) 
 

print vals of all registers in LCB

Returns:
none

Here is the call graph for this function:

LCBT_saveErrorForDeltas  ) 
 

stash global error counts to use with LCBT_printErrorDeltas()

Returns:
total error count

void LCBT_setEventWatermarks int  eventQWatermark,
int  eventBuffWatermark
 

Set watermarks to cause interrupts from EventQueue and EventBuff fifos.

Parameters:
eventQWatermark 0=75% full, 1=50% full, 2=25% full, 3=NotEmpty
eventBuffWatermark 0=75% full, 1=50% full, 2=25% full, 3=NotEmpty
Returns:
none
Sets up watermarks that cause interrupts from EventQueue or EventBuff. The EventQueue can hold 1024 event descriptors and interrupts on the number of events currently in buffer. The EventBuff holds up 516K of data and interrupts on the amount of event data availible (as oppsed to the number of events)

void LCBT_setOption unsigned int  mask  ) 
 

set test option mask, see LCBT.h for values

Parameters:
mask mask of tests options
Returns:
none

int LCBT_testAll int  num,
int  nLoops,
int  latpAddr,
int  useTem
 

overall test, does complete regression test of LCB

Parameters:
num number of accesses to board per test
nLoops number of times thru all tests test
latpAddr latpAddr of echo event server
useTem 1=run tests using TEM, 0=run only local LCB-board only tests
Returns:
0=success, else indicates errors detected

Here is the call graph for this function:

LCBT_updateErrorTotals int  numAccess,
int  rErr,
int  wErr,
int  cErr
 

update the global error counts

Parameters:
numAccess Number of R/W/Compare ops
rErr number of read errors
wErr number of write errors
cErr number of compare errors
Returns:
total error count g

LCBT_writeCsr unsigned int  data  ) 
 

Write given value to register.

Parameters:
data value to write to register
Returns:
Value of register

LCBT_writeEventBase unsigned int  data  ) 
 

Write given value to register.

Parameters:
data value to write to register
Returns:
Value of register

LCBT_writeEventFree unsigned int  data  ) 
 

Write given value to register.

Parameters:
data value to write to register
Returns:
Value of register

int LCBT_writeFifoFault unsigned int  data,
unsigned int  mask
 

write Fifo Fault register (requires a DMA)

Parameters:
data value to write to register
mask mask of bits to write, if 0 will default to full register
Returns:
value in register

int LCBT_writeLatpCsr unsigned int  data,
unsigned int  mask
 

write LATp CSR register (requires a DMA)

Parameters:
data value to write to register
mask mask of bits to write, if 0 will default to full register
Returns:
value in register

unsigned int LCBT_writeReg int  latpAddr,
int  block,
int  reg,
unsigned int  value,
int  broadcast
 

write to single register over the cmdResponse fabric

Parameters:
latpAddr LCB address to access, HW type is inferred from addr
block Register block to access
reg Register number to access
value value to write to register
broadcast broadcast to all address
Returns:
status
This routine does a syncronous write to a single register on HW connected thru LCB. Format of message is determined from latpAddr (so expectes standard assignments).


Generated on Wed Sep 8 02:52:14 2004 by doxygen 1.3.3