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

Page 752

Advertising
background image

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

732

VHDL AXI3 and AXI4 Test Programs
VHDL AXI3 Master BFM Test Program

September 2013

architecture master_test_program_a of master_test_program is
begin

-- Master test
process
variable tr_id: integer;
variable data_words : std_logic_vector(AXI_MAX_BIT_SIZE-1
downto 0);
begin

wait_on(AXI_RESET_0_TO_1, index, axi_tr_if_0(index));

wait_on(AXI_CLOCK_POSEDGE, index, axi_tr_if_0(index));

-- 4 x Writes
-- Write data value 1 on byte lanes 1 to address 1.
create_write_transaction(1, tr_id, index, axi_tr_if_0(index));
data_words(31 downto 0) := x"00000100";
set_data_words(data_words, tr_id, index, axi_tr_if_0(index));
set_write_strobes(2, tr_id, index, axi_tr_if_0(index));
report "master_test_program: Writing data (1) to address (1)";

-- By default it will run in Blocking mode
execute_transaction(tr_id, index, axi_tr_if_0(index));

-- Write data value 2 on byte lane 2 to address 2.

create_write_transaction(2, tr_id, index, axi_tr_if_0(index));
data_words(31 downto 0) := x"00020000";
set_data_words(data_words, tr_id, index, axi_tr_if_0(index));
set_write_strobes(4, tr_id, index, axi_tr_if_0(index));
report "master_test_program: Writing data (2) to address (2)";

-- By default it will run in Blocking mode
execute_transaction(tr_id, index, axi_tr_if_0(index));

-- Write data value 3 on byte lane 3 to address 3.
create_write_transaction(3, tr_id, index, axi_tr_if_0(index));
data_words(31 downto 0) := x"03000000";
set_data_words(data_words, tr_id, index, axi_tr_if_0(index));
set_write_strobes(8, tr_id, index, axi_tr_if_0(index));
report "master_test_program: Writing data (3) to address (3)";

-- By default it will run in Blocking mode
execute_transaction(tr_id, index, axi_tr_if_0(index));

-- Write data value 4 on byte lane 0 to address 4.
create_write_transaction(4, tr_id, index, axi_tr_if_0(index));
data_words(31 downto 0) := x"00000004";
set_data_words(data_words, tr_id, index, axi_tr_if_0(index));
set_write_strobes(1, tr_id, index, axi_tr_if_0(index));
report "master_test_program: Writing data (4) to address (4)";

-- By default it will run in Blocking mode
execute_transaction(tr_id, index, axi_tr_if_0(index));

Advertising