GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LCBT / V1-4-1

Constituent: lcbt     Tag: mv2304


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"

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 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
}
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)

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 () determine which HW is connected to the LCB

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 determine which HW is connected to the LCB

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


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.29 2005/01/10 17:25:11 ebacho Exp $

Enumeration Type Documentation

enum _LCBT_AVAIL
 

Enumeration values:
LCBT_GASU_AVAIL  TEM connected to LCB
LCBT_MASK_VALID  GASU(EBM) 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
LCBT_OPTION_COMPARE_FOR_ECHO  use compare server for echo server
LCBT_OPTION_RLCL_ADDR  print cmd and rst list pointers in event test


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.

Here is the call graph for this function:

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

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

Here is the call graph for this function:

unsigned int LCBT_determineHw  ) 
 

get mask determined by LCBT_determineHw() for use in LCBT_determineHw () 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) 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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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

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 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()

Here is the call graph for this function:

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.

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

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.

Here is the call graph for this function:

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

unsigned int LCBT_hwAvail  ) 
 

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

Returns:
mask of HW connected to LCB

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.

Here is the call graph for this function:

unsigned int LCBT_initGasu  ) 
 

setup registers in GASU determine which HW is connected to the LCB

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

Here is the call graph for this function:

unsigned int LCBT_lam int  latpAddr  ) 
 

Send out LAM (lookAtMe) to specified addr.

Parameters:
latpAddr addr to send LAM to
Returns:
status

Here is the call graph for this function:

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.

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

unsigned int LCBT_readCsr  ) 
 

Read CSR register.

Returns:
Value of register

unsigned int LCBT_readEventBase  ) 
 

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

Returns:
Value of register

unsigned int LCBT_readEventFree  ) 
 

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

Returns:
Value of register

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

int LCBT_readFifoFault  ) 
 

read Fifo Fault registers (requires a DMA)

Returns:
value in register

void LCBT_readHwInfo  ) 
 

Read hwInfo register.

Returns:
Value of register

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

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

int LCBT_readStats  ) 
 

read stats register (requires a DMA)

Returns:
value in register

LCBT_regs  ) 
 

print vals of all registers in LCB

Returns:
none

Here is the call graph for this function:

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

Here is the call graph for this function:

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.

Here is the call graph for this function:

LCBT_saveErrorForDeltas  ) 
 

stash global error counts to use with LCBT_printErrorDeltas()

Returns:
total error count

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.

void LCBT_setEpu int  idx  ) 
 

Set boardID in Csr to EPU addr.

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

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.

Here is the call graph for this function:

void LCBT_setSiu int  idx  ) 
 

Set boardID in Csr to SIU addr.

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

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

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.

Here is the call graph for this function:

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.

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

unsigned int LCBT_writeCsr unsigned int  data  ) 
 

Write given value to register.

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

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

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

unsigned int LCBT_writeIrq unsigned int  data  ) 
 

Write given value to register.

Parameters:
data value to write to register
Returns:
Value of 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 expects standard assignments).

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


Generated on Wed Jan 19 21:28:34 2005 by doxygen 1.3.3