
Chapter 7: Testbenches 7–5
August 2014 Altera Corporation RapidIO MegaCore Function
User Guide
■
‘WRITE
—transaction type to be executed
■
wr_address
—address to be driven on the Avalon-MM address bus
■
wr_data
—write data to be driven on the Avalon-MM write data bus
The task performs the write transaction across the Maintenance Write Avalon-MM
slave interface.
The DUT then sends two
MAINTENANCE
read requests
to the sister_rio module. To
perform the reads, run the
rw_data
task defined inside the BFM instance,
bfm_mnt_master. The following parameters are passed to the task:
■
‘READ
— transaction type to be executed
■
rd_address
—address to be driven on the Avalon-MM address bus
■
rd_data
—parameter that stores the data read across the Avalon-MM read data bus
The
rw_data
task performs the read transaction across the Maintenance Read Avalon-
MM slave interface.
The write transaction across the Avalon-MM interface is translated to a RapidIO
MAINTENANCE
write request
packet. Similarly, the read transaction across the Avalon-
MM interface is translated into a RapidIO
MAINTENANCE
read request
packet.
The
MAINTENANCE
write
and
read request
packets are received by the sister_rio
module and translated to Avalon-MM transactions that are presented across the
sister_rio module’s Maintenance master Avalon-MM interface. An instance of
avalon_bfm_slave, the BFM for an Avalon-MM slave, is driven by this interface. In the
testbench, the write and read transactions are checked and data is returned for the
read operation. The write operation is checked by invoking the
read_writedata
task
of the BFM. The task returns the write address and the written data. This information
is then checked for data integrity. The read operation is completed on the sister side
by invoking the
write_readdata
task. This task returns the read address and drives
the return data and read control signals on the Avalon-MM master read port of the
sister_rio module. The read data is checked after it is received by the DUT.
SWRITE Transactions
The next set of operations performed are Streaming Writes (
SWRITE
). To perform
SWRITE
operations, one register in the IP core must be reconfigured as shown in
Table 7–2.
With the setting in Table 7–2, any write operation presented across the Input/Output
Avalon-MM slave interface on the rio module is translated to a RapidIO Streaming
Write transaction.
Table 7–2. SWRITE Register
Module
Register
Address
Name Value Description
rio 0x1040C
Input/Output
Slave Mapping
Window 0 Control
32'h0055_0002
or
32'h5555_0002
Sets the
DESTINATION_ID
for outgoing transactions
to the value
0x55
or
0x5555
, depending on the
device ID width of the sister_rio. This value matches
the base device ID of the sister_rio module. Enables
SWRITE
operations.
Commenti su questo manuale