Example 11-5 – Altera Mentor Verification IP Altera Edition AMBA AXI3/4TM User Manual

Page 632

Advertising
background image

Mentor VIP AE AXI3/4 User Guide, V10.2b

612

VHDL Tutorials
Verifying a Slave DUT

September 2013

The read transaction is then executed onto the protocol signals by calling the

execute_transaction()

procedure. The read data is obtained by calling the

get_data_words()

procedure twice to get the data_words transaction field values. The result of the read data is
compared with the expected data—and a message displays the transcript.

Example 11-5. Read Burst Transaction Creation and Execution

-- Read data burst of length 1 from address 16.
create_read_transaction(16, 1, tr_id, index, axi_tr_if_0(index));
execute_transaction(tr_id, index, axi_tr_if_0(index));

get_data_words(data_words, 0, tr_id, index, axi_tr_if_0(index));
if(data_words(31 downto 0) = x"ACE0ACE1") then

report "master_test_program: Read correct data (hACE0ACE1) at

address(16)";

else

hwrite(lp, data_words(31 downto 0));
report "master_test_program: Error: Expected data (hACE0ACE1) at

address (16), but got " & lp.all;

end if;
get_data_words(data_words, 1, tr_id, index, axi_tr_if_0(index));
if(data_words(31 downto 0) = x"ACE2ACE3") then

report "master_test_program: Read correct data (hACE2ACE3) at

address (20)";

else
hwrite(lp, data_words(31 downto 0));
report "master_test_program: Error: Expected data (hACE2ACE3) at

address (20), but got " & lp.all;

end if;

In the complete Master Test Program, a subsequent read transaction is created and executed in a
similar manner to that shown in

Example 11-5

. See the

VHDL AXI3 Master BFM Test Program

code listing for details.

Outstanding Write Burst Transaction Creation and Execution

The code excerpt in

Example 11-2

uses the AXI3 Master BFM

create_write_transaction()

procedure to create a write burst transaction by providing the start address and burst length
arguments. The actual length of the burst on the protocol wires is 3+1=4.

Note

The burst length argument passed to the

create_read_transaction()

procedure is 1 less

than the number of transfers (beats) in the burst. This aligns the burst length argument
value with the value placed on the ARLEN protocol signals.

The

set_data_words()

procedure is then called four times to set the data_words field of the

write transaction for each beat of the data burst. For this write transaction, all data byte lanes
contain valid data on each beat of the data burst, therefore a ‘for .. loop’ uses the

set_write_strobes()

procedure to set the write_strobes fields of the transaction to 15.

Advertising