Commit e5f01c39 authored by Martin Jeřábek's avatar Martin Jeřábek
Browse files

testfw: feature tests overhaul: wip

parent 3e8e8e64
......@@ -72,6 +72,7 @@ package abort_transmittion_feature is
procedure abort_transmittion_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......@@ -85,6 +86,7 @@ package body abort_transmittion_feature is
procedure abort_transmittion_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......
......@@ -84,6 +84,7 @@ use work.CAN_FD_frame_format.all;
package arbitration_feature is
procedure arbitration_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......@@ -95,6 +96,7 @@ end package;
package body Arbitration_feature is
procedure arbitration_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......
......@@ -61,6 +61,7 @@ use work.CAN_FD_register_map.all;
package fault_confinement_feature is
procedure fault_confinement_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......@@ -72,6 +73,7 @@ end package;
package body fault_confinement_feature is
procedure fault_confinement_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......
......@@ -76,6 +76,7 @@ use work.CAN_FD_frame_format.all;
package forbid_fd_feature is
procedure forbid_fd_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......@@ -88,6 +89,7 @@ package body forbid_fd_feature is
procedure forbid_fd_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......
......@@ -85,6 +85,7 @@ use work.CAN_FD_frame_format.all;
package interrupt_feature is
procedure interrupt_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......@@ -96,6 +97,7 @@ end package;
package body interrupt_feature is
procedure interrupt_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......
......@@ -64,6 +64,7 @@ use work.CAN_FD_frame_format.all;
package invalid_configs_feature is
procedure invalid_configs_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......@@ -76,6 +77,7 @@ end package;
package body invalid_configs_feature is
procedure invalid_configs_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......
......@@ -60,6 +60,7 @@ use work.CAN_FD_register_map.all;
package overload_feature is
procedure overload_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......@@ -71,6 +72,7 @@ end package;
package body overload_feature is
procedure overload_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......
......@@ -62,6 +62,7 @@ use work.CAN_FD_frame_format.all;
package retr_limit_feature is
procedure retr_limit_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......@@ -73,6 +74,7 @@ end package;
package body retr_limit_feature is
procedure retr_limit_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......
......@@ -76,37 +76,26 @@ use work.CAN_FD_register_map.all;
use work.CAN_FD_frame_format.all;
package rtr_pref_feature is
procedure rtr_pref_feature_exec(
variable outcome : inout boolean;
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal mem_bus_1 : inout Avalon_mem_type;
signal mem_bus_2 : inout Avalon_mem_type;
signal bus_level : in std_logic;
signal drv_bus_1 : in std_logic_vector(1023 downto 0);
signal drv_bus_2 : in std_logic_vector(1023 downto 0);
signal stat_bus_1 : in std_logic_vector(511 downto 0);
signal stat_bus_2 : in std_logic_vector(511 downto 0);
signal so : out feature_signal_outputs_t
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
signal bus_level : in std_logic
);
end package;
package body rtr_pref_feature is
procedure rtr_pref_feature_exec(
variable outcome : inout boolean;
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal mem_bus_1 : inout Avalon_mem_type;
signal mem_bus_2 : inout Avalon_mem_type;
signal bus_level : in std_logic;
signal drv_bus_1 : in std_logic_vector(1023 downto 0);
signal drv_bus_2 : in std_logic_vector(1023 downto 0);
signal stat_bus_1 : in std_logic_vector(511 downto 0);
signal stat_bus_2 : in std_logic_vector(511 downto 0);
signal so : out feature_signal_outputs_t
)is
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
signal bus_level : in std_logic
) is
variable ID_1 : natural := 1;
variable ID_2 : natural := 2;
variable tx_frame : SW_CAN_frame_type;
......
......@@ -72,6 +72,7 @@ use work.CAN_FD_frame_format.all;
package rx_status_feature is
procedure rx_status_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......@@ -83,6 +84,7 @@ end package;
package body rx_status_feature is
procedure rx_status_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......
......@@ -84,6 +84,7 @@ use work.CAN_FD_register_map.all;
package spec_mode_feature is
procedure spec_mode_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......@@ -95,6 +96,7 @@ end package;
package body spec_mode_feature is
procedure spec_mode_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......
......@@ -100,7 +100,7 @@ entity CAN_feature_test is
signal rand_ctr : in natural range 0 to RAND_POOL_SIZE;
--CAN bus signals
signal bus_level : in std_logic := RECESSIVE;
signal bus_level : out std_logic := RECESSIVE;
--Test name to be loaded by the TCL script from TCL test FIFO
--Note that string always have to have fixed length
......@@ -155,6 +155,8 @@ architecture feature_env_test of CAN_feature_test is
swr => '0',
sbe => (OTHERS => '1')
));
signal s_bus_level : std_logic := RECESSIVE;
begin
g_inst: for i in 1 to 2 generate
......@@ -204,7 +206,8 @@ begin
p(i).tr_del_sr <= p(i).tr_del_sr(254 downto 0) & p(i).CAN_tx;
end process;
p(i).CAN_rx <= bus_level;
p(i).CAN_rx <= s_bus_level;
bus_level <= s_bus_level;
---------------------------------
--Clock generation
......@@ -219,8 +222,8 @@ begin
end process;
end generate;
bus_level <= p(1).tr_del_sr(p(1).tr_del) AND p(2).tr_del_sr(p(2).tr_del) when bl_force=false else
bl_inject;
s_bus_level <= p(1).tr_del_sr(p(1).tr_del) AND p(2).tr_del_sr(p(2).tr_del) when bl_force=false else
bl_inject;
---------------------------------
--Test process listening to the
......@@ -262,12 +265,16 @@ end architecture;
Library ieee;
library vunit_lib;
context vunit_lib.vunit_context;
USE IEEE.std_logic_1164.all;
USE IEEE.numeric_std.ALL;
USE ieee.math_real.ALL;
use work.CANconstants.all;
USE work.CANtestLib.All;
USE work.randomLib.All;
use work.pkg_feature_exec_dispath.all;
entity tb_feature is
generic (
......@@ -381,7 +388,7 @@ begin
test:process
constant ID_1 : natural range 0 to 15 := 1;
constant ID_2 : natural range 0 to 15 := 2;
variable outputs : feature_outputs_t;
variable o : feature_outputs_t;
begin
test_runner_setup(runner, runner_cfg);
--Set the process to run and wait until it comes out of reset
......
......@@ -68,6 +68,7 @@ use work.CAN_FD_register_map.all;
package traf_meas_feature is
procedure traf_meas_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......@@ -80,6 +81,7 @@ end package;
package body traf_meas_feature is
procedure traf_meas_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......
......@@ -68,6 +68,7 @@ use work.CAN_FD_frame_format.all;
package tran_delay_feature is
procedure tran_delay_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......@@ -80,6 +81,7 @@ end package;
package body tran_delay_feature is
procedure tran_delay_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......
......@@ -77,6 +77,7 @@ use work.CAN_FD_register_map.all;
package tx_arb_time_tran_feature is
procedure tx_arb_time_tran_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......@@ -88,6 +89,7 @@ end package;
package body tx_arb_time_tran_feature is
procedure tx_arb_time_tran_feature_exec(
variable o : out feature_outputs_t;
signal so : out feature_signal_outputs_t;
signal rand_ctr : inout natural range 0 to RAND_POOL_SIZE;
signal iout : in instance_inputs_arr_t;
signal mem_bus : inout mem_bus_arr_t;
......
......@@ -37,15 +37,9 @@ begin
{{ test }}_feature_exec(
o => o,
rand_ctr => rand_ctr,
mem_bus_1 => mem_bus(1),
mem_bus_2 => mem_bus(2),
int_1 => iout(1).irq,
int_2 => iout(2).irq,
mem_bus => mem_bus,
iout => iout,
bus_level => bus_level,
drv_bus_1 => iout(1).drv_bus,
drv_bus_2 => iout(2).drv_bus,
stat_bus_1 => iout(1).stat_bus,
stat_bus_2 => iout(2).stat_bus,
so => so
);
{% endfor %}
......
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