SPI-4.2 v8.5 Getting Started Guide www.xilinx.com 45
UG154 March 24, 2008
R

Appendix A

VHDL Details

Procedures Module

The procedures module is a package of functions instantiated in the testcase module to
simplify the sending of data and status to the Stimulus module. By using these functions,
the user can create any desired sequence of data or status. All functions are called from the
Testcase module using the following format:
Format: <function name>(<IOBus>, <inputs>)
Example: send_packet(ProBusR, 0, 40): A 40-byte long packet is sent on
channel 0.
The procedures module handles all clocking for the Testcase module. For an example of
how these procedures are used, see the default file (pl4_testcase.vhd) provided with
the core.
All functions in the VHDL procedures module use a passed-in record to inspect and
modify the state of the interface with the Stimulus module. There are two such record
types defined in the procedures module: ProceduresRDClkBusType (PBr) and
ProceduresTSClkBusType (PBt). For a usage example, see the provided testcase file
(pl4_testcase.vhd).
The tables in this section describe supported functions included in the procedures module.
reset (PBr) and reset (PBr) procedures are used to initialize the PBr and PBt records. They
must be called at the beginning of every testcase.
The send_packet procedure is used to transmit an entire packet of data. This procedure
always sends a SOP control word before the burst of data and an EOP control word
following the data burst. The EOPs (bits 14:13 of the control word following the burst) are
automatically calculated from the number of bytes sent.
The send_user_data procedure is used to transmit a burst of data. The presence of a SOP
control word (before the burst of data) and an EOP control word (following the data burst),
can be specified. The EOPs (bits 14:13 of the control word following the burst) are
Tabl e A -1 : send_packet (PBr, addr, bytes) Inputs
Name Range Description
ADDR 0 to 255 Channel on which the packet should be sent.
BYTES 1 to 255 Number of bytes to send on the selected channel.