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


Interface   Data Structures   File List   Data Fields   Globals  

LCBT.h File Reference

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

#include <LCBT/LCBT_initBoard.h>
#include <LCBT/TDATA.h>

Defines

#define LCBT_STALL   (0)
 standard stall value for register access, possible use in testing

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,
  LCBT_OPTION_COMPARE_FOR_ECHO = 0x20,
  LCBT_OPTION_RLCL_ADDR = 0x40,
  LCBT_OPTION_NOWRITEOVER = 0x80,
  LCBT_OPTION_NO_EVT_DUMP = 0x100
}
enum  _LCBT_AVAIL {
  LCBT_TEM_AVAIL = 1,
  LCBT_GASU_AVAIL = 2,
  LCBT_MASK_VALID = 0x8000
}

Functions

int LCBT_init (int latpAddr, int useRedundantPath, LCBD lcb)
 inits LCB driver (which starts 2 tasks associated with driver)
int LCBT_isInit ()
 indicates if LCBT_init has been run ok
void LCBT_setSiu (int idx)
 Set boardID in Csr to SIU addr.
void LCBT_setEpu (int idx)
 Set boardID in Csr to EPU addr.
int LCBT_eventInit (int forkPri)
 Setup module in this file to echo event data back to sender.
int LCBT_testAll (int num, int nLoops, int latpAddr, int loopbackCable)
 overall test, does complete regression test of LCB
int LCBT_testAllEpu (int num, int nLoops, int latpAddr, int loopbackCable)
 overall test for EPU, does complete regression test of LCB minus cmdResp test
void LCBT_setOption (unsigned int optionMask)
 set test option mask, see LCBT.h for values
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-only 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)
 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_eventTest5 (int num, int maxLen, int latpAddr, int randomLen, int ccsds, TDATA_DTEST testType, unsigned int testParm)
 5 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.
int LCBT_fillQueueTest (int numLoop, int disableResultInt)
 Fill requestQ with requests to make sure it handles it properly.
int LCBT_eventFillTest (int num, int latpAddr, int buffSize32, int printInfo)
 Check for proper operation circular buffFUll interrupt.
unsigned int LCBT_determineHw ()
 get mask determined by LCBT_determineHw() for use in LCBT_determineHw ()
unsigned int LCBT_hwAvail ()
 get mask of hw determined by LCBT_determineHw() for use in LCBT_cmdExternalTest()
unsigned int LCBT_initGasu ()
 setup registers in GASU
unsigned int LCBT_setCfg (int haveGasu, int haveTem)
 get mask determined by LCBT_determineHw() for use in LCBT_cmdExternalTest()
unsigned int LCBT_lam (int latpAddr)
 Send out LAM (lookAtMe) to specified addr.
unsigned int LCBT_remoteLatpCsr (int latpAddr, unsigned int val, unsigned int mask, int broadcast)
 send value to LatpCsr on another CPU over CmdResponse
unsigned int LCBT_setRemoteBoardId (int latpAddr)
 set board ID to latpAddr on CPU determined by CRU
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_getErrorTotals (int *numAccess, int *rErr, int *wErr, int *cErr)
 get the global error counts
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_eventSendDelay (int delayNanosec)
 Set delay in nanoSec between event sends, can be 0.
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_readLatpCsr ()
 read LATp CSR register (requires a DMA)
unsigned int LCBT_readFifoFault ()
 read Fifo Fault registers (requires a DMA)
unsigned int LCBT_readFabricSelect ()
 Read FabricSelect register which indicates primary or redundant.
unsigned int LCBT_readStats ()
 read stats register (requires a DMA)
void LCBT_readHwInfo ()
 Read hwInfo register.
unsigned int LCBT_writeCsr (unsigned int data)
 Write given value to register.
