Altera Mentor Verification IP Altera Edition AMBA AXI3/4TM User Manual

Page 753

Advertising
background image

VHDL AXI3 and AXI4 Test Programs

VHDL AXI3 Master BFM Test Program

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

733

September 2013

--4 x Reads
--Read data from address 1.
create_read_transaction(1, tr_id, index, axi_tr_if_0(index));
set_id(1, tr_id, index, axi_tr_if_0(index));
execute_transaction(tr_id, index, axi_tr_if_0(index));

get_data_words(data_words, tr_id, index, axi_tr_if_0(index));
if(data_words(31 downto 0) = x"00000100") then
report "master_test_program: Read correct data (1) at address (1)";
else
report "master_test_program: Expected data (1) at address 1, but got
" & integer'image(to_integer(data_words(31 downto 0)));
end if;

--Read data from address 2.
create_read_transaction(2, tr_id, index, axi_tr_if_0(index));
set_id(2, tr_id, index, axi_tr_if_0(index));
execute_transaction(tr_id, index, axi_tr_if_0(index));

get_data_words(data_words, tr_id, index, axi_tr_if_0(index));
if(data_words(31 downto 0) = x"00020000") then
report "master_test_program: Read correct data (2) at address (2)";
else
report "master_test_program: Expected data (2) at address 2, but got
" & integer'image(to_integer(data_words(31 downto 0)));
end if;

--Read data from address 3.
create_read_transaction(3, tr_id, index, axi_tr_if_0(index));
set_id(3, tr_id, index, axi_tr_if_0(index));
execute_transaction(tr_id, index, axi_tr_if_0(index));

get_data_words(data_words, tr_id, index, axi_tr_if_0(index));
if(data_words(31 downto 0) = x"03000000") then
report "master_test_program: Read correct data (3) at address (3)";
else
report "master_test_program: Expected data (3) at address 3, but got
" & integer'image(to_integer(data_words(31 downto 0)));
end if;

--Read data from address 4.
create_read_transaction(4, tr_id, index, axi_tr_if_0(index));
set_id(4, tr_id, index, axi_tr_if_0(index));
execute_transaction(tr_id, index, axi_tr_if_0(index));

get_data_words(data_words, tr_id, index, axi_tr_if_0(index));
if(data_words(31 downto 0) = x"00000004") then
report "master_test_program: Read correct data (4) at address (4)";
else
report "master_test_program: Expected data (4) at address 4, but got
" & integer'image(to_integer(data_words(31 downto 0)));
end if;

Advertising