Example 11-3. master transfer execution, Example 11-3 – Altera Mentor Verification IP Altera Edition AMBA AXI4-Stream User Manual

Page 184

Advertising
background image

Mentor Verification IP AE AMBA AXI4-Stream User Guide, V10.3

184

VHDL Tutorials
Verifying a Slave DUT

April 2014

Example 11-3. Master Transfer Execution

-- 10 x packet at transfer level with
-- Number of transfer = i % 10. Values : 1, 2 .. 10
-- id = i % 15. Values 0, 1, 2 .. 14
-- dest = i %20. Values 0, 1, 2 .. 19
for i in 0 to 9 loop

transfer_count := (i mod 10) + 1;
create_master_transaction(transfer_count, trans, index,

axi4stream_tr_if_0(index));

set_id(i mod 15, trans, index, axi4stream_tr_if_0(index));
set_dest(i mod 20, trans, index, axi4stream_tr_if_0(index));
m := 0;
while(m < transfer_count) loop

k := m;
while(k < transfer_count) loop

set_data(k, k, trans, index, axi4stream_tr_if_0(index));
if(((i + m) mod 5) = 0) then

set_byte_type(AXI4STREAM_NULL_BYTE, m, trans, index,

axi4stream_tr_if_0(index));

elsif(((i + m) mod 5) = 1) then

set_byte_type(AXI4STREAM_POS_BYTE, m, trans, index,

axi4stream_tr_if_0(index));

else

set_byte_type(AXI4STREAM_DATA_BYTE, m, trans, index,

axi4stream_tr_if_0(index));

end if;
k := k + 1;

end loop;
execute_transfer(trans, m / byte_count, index,

axi4stream_tr_if_0(index));

m := m + byte_count;

end loop;

end loop;

Advertising