
Chapter 7: Testbench 7–9
Testbench Sequence
August 2014 Altera Corporation RapidIO II MegaCore Function
User Guide
Next, the test pushes five
DOORBELL
messages to the transmit
DOORBELL
Message FIFO
of the DUT. The test increments the message payload for each transaction, which
occurs when the drbl_master_bfm
read_write_cmd
task is invoked with a
‘WRITE
operation to the
TX
doorbell
register at offset
0x0000_000C
. This action programs the
16-bit message, an incrementing payload in this example, as well as the
DESTINATION_ID
—
0xCD
for an 8-bit device ID or
0xCDCD
for a 16-bit device ID—which
is used in the
DOORBELL
transaction packet.
To verify that the
DOORBELL
request packets have been sent, the test waits for the
drbell_s_irq
signal to be asserted. The test then reads the
Tx
Doorbell
Completion
register (refer to Table 6–89 on page 6–54). This register provides the
DOORBELL
messages that have been added to the Tx Completion FIFO. Five successfully
completed
DOORBELL
messages should appear in that FIFO and each one should be
accessible by reading the
Tx Doorbell
Completion
register five times in succession. To
perform this verification, the test invokes the
read_data
task defined in the instance
drbl_master_bfm.
The test waits for the DUT to assert the
drbell_s_irq
signal, which indicates that a
DOORBELL
message has been received. The test then reads the five received
DOORBELL
messages, by calling the
read_write_cmd
task with a
‘READ
operation to the
Rx
DOORBELL
register at offset
0x0000_0000
. The task is called five times, once for each
message, to return the received
DOORBELL
message.
Port-Write Transactions
To test port-writes, the test performs some basic configuration of the port-write
registers in the DUT and the sister_rio module. It then programs the DUT to transmit
port-write request packets to the sister_rio module. The port-writes are received by
the sister_rio module and retrieved by the test program.
The configuration enables the
RX_PACKET_STORED
interrupt in the sister_rio module. If
this interrupt is enabled, the sister_rio module asserts its
mnt_mnt_s_irq
signal when
the sister_rio module receives a Port-Write transaction and the payload can be
retrieved. To enable the interrupt, the testbench calls the sister_sys_mnt_master_bfm
read_write_cmd
task.
A write operation is performed by the task with the address
0x10084
and data
0x10
passed as parameters. In addition, the sister_rio module must be enabled to receive
Port-Write transactions from the DUT. The task is called with the address
0x10250
and
data
0x1
.
After the configuration is complete, the test performs the operations listed in
Table 7–5.
Table 7–5. Port-Write Test
Operation Action
Places data into the
TX_PORT_WRITE_BUFFER
Write incrementing payload to registers at
addresses
0x10210
to
0x1024C
Indicates to the DUT that Port-Write data is ready
Write
DESTINATION_ID
=
0xCD
or
0xCDCD
,
depending on the device ID width setting, and
PACKET_READY
=
0x1
to
0x10200
Waits for the sister_rio module to receive the port-write
Monitor the sister_rio module
mnt_mnt_s_irq
signal
Comentários a estes Manuais