Commit 105281e3 authored by Michael Munch's avatar Michael Munch
Browse files

Correct logic for leaving timeout

parent 253d88fc
Pipeline #25777 failed with stage
in 28 seconds
......@@ -55,6 +55,8 @@ architecture tb of tb_vme_bus is
signal vme_ds_n_dir : std_logic;
signal vme_berr_n_i : std_logic;
signal vme_berr_n_o : std_logic;
signal vme_berr_n_dir : std_logic;
-- Request bus
signal vme_br_n_o : std_logic_vector(3 downto 0);
......@@ -812,7 +814,72 @@ begin
check_equal(vme_data_o(31 downto 0), int_data_i(31 downto 0));
check_equal(vme_ds_n_o, unsigned'(B"00"));
elsif run("if no slave ack is received, then BERR is fired") then
vme_dtack_n_i <= '1';
vme_berr_n_i <= '1';
int_vme_rw <= c_VME_READ;
int_am_i <= c_AM_A24_DATA;
int_addr <= (others => '0');
wait for 20 ns;
check_equal(vme_addr_dir, c_PIN_OUT);
check_equal(vme_am_dir, c_PIN_OUT);
check_equal(vme_iack_n_dir, c_PIN_OUT);
check_equal(vme_addr_o, int_addr);
check_equal(vme_as_n_dir, c_PIN_IN);
wait for 40 ns;
check_equal(vme_ds_n_dir, c_PIN_OUT);
check_equal(vme_ds_n_o, unsigned'(B"00"));
-- Simulate stuck bus.
vme_ds_n_i <= "00";
wait for 2750 ns;
check_equal(vme_berr_n_dir, c_PIN_OUT);
check_equal(vme_berr_n_o, '0');
check_equal(int_err_code, c_ERR_TIMEOUT);
elsif run("only exist timeout when strobes are released") then
vme_dtack_n_i <= '1';
vme_berr_n_i <= '1';
int_vme_rw <= c_VME_READ;
int_am_i <= c_AM_A24_DATA;
int_addr <= (others => '0');
wait for 20 ns;
check_equal(vme_addr_dir, c_PIN_OUT);
check_equal(vme_am_dir, c_PIN_OUT);
check_equal(vme_iack_n_dir, c_PIN_OUT);
check_equal(vme_addr_o, int_addr);
check_equal(vme_as_n_dir, c_PIN_IN);
wait for 40 ns;
check_equal(vme_ds_n_dir, c_PIN_OUT);
check_equal(vme_ds_n_o, unsigned'(B"00"));
-- Simulate stuck bus.
vme_ds_n_i <= "00";
wait for 2750 ns;
check_equal(vme_berr_n_dir, c_PIN_OUT);
check_equal(vme_berr_n_o, '0');
check_equal(int_err_code, c_ERR_TIMEOUT);
-- Release bus
vme_ds_n_i <= "11";
wait for 10 ns;
check_equal(vme_berr_n_o, '0');
wait for 10 ns;
check_equal(vme_berr_n_o, '0');
wait for 10 ns;
check_equal(vme_berr_n_o, '0');
wait for 10 ns;
check_equal(vme_berr_n_o, '1');
end if;
end loop;
......@@ -821,7 +888,7 @@ begin
end process;
clk <= not clk after 5 ns;
test_runner_watchdog(runner, 250 ns);
test_runner_watchdog(runner, 5000 ns);
dut : entity work.vme_data_bus
generic map (
......@@ -871,6 +938,8 @@ begin
vme_ds_n_dir => vme_ds_n_dir,
vme_berr_n_i => vme_berr_n_i,
vme_berr_n_o => vme_berr_n_o,
vme_berr_n_dir => vme_berr_n_dir,
-- Request bus
vme_br_n_o => vme_br_n_o,
......
......@@ -686,6 +686,8 @@ begin
vme_as_n_dir <= c_PIN_IN;
vme_as_n_o <= '1';
vme_dtack_n_dir <= c_PIN_IN;
-- Data present (error)
int_data_strobe <= c_DATA_PRESENT;
int_err_code <= (
......@@ -705,9 +707,9 @@ begin
-- AS, DS or DTACK before we consider leaving
-- TIMEOUT state.
if (vme_ds_n_i /= "00" or
vme_as_n_i /= '0' or
vme_dtack_n_i /= '0') then
if (vme_ds_n_i = "00" or
vme_as_n_i = '0' or
vme_dtack_n_i = '0') then
-- Someone is still holding a strobe.
n_wait <= c_N_TIMEOUT_WAIT;
elsif (n_wait = 0) then
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment