GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCBD / V1-5-2 > test_lcbb / rhel5-32


Interface   Data Structures   File List   Data Fields   Globals  

test_lcbb.c File Reference

Unit test for the LCBB driver. More...

#include <ptd/lcb_display.h>
#include <LCBD/LCBB.h>
#include <LCBD/LCB_cr.h>
#include <PBS/BSWP.ih>
#include <PBS/PBS.h>
#include <PBS/L.h>
#include <PBS/TMR.h>
#include <PBS/MBA.h>
#include <stdio.h>

Classes

struct  _CTX
 The context/control block for this suite of tests. More...

Defines

#define PROTO   0
 The default protocol to send messages on.

Typedefs

typedef struct _CTX CTX
 Typedef for struct _CTX.

Functions

unsigned int test_lcbb_init (int src_board_id, int dst_board_id)
 Test suite initialization routine.
unsigned int test_lcbb_xtrace_show (void)
 Displays the contents of the LCBB trace buffer.
unsigned int test_lcbb_mark_time (int stall, int want_title)
 Tests the LCBB_mark_time function.
unsigned int test_lcbb_csr_read (void)
 Tests the LCBB_csr_access with parameters that just read the register.
unsigned int test_lcbb_faults_read (void)
 Tests the LCBB_faults_access with parameters that just read the register.
unsigned int test_lcbb_rxstats_read (void)
 Tests the LCBB_rxstats_access with parameters that just read the register.
unsigned int test_lcbb_pci_csr_read (void)
 Reads the PCI CSR.
unsigned int test_lcbb_pci_irq_read (void)
 Reads the PCI IRQ register.
unsigned int test_lcbb_pci_fab_read (void)
 Reads the PCI Fabric Select register.
unsigned int test_lcbb_send (int style, int n)
 Fills a buffer in the specified style for the specified number of items.
unsigned int test_lcbb_receive (void)
 Receives a previously sent message.
unsigned int test_lcbb_free1 (void)
 Frees the oldest message on the que.
unsigned int test_lcbb_free_all (void)
 Frees the all the messages on the que.
int main (int argc, char *argv[])
 The usual host main program.

Variables

CTX Ctx
 Static, global instance of the context/control block.


Detailed Description

Unit test for the LCBB driver.

Author:
JJRussell -- russell@slac.stanford.edu
  CVS $Id

Function Documentation

int main ( int  argc,
char *  argv[] 
)

unsigned int test_lcbb_free1 ( void   ) 

Frees the oldest message on the que.

Return values:
0,if successful
-1,if no message to free
Returns:
The status code of LCBB_free

References _CTX::lcb, and _CTX::list.

unsigned int test_lcbb_free_all ( void   ) 

Frees the all the messages on the que.

Returns:
The number of messages freed

References _CTX::lcb, and _CTX::list.

unsigned int test_lcbb_init ( int  src_board_id,
int  dst_board_id 
)

Test suite initialization routine.

Parameters:
src_board_id The board id of the host LCB, defaults to 3
dst_board_id the board id of the destination LCB, defaults to the src_board_id + the master off (0x20)

References _CTX::dat, _CTX::dst, _CTX::lcb, LCB_EVENT_BUFFER_ALIGN, LCB_EVENT_BUFFER_TOTAL, LCB_REQUEST_LIST_ALIGN, LCB_RESULT_LIST_ALIGN, _CTX::list, _CTX::n, PROTO, _CTX::proto, _CTX::src, _CTX::style, test_lcbb_csr_read(), test_lcbb_faults_read(), test_lcbb_rxstats_read(), and test_lcbb_xtrace_show().

unsigned int test_lcbb_mark_time ( int  stall,
int  want_title 
)

Tests the LCBB_mark_time function.

Parameters:
stall The stall time in 50 nsecs ticks
want_title Indicates that the title should/should not be displayed

References _CTX::lcb.

unsigned int test_lcbb_send ( int  style,
int  n 
)

Fills a buffer in the specified style for the specified number of items.

Parameters:
style The filling style
  • 0 = Incrementing byte fill
n The number of items to fill, style dependent

References _CTX::dat, _CTX::dst, _CTX::lcb, _CTX::n, _CTX::proto, and _CTX::style.


Generated on Tue Nov 29 19:41:13 2011 by  doxygen 1.5.8