unsigned int LCBT_writeIrq (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_writeFabricSelect (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_writeStats (unsigned int data, unsigned int mask)
 write Stats register (requires a DMA)
void LCBT_latReset (unsigned int stall)
 sends LAT reset (requires a DMA)
unsigned int LCBT_setWatermark (unsigned int val)
 Write the watermark field in the CSR.
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
void LCBT_stats (int mask)
 print stats for LCB driver
void LCBT_clearStats ()
 clear stats for LCB driver
void LCBT_resetTest (int numReqPer)
 special test for reset fix on FpgaLat=0x5d
void LCBT_printAllocBuffs (int numErrLines, int numPrntLines, int wrap)
 allocates buffers for PRINTF and EPRINTF
void LCBT_printReleaseBuffs ()
 releases buffers for PRINTF and EPRINTF
void LCBT_printClearBuffs ()
 clear buffers for PRINTF and EPRINTF, i.e. no text
void LCBT_printGetErrBuff (char *errBuff, int maxLen)
 fills buffers for EPRINTF
void LCBT_printGetPrntBuff (char *prntBuff, int maxLen)
 fills buffers for PRINTF
void LCBT_printShellDisable (int disable)
 set disable flag to stop PRINTF and EPRINTF to VxSHell


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.34 2011/03/25 19:31:37 apw Exp $

Enumeration Type Documentation

Enumerator:
LCBT_GASU_AVAIL  TEM connected to LCB
LCBT_MASK_VALID  GASU(EBM) connected to LCB

Enumerator:
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
LCBT_OPTION_COMPARE_FOR_ECHO  use compare server for echo server
LCBT_OPTION_RLCL_ADDR  print cmd and rst list pointers in event test
LCBT_OPTION_NOWRITEOVER  disable writing over events after received
LCBT_OPTION_NO_EVT_DUMP  disable dump of event buff after error


Function Documentation

LCBT_clearErrorTotals (  ) 

clear the global error counts

Returns:
total error count before clearing

void LCBT_clearStats (  ) 

clear stats for LCB driver

Returns:
none

int LCBT_cmdExternalTest ( int  num,
int  singleAccess,
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
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
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.

References LCBT_GASU_AVAIL, LCBT_hwAvail(), LCBT_MASK_VALID, LCBT_OPTION_VERBOSE, LCBT_printErrorDeltas(), LCBT_readReg(), LCBT_saveErrorForDeltas(), LCBT_writeReg(), and PRINTF.

int LCBT_cmdLocalTest ( int  num,
TDATA_DTEST  testType,
unsigned int  testParm 
)

read-only 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

References LCBT_printErrorDeltas(), and LCBT_saveErrorForDeltas().

Referenced by LCBT_comboTest().

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.

References LCBT_printErrorDeltas(), and LCBT_saveErrorForDeltas().

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.

References LCBT_printErrorDeltas(), and LCBT_saveErrorForDeltas().

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 when loopback cable is attached to LCB board ir the LCB is connected to a GASU. 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.

References LCBT_cmdLocalTest(), LCBT_eventRecv(), LCBT_eventSend(), and TDATA_testStr().

LCBT_determineHw (  ) 

get mask determined by LCBT_determineHw() for use in LCBT_determineHw ()

determine which HW is connected to the LCBThis 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) It determines HW by trying to read registers in that HW. If HW config is known and user wishes to receive errors if HW is not operating, use the LCBT_setCfg() call to setup. Configuration is essentially only for LCBT_testAll() as it choose the tests to run. If tests withint LCBT_testAll() are called directly they will not consider the configuration setting.

References LCBT_hwAvail(), LCBT_lam(), LCBT_readReg(), LCBT_setCfg(), and PRINTF.

Referenced by LCBT_initGasu().

int LCBT_eventFillTest ( int  num,
int  latpAddr,
int  buffSize32,
int  printInfo 
)

Check for proper operation circular buffFUll interrupt.

Parameters:
num Number of times to do the test
latpAddr - LATp address of board to send to, 0=self
printInfo print irq and other info while processing
buffSize32 buffSize to send, must be multiple of 32 to match EBM, min is 128
Returns:
0=sucess, otherwise returns number of failed tests This tests the circEvtBuff full interrupt by filling the event buffer but not freeing the buffer. It checks that the proper interrupt sequence occurs when the last event is added to cause it to go full.

References EPRINTF, LCBT_eventRecv(), LCBT_eventSend(), and PRINTF.

int LCBT_eventInit ( int  echoForkPri  ) 

Setup module in this file to echo event data back to sender.

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

Referenced by LCBT_init().

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.

Referenced by LCBT_comboTest(), LCBT_eventFillTest(), LCBT_eventTest(), LCBT_eventTest2(), LCBT_eventTest3(), LCBT_eventTest5(), and LCBT_eventWatermarkTest().

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 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 creates and send self-describing test data over the event fabric. The len of the event packet is random over legal values. This routine is usually not called directly since it does not call LCBT_eventRecv. LCBT_eventRecv() sets up LCB to receive and interpret the data packets sent by LCBT_eventSend()

References EPRINTF, LCBT_OPTION_BUSYPRINT, LCBT_OPTION_FOREVER, LCBT_OPTION_INCTESTPARM, LCBT_OPTION_RLCL_ADDR, LCBT_OPTION_VERBOSE, PRINTF, RND_lc0_gen(), RND_lc0_init(), TDATA_create(), and TDATA_testStr().

Referenced by LCBT_comboTest(), LCBT_eventFillTest(), LCBT_eventTest(), LCBT_eventTest2(), LCBT_eventTest3(), and LCBT_eventTest5().

int LCBT_eventSendDelay ( int  delayNanosec  ) 

Set delay in nanoSec between event sends, can be 0.

Parameters:
delayNanosec delay in nanoSec
Returns:
previous setting of delay Sets s delay between eventSend's to avoid filling up queues.

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 with either a loopback cable attached to LCB board, or an LCB connected to a GASU. Events are sent in random legal sizes. The latpAddr should be the addr of the sending LCB or the address of another CPU/LCB running an echo server.

References LCBT_eventRecv(), LCBT_eventSend(), and TDATA_testStr().

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 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.

References LCBT_eventRecv(), LCBT_eventSend(), and TDATA_testStr().

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 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.

References LCBT_eventRecv(), LCBT_eventSend(), and TDATA_testStr().

int LCBT_eventTest5 ( int  num,
int  maxLen,
int  latpAddr,
int  randomLen,
int  ccsds,
TDATA_DTEST  testType,
unsigned int  testParm 
)

5 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 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.

References LCBT_eventRecv(), LCBT_eventSend(), and TDATA_testStr().

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.

References LCBT_eventRecv(), and PRINTF.

int LCBT_fillQueueTest ( int  numLoop,
int  disableResult 
)

Fill requestQ with requests to make sure it handles it properly.

Parameters:
numLoop Number of times to do in the test
disableResult fill up all queues by disabling result queue
Returns:
total errs This test is used to test the HW and driver to make sure it can handle the requestQ filling. In this case the driver should put the requests on a list and submit to the HW as the HW finishes other requests. The two test cases are: disableResult=0 THis should fill up Request queue and all queues before the transfer engine. disableResult=1 THis should fill up Request queue all queues before and after the transfer engine, and the result queue

References EPRINTF, LCBT_OPTION_VERBOSE, LCBT_STALL, and PRINTF.

LCBT_getErrorTotals ( int *  numAccess,
int *  rErr,
int *  wErr,
int *  cErr 
)

get the global error counts

Parameters:
numAccess if not NULL, return number of R/W/Compare ops
rErr if not NULL, return number of read errors
wErr if not NULL, return number of write errors
cErr if not NULL, return number of compare errors
Returns:
total error count

unsigned int LCBT_hwAvail (  ) 

get mask of hw determined by LCBT_determineHw() for use in LCBT_cmdExternalTest()

Returns:
mask of HW connected to LCB

Referenced by LCBT_cmdExternalTest(), LCBT_determineHw(), LCBT_testAll(), and LCBT_testAllEpu().

int LCBT_init ( int  latpAddr,
int  useRedundantPath,
LCBD  lcb 
)

inits LCB driver (which starts 2 tasks associated with driver)

Parameters:
latpAddr LATp addr to assign to this board
useRedundantPath 0=primary path, 1=redundant path
lcb lcbd driver handle is driver if already init (use LCBD_get()), if 0 will load driver
Returns:
0=sucess else indicates errors in init This routine inits the LCBT module and optionaly load the LCBD driver. It must be called once after boot to setup the LCBT module for tests.

References LCBT_eventInit(), LCBT_initBoard(), and LCBT_printInit().

LCBT_initGasu (  ) 

setup registers in GASU

determine which HW is connected to the LCBThis routine is used as an alternative to PIG to init the GASU. DO NOT use if you are using PIG to setup the HW.

References EPRINTF, LCBT_determineHw(), LCBT_lam(), LCBT_readReg(), LCBT_writeReg(), and PRINTF.

int LCBT_isInit (  ) 

indicates if LCBT_init has been run ok

Returns:
0=not init, 1=been init

LCBT_lam ( int  latpAddr  ) 

Send out LAM (lookAtMe) to specified addr.

Parameters:
latpAddr addr to send LAM to
Returns:
status

References LCBT_writeReg().

Referenced by LCBT_determineHw(), LCBT_initGasu(), and LCBT_lamCruLoop().

void LCBT_latReset ( unsigned int  stall  ) 

sends LAT reset (requires a DMA)

Parameters:
stall stall after reset in 50 nSec tics
Returns:
status To be used with great discretion, i.e. in case of emergency break glass.

References EPRINTF.

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

References EPRINTF, LCBT_OPTION_BUSYPRINT, LCBT_saveErrorForDeltas(), LCBT_updateErrorTotals(), PRINTF, TDATA_getNextSeqVal(), and TDATA_getRandCtxForSeqVal().

void LCBT_printAllocBuffs ( int  numErrLines,
int  numPrntLines,
int  wrap 
)

allocates buffers for PRINTF and EPRINTF

Parameters:
numErrLines number of lines to be buffered
numPrntLines number of lines to be buffered
wrap 0=buffer fills and stops, 1=buffer wraps and deltes oldest
Returns:
none

References LCBT_printClearBuffs().

void LCBT_printClearBuffs (  ) 

clear buffers for PRINTF and EPRINTF, i.e. no text

Returns:
none

Referenced by LCBT_printAllocBuffs().

LCBT_printErrorDeltas ( char *  title  ) 

print the delta error counts since LCBT_saveErrorForDeltas()

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

References PRINTF.

Referenced by LCBT_cmdExternalTest(), LCBT_cmdLocalTest(), LCBT_cmdLocalTest2(), and LCBT_cmdLocalTest3().

LCBT_printErrorTotals ( char *  title  ) 

print the global error counts

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

References PRINTF.

void LCBT_printGetErrBuff ( char *  errBuff,
int  maxLen 
)

fills buffers for EPRINTF

Parameters:
errBuff buffer to fill in
maxLen length of buffer to fill in
Returns:
none

void LCBT_printGetPrntBuff ( char *  prntBuff,
int  maxLen 
)

fills buffers for PRINTF

Parameters:
prntBuff buffer to fill in
maxLen length of buffer to fill in
Returns:
none

void LCBT_printReleaseBuffs (  ) 

releases buffers for PRINTF and EPRINTF

Returns:
none

void LCBT_printShellDisable ( int  disable  ) 

set disable flag to stop PRINTF and EPRINTF to VxSHell

Parameters:
disable 0=print to shell, 1=no print to shell
Returns:
none

unsigned int LCBT_readCsr (  ) 

Read CSR register.

Returns:
Value of register

References PRINTF.

Referenced by LCBT_regs().

unsigned int LCBT_readEventBase (  ) 

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

Returns:
Value of register

References PRINTF.

Referenced by LCBT_regs().

unsigned int LCBT_readEventFree (  ) 

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

Returns:
Value of register

References PRINTF.

Referenced by LCBT_regs().

unsigned int LCBT_readEventQ (  ) 

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

Returns:
Value of register

unsigned int LCBT_readFabricSelect (  ) 

Read FabricSelect register which indicates primary or redundant.

Returns:
Value of register, 0=promary, 1=redundant

References PRINTF.

Referenced by LCBT_regs().

unsigned int LCBT_readFifoFault (  ) 

read Fifo Fault registers (requires a DMA)

Returns:
value in register

References EPRINTF, LCBT_STALL, and PRINTF.

Referenced by LCBT_regs().

void LCBT_readHwInfo (  ) 

Read hwInfo register.

Returns:
Value of register

Referenced by LCBT_regs().

unsigned int LCBT_readIrq (  ) 

Read IRQ register which has interrupt status.

Returns:
Value of register

References PRINTF.

Referenced by LCBT_regs().

unsigned int LCBT_readLatpCsr (  ) 

read LATp CSR register (requires a DMA)

Returns:
value in register

References EPRINTF, LCBT_STALL, and PRINTF.

Referenced by LCBT_regs().

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 expects standard assignments).

References LCBT_OPTION_RLCL_ADDR, and PRINTF.

Referenced by LCBT_cmdExternalTest(), LCBT_determineHw(), LCBT_initGasu(), LCBT_lamCruLoop(), and LCBT_setRemoteBoardId().

unsigned int LCBT_readRequestQ (  ) 

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

Returns:
Value of register

unsigned int LCBT_readResultQ (  ) 

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

Returns:
Value of register

Referenced by LCBT_resetTest().

unsigned int LCBT_readStats (  ) 

read stats register (requires a DMA)

Returns:
value in register

References EPRINTF, LCBT_STALL, and PRINTF.

Referenced by LCBT_regs().

LCBT_regs (  ) 

unsigned int LCBT_remoteLatpCsr ( int  latpAddr,
unsigned int  val,
unsigned int  mask,
int  broadcast 
)

send value to LatpCsr on another CPU over CmdResponse

Parameters:
latpAddr addr to send to, ignored if broadcast=0
val value to write to LatpCsr
mask mask on register,if =0 will assume 0xfffffff (all bits)
broadcast send out as broadcast (needed to set boardID)
Returns:
status

References LCBT_writeReg().

Referenced by LCBT_setRemoteBoardId().

void LCBT_resetTest ( int  numReqPer  ) 

special test for reset fix on FpgaLat=0x5d

Parameters:
numReqPer num of read for each of 4 part test
Returns:
nothing This test was developed to reproduce a problem seen with LatFpga < 0x5d on the cPci LCB board. The problem was that the discrete fifo's failed to be reset properly if there was no 20 MHz clock from the GASU (i.e. GASU was not yet powered up).
This test requires USER INTERACTION to turn off/on the 20 MHz clock (usually by powering the GASU on and off).

The fix in LatFpga=0x5d allows this test to run sucessfully without errors.

References LCBT_readResultQ(), LCBT_writeCsr(), LCBT_writeIrq(), and PRINTF.

LCBT_saveErrorForDeltas (  ) 

stash global error counts to use with LCBT_printErrorDeltas()

Returns:
total error count

Referenced by LCBT_cmdExternalTest(), LCBT_cmdLocalTest(), LCBT_cmdLocalTest2(), LCBT_cmdLocalTest3(), and LCBT_localRegTest().

unsigned int LCBT_setCfg ( int  haveGasu,
int  haveTem 
)

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

Parameters:
haveGasu 1=have GASU/EBM
haveTem 1=have TEM either thru GASU or Transition Board
Returns:
mask of HW connected to LCB This routine is used instead of LCNT_determineHw() when the HW configuration is already known. Configuration is essentially only for LCBT_testAll() as it choose the tests to run. If tests withint LCBT_testAll() are called directly they will not consider the configuration setting.

References LCBT_GASU_AVAIL, and LCBT_MASK_VALID.

Referenced by LCBT_determineHw().

void LCBT_setEpu ( int  idx  ) 

Set boardID in Csr to EPU addr.

Parameters:
idx which EPU,0=EPU0,1=EPU1,2=EPU3
Returns:
none

References PRINTF.

void LCBT_setOption ( unsigned int  mask  ) 

set test option mask, see LCBT.h for values

Parameters:
mask mask of tests options
Returns:
none

unsigned int LCBT_setRemoteBoardId ( int  latpAddr  ) 

set board ID to latpAddr on CPU determined by CRU

Parameters:
latpAddr addr to send to, ignored if broadcast=0
Returns:
status This routine sets up CRU to enable one path to a CPU (determined by latpAddr) and then sets the CPU on that path for boardId=latpAddr. This function is normally done by PIG so this routine should be used with CAUTION.

References EPRINTF, LCBT_readReg(), LCBT_remoteLatpCsr(), and LCBT_writeReg().

void LCBT_setSiu ( int  idx  ) 

Set boardID in Csr to SIU addr.

Parameters:
idx which SIU,0=SIU0,1=SIU1,-1=SIUX
Returns:
none

References PRINTF.

unsigned int LCBT_setWatermark ( unsigned int  val  ) 

Write the watermark field in the CSR.

Parameters:
val 0=3/4 full,1=1/2 full, 2=1/4 full, 3=notEmpty
Returns:
Value of csr register

References PRINTF.

void LCBT_stats ( int  mask  ) 

print stats for LCB driver

Parameters:
mask 0=all,1=ISR,2=rst,4=evt,8=time
Returns:
none

int LCBT_testAll ( int  num,
int  nLoops,
int  latpAddr,
int  loopbackCable 
)

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 0=route event tests back to self, else route event test to echo server at this addr
loopbackCable 1=loopback cable present and will run event test, 0=no cable so run event tests only if GASU availible
Returns:
0=success, else indicates errors detected This routine does all the regression tests for an LCB board. The routines uses the configuration set thru LCBT_determineHw() or LCBT_setCfg() to determine which tests are appropriate to run. It keeps a sum of total accesses and errors over all the tests.
The events test run can be looped back thru a loopback cable, a GASU, or another CPU (running echo server) connected to the GASU.

References LCBT_GASU_AVAIL, LCBT_hwAvail(), LCBT_MASK_VALID, and PRINTF.

int LCBT_testAllEpu ( int  num,
int  nLoops,
int  latpAddr,
int  loopbackCable 
)

overall test for EPU, does complete regression test of LCB minus cmdResp test

Parameters:
num number of accesses to board per test
nLoops number of times thru all tests test
latpAddr 0=route event tests back to self, else route event test to echo server at this addr
loopbackCable 1=loopback cable present and will run event test, 0=no cable so run event tests only if GASU availible
Returns:
0=success, else indicates errors detected Same as LCBT_testAll() except will not do cmdResponse tests since can only be done from a commander.

References LCBT_GASU_AVAIL, LCBT_hwAvail(), LCBT_MASK_VALID, and PRINTF.

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

Referenced by LCBT_localRegTest().

unsigned int LCBT_writeCsr ( unsigned int  data  ) 

Write given value to register.

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

Referenced by LCBT_resetTest().

unsigned int LCBT_writeEventBase ( unsigned int  data  ) 

Write given value to register.

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

unsigned int LCBT_writeEventFree ( unsigned int  data  ) 

Write given value to register.

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

unsigned int LCBT_writeFabricSelect ( unsigned int  data  ) 

Write given value to register.

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

unsigned 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

References EPRINTF, and LCBT_STALL.

unsigned int LCBT_writeIrq ( unsigned int  data  ) 

Write given value to register.

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

Referenced by LCBT_resetTest().

unsigned 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

References EPRINTF, and LCBT_STALL.

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 expects standard assignments).

References LCBT_OPTION_RLCL_ADDR, and PRINTF.

Referenced by LCBT_cmdExternalTest(), LCBT_initGasu(), LCBT_lam(), LCBT_remoteLatpCsr(), and LCBT_setRemoteBoardId().

unsigned int LCBT_writeStats ( unsigned int  data,
unsigned int  mask 
)

write Stats 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

References EPRINTF, and LCBT_STALL.


Generated on Fri Apr 1 12:34:54 2011 by  doxygen 1.5.8