Altera Mentor Verification IP Altera Edition AMBA AXI4-Lite User Manual

Page 398

Advertising
background image

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

398

VHDL Test Programs
AXI4-Lite VHDL Master BFM Test Program

April 2014

--///////////////////////////////////////////////
-- Code user could edit according to requirements
--///////////////////////////////////////////////

-- Variable : m_wr_resp_phase_ready_delay
signal m_wr_resp_phase_ready_delay :integer := 2;

-- Variable : m_rd_data_phase_ready_delay
signal m_rd_data_phase_ready_delay : integer := 2;
begin

-- Master test
process
variable tr_id: integer;
variable data_words : std_logic_vector(AXI4_MAX_BIT_SIZE-1
downto 0);
variable lp: line;
begin
wait_on(AXI4_RESET_0_TO_1, index, axi4_tr_if_0(index));
wait_on(AXI4_CLOCK_POSEDGE, index, axi4_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, axi4_tr_if_0(index));
data_words(31 downto 0) := x"00000100";
set_data_words(data_words, tr_id, index, axi4_tr_if_0(index));
set_write_strobes(2, tr_id, index, axi4_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, axi4_tr_if_0(index));


-- Write data value 2 on byte lane 2 to address 2.
create_write_transaction(2, tr_id, index, axi4_tr_if_0(index));
data_words(31 downto 0) := x"00020000";
set_data_words(data_words, tr_id, index, axi4_tr_if_0(index));
set_write_strobes(4, tr_id, index, axi4_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, axi4_tr_if_0(index));

-- Write data value 3 on byte lane 3 to address 3.
create_write_transaction(3, tr_id, index, axi4_tr_if_0(index));
data_words(31 downto 0) := x"03000000";
set_data_words(data_words, tr_id, index, axi4_tr_if_0(index));
set_write_strobes(8, tr_id, index, axi4_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, axi4_tr_if_0(index));

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

Advertising