Commit d8adb167 authored by Ille, Ondrej, Ing.'s avatar Ille, Ondrej, Ing.

test: Use common function for moving out of Integration phase.

parent 5785c7c4
......@@ -137,8 +137,6 @@ package body message_filter_feature is
o.outcome := true;
CAN_generate_frame(rand_ctr, CAN_frame);
CAN_frame.brs := '0';
wait_rand_cycles(rand_ctr, mem_bus(1).clk_sys, 1600, 1601);
------------------------------------------------------------------------
-- Part 1 (Message filters disabled)
......
......@@ -92,14 +92,6 @@ package body overload_feature is
begin
o.outcome := true;
------------------------------------------------------------------------
-- Wait until unit comes out of integration. This is to make sure
-- that first frame will be transmitted and not that transition to
-- "interframe" will be from "off", directly after integration! This
-- transition goes directly to "interm_idle" and bit is correctly
-- interpreted as SOF and not Overload flag!
------------------------------------------------------------------------
wait_rand_cycles(rand_ctr, mem_bus(1).clk_sys, 2500, 3000);
------------------------------------------------------------------------
-- Generate CAN Frame and start transmission
......
......@@ -431,6 +431,10 @@ begin
CAN_enable_retr_limit(true, 0, ID_1, mem_bus(1));
CAN_enable_retr_limit(true, 0, ID_2, mem_bus(2));
-- Wait till integration is over!
CAN_wait_bus_on(ID_1, mem_bus(1));
CAN_wait_bus_on(ID_2, mem_bus(2));
info("RETR limit set");
-------------------------------------------------
-- Main test loop
......
......@@ -88,14 +88,6 @@ package body timestamp_options_feature is
begin
o.outcome := true;
------------------------------------------------------------------------
-- If this is the only test, wait until controller will come out
-- of integration phase!
------------------------------------------------------------------------
for i in 0 to 1700 loop
wait until rising_edge(mem_bus(1).clk_sys);
end loop;
------------------------------------------------------------------------
-- Configure timestamp options to the begining of CAN Frame.
------------------------------------------------------------------------
......
......@@ -108,10 +108,6 @@ package body tx_arb_time_tran_feature is
o.outcome := true;
------------------------------------------------------------------------
-- Wait until unit for sure comes out of integration.
------------------------------------------------------------------------
wait_rand_cycles(rand_ctr, mem_bus(1).clk_sys, 1600, 1601);
------------------------------------------------------------------------
-- Part 1
......
......@@ -107,10 +107,6 @@ package body txt_buffer_hazard_feature is
begin
o.outcome := true;
-- Wait till Integration phase is over
for i in 0 to 3000 loop
wait until rising_edge(mem_bus(1).clk_sys);
end loop;
-- Generate CAN frame
CAN_generate_frame(rand_ctr, CAN_frame);
......
......@@ -137,7 +137,6 @@ package body txtb_state_feature is
CAN_generate_frame(rand_ctr, CAN_frame);
CAN_frame.rtr := RTR_FRAME;
CAN_frame.frame_format := NORMAL_CAN;
wait_rand_cycles(rand_ctr, mem_bus(1).clk_sys, 1600, 1601);
CAN_enable_retr_limit(false, 0, ID_1, mem_bus(1));
for i in 1 to C_TXT_BUFFER_COUNT loop
......
......@@ -1395,6 +1395,21 @@ package CANtestLib is
signal mem_bus : inout Avalon_mem_type
);
----------------------------------------------------------------------------
-- Wait until a Node is in Error Active state! Actively polls on Fault state
-- register. Can be used after enabling CAN node to wait till integration
-- field is over!
--
-- Arguments:
-- ID Index of CTU CAN FD Core instance
-- mem_bus Avalon memory bus to execute the access on.
----------------------------------------------------------------------------
procedure CAN_wait_bus_on(
constant ID : in natural range 0 to 15;
signal mem_bus : inout Avalon_mem_type
);
----------------------------------------------------------------------------
-- Calculate length of CAN Frame in bits (stuff bits not included).
......@@ -3642,6 +3657,19 @@ package body CANtestLib is
end loop;
end procedure;
procedure CAN_wait_bus_on(
constant ID : in natural range 0 to 15;
signal mem_bus : inout Avalon_mem_type
)is
variable fault_state : SW_fault_state;
begin
get_fault_state(fault_state, ID, mem_bus);
while (fault_state /= fc_error_active) loop
get_fault_state(fault_state, ID, mem_bus);
end loop;
end procedure;
procedure CAN_calc_frame_length(
......
Markdown is supported
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