Xilinx UG154 Microscope & Magnifier User Manual


 
SPI-4.2 v8.5 Getting Started Guide www.xilinx.com 51
UG154 March 24, 2008
Random Testcase Sample Code
R
The send_status procedure is used to change the status for a particular channel.
The get_status procedure is called to check status of a specific channel. It will cause the
status value of that channel to be returned to the Testcase.
Random Testcase Sample Code
The following code is an example that can be inserted into the pl4_testcase.v file to
send randomized data to the Sink core. It should replace the default code used to send
data. In addition to sending randomized data, it also randomly asserts each request signal.
wait (Reset_n == 1);
@ (posedge RDClk2x);
//********************************************************************
******
// Sends out randomized data, idles, or training.
// It also randomly toggles TCIdleRequest, TCTrainingRequest,
// TCDIP4Request, TCDIP2Request, and TCSnkDip2ErrRequest
//********************************************************************
******
forever
begin
RandTask = {$random(`RANDOM_SEED + $time)} % 4;
ERR2 0 or 1 Defines if the second packet should be terminated
with an EOP abort. If set to 0 the EOPs will be
calculated from Bytes1.
ADDR2 0 to 255 Channel on which the second packet should be
sent.
BYTES2 1 to 255 The number of bytes to send in the second burst.
NUM_CYCLES 0 to
[5 - roundup
(BYTES1/2)]
The number of idle cycles between the first and
second burst.
Table B-6: send_status (channel, value) Inputs
Name Range Description
CHANNEL 0 to 255 Defines the channel whose status will be
updated.
VALUE 00,01,10,11 Defines the new status value to assign to the
selected channel.
Table B-7: get_status (channel) Inputs
Input Range Description
CHANNEL 0 to 255 Defines the channel whose status will be read.
Table B-5: sop_spacing (Bytes1, Err1, Addr1, EOP2, Err2, Addr2, Bytes2,
num_cycles) Inputs (Continued)
Name Range Description