GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCBT / V1-6-2 > lcbt / rad750


Interface   Data Structures   File List   Data Fields   Globals  

LCBT_cmdExternal.c File Reference

LCB Remote Cmd/Response exercise tests. More...

#include <LCBT/LCBT.h>
#include <LCBT/TDATA.h>
#include <PBS/PARITY.h>
#include <PBS/MBA.h>
#include <PBS/L.h>
#include <PBS/QI.h>
#include <LCBT_printf.h>
#include <string.h>

Functions

void LCBT_lamCruLoop (int num)
 loop on LAM write and CRU reg0 read, used for debugging HW
unsigned int LCBT_hwAvail ()
 get mask of hw determined by LCBT_determineHw() for use in LCBT_cmdExternalTest()
unsigned int LCBT_setCfg (int haveGasu, int haveTem)
 get mask determined by LCBT_determineHw() for use in LCBT_cmdExternalTest()
unsigned int LCBT_determineHw ()
 get mask determined by LCBT_determineHw() for use in LCBT_determineHw ()
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
unsigned int LCBT_initGasu ()
 setup registers in GASU
int LCBT_cmdExternalTest (int num, int singleAccess, TDATA_DTEST testType, unsigned int testParm)
 read test on LCB local registers that require Cmd list 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
void LCBT_dumpEbm ()
 dump all registers for EBM
void LCBT_dumpCru ()
 dump all registers for CRU
void LCBT_dumpTem (int latpAddr)
 dump some registers for TEM
void LCBT_setSiu (int idx)
 Set boardID in Csr to SIU addr.
void LCBT_setEpu (int idx)
 Set boardID in Csr to EPU addr.


Detailed Description

LCB Remote Cmd/Response exercise tests.

Author:
Ed Bacho -- ebacho@slac.stanford.edu These tests access registers on other boards thru the LCB cmd/respose fabric.

Function Documentation

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.

unsigned int 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().

void LCBT_dumpCru (  ) 

dump all registers for CRU

Returns:
none

void LCBT_dumpEbm (  ) 

dump all registers for EBM

Returns:
none

void LCBT_dumpTem ( int  latpAddr  ) 

dump some registers for TEM

Parameters:
latpAddr latpAddr of TEM which is 0-0xf
Returns:
none

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

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

unsigned int 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_lamCruLoop ( int  num  ) 

loop on LAM write and CRU reg0 read, used for debugging HW

Parameters:
num Number of accesses to do in the test, 0=forever
Returns:
nothing

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

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

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.

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


Generated on Fri Mar 25 12:53:42 2011 by  doxygen 1.5.8