Development Tools User’s Guide
319
Intel
®
IXP2400/IXP2800 Network Processors
SPI4 Bus Functional Model
E.3.4.3
spi4_get_rx_clock_cycle/spi4_get_tx_cycle_count
The
spi4_get_rx_clock_cycle
/
spi4_get_tx_cycle_count
returns the spi4_bfm
cycle count for reference.
int
spi4_get_rx_clock_cycle
(int
device_id
,
int
port_num)
int
spi4_get_tx_clock_cycle
(int
device_id
,
int
port_num)
where:
device_id
:
unique device id for each device
port_num
port in the specified device
E.3.4.4
spi4_reset_stat
The
spi4_reset_stat
resets both the rx/tx statistics over spi4_bfm.
int
spi4_reset_stat
(
void)
E.3.4.5
spi4_version
The
spi4_version
prints out the version and built time of spi4_bfm.dll
int
spi4_version
(
)
E.4
C-API
The following C-API provides access functions to retrieve SPI4 BFM FIFO statistics through C-
function calls. They are the C-function implementations of the aforementioned statistic information
access console functions. The only addition is the
RegisterMessageCallback
function,
which allows the WB to register a callback routine to handle message print out in the GUI
environment.
SPI4_WMAC_API
int
GetNumBytesInRxBuffer
(int
device_id
,
int
port_num)
SPI4_WMAC_API
void
GetRxBufferBytes
(int
device_id
,
int
port_num,
unsigned char
*buffer,
int
buffer_size)
SPI4_WMAC_API
int
GetNumBytesInTxBuffer
(int
device_id
,
int
port_num)
SPI4_WMAC_API
void
GetTxBufferBytes
(int
device_id
,
int
port_num,