Commit 648a4ba8 authored by Ille, Ondrej, Ing.'s avatar Ille, Ondrej, Ing.

test: Add test mode to SW_mode

parent deb91ca4
......@@ -98,9 +98,7 @@ package body bus_start_feature is
variable ID_2 : natural := 2;
variable CAN_frame : SW_CAN_frame_type;
variable frame_sent : boolean := false;
variable mode : SW_mode := (false, false, false,
false, true, false,
false, false, false);
variable mode : SW_mode := SW_mode_rst_val;
variable rx_state : SW_RX_Buffer_info;
begin
o.outcome := true;
......
......@@ -98,9 +98,7 @@ package body forbid_fd_feature is
variable ID_1 : natural := 1;
variable ID_2 : natural := 2;
variable mode : SW_mode := (false, false, false,
false, false, false, false,
false, false);
variable mode : SW_mode := SW_mode_rst_val;
variable err_counters_1 : SW_error_counters;
variable err_counters_2 : SW_error_counters;
begin
......
......@@ -130,9 +130,7 @@ package body int_rx_feature is
variable int_ena : SW_interrupts := SW_interrupts_rst_val;
variable int_stat : SW_interrupts := SW_interrupts_rst_val;
variable command : SW_command := (false, false, false);
variable mode : SW_mode := (false, false, false,
false, true, false, false, false,
false);
variable mode : SW_mode := SW_mode_rst_val;
variable buf_info : SW_RX_Buffer_info;
variable pc_dbg : SW_PC_Debug;
begin
......
......@@ -132,9 +132,7 @@ package body int_tx_feature is
variable int_ena : SW_interrupts := SW_interrupts_rst_val;
variable int_stat : SW_interrupts := SW_interrupts_rst_val;
variable command : SW_command := (false, false, false);
variable mode : SW_mode := (false, false, false,
false, true, false, false, false,
false);
variable mode : SW_mode := SW_mode_rst_val;
variable buf_info : SW_RX_Buffer_info;
variable pc_dbg : SW_PC_Debug;
begin
......
......@@ -117,9 +117,7 @@ package body message_filter_feature is
variable ID_2 : natural := 2;
variable CAN_frame : SW_CAN_frame_type;
variable frame_sent : boolean := false;
variable mode : SW_mode := (false, false, false,
false, true, false,
false, false, true);
variable mode : SW_mode := SW_mode_rst_val;
variable rx_state : SW_RX_Buffer_info;
variable mask_filt_config : SW_CAN_mask_filter_config :=
(0, 0, '0', false, false);
......
......@@ -89,10 +89,7 @@ package body retr_limit_feature is
variable retr_th : natural;
variable mode_backup : std_logic_vector(31 downto 0) :=
(OTHERS => '0');
variable mode : SW_mode := (false, false, false,
false, true, false,
false, false, false);
variable mode : SW_mode := SW_mode_rst_val;
variable err_counters : SW_error_counters := (0, 0, 0, 0);
variable buf_state : SW_TXT_Buffer_state_type;
begin
......
......@@ -104,9 +104,7 @@ package body spec_mode_feature is
variable ID_2 : natural := 2;
variable CAN_frame : SW_CAN_frame_type;
variable frame_sent : boolean := false;
variable mode : SW_mode := (false, false, false,
false, true, false,
false, false, false);
variable mode : SW_mode := SW_mode_rst_val;
variable ctr_1_1 : SW_traffic_counters;
variable ctr_1_2 : SW_traffic_counters;
variable ctr_2_1 : SW_traffic_counters;
......
......@@ -117,9 +117,7 @@ package body txtb_state_feature is
variable ID_2 : natural := 2;
variable CAN_frame : SW_CAN_frame_type;
variable frame_sent : boolean := false;
variable mode : SW_mode := (false, false, false,
false, true, false,
false, false, false);
variable mode : SW_mode := SW_mode_rst_val;
variable rx_state : SW_RX_Buffer_info;
variable txt_state : SW_TXT_Buffer_state_type;
variable error_counters : SW_error_counters := (0, 0, 0, 0);
......
......@@ -146,6 +146,7 @@ package CANtestLib is
type SW_mode is record
reset : boolean;
listen_only : boolean;
test : boolean;
self_test : boolean;
acceptance_filter : boolean;
flexible_data_rate : boolean;
......@@ -154,7 +155,9 @@ package CANtestLib is
internal_loopback : boolean;
iso_fd_support : boolean;
end record;
constant SW_mode_rst_val : SW_mode := (false, false, false, false, false,
true, false, false, false, false);
-- Controller commands
type SW_command is record
......@@ -3917,6 +3920,10 @@ package body CANtestLib is
if (mode.self_test) then
data(STM_IND) := '1';
end if;
if (mode.test) then
data(TSTM_IND) := '1';
end if;
if (mode.acceptance_filter) then
data(AFM_IND) := '1';
......@@ -3968,6 +3975,7 @@ package body CANtestLib is
mode.flexible_data_rate := false;
mode.rtr_pref := false;
mode.acknowledge_forbidden := false;
mode.test := false;
if (data(RST_IND) = '1') then
mode.reset := true;
......@@ -3992,6 +4000,10 @@ package body CANtestLib is
if (data(ACF_IND) = '1') then
mode.acknowledge_forbidden := true;
end if;
if (data(TSTM_IND) = '1') then
mode.test := true;
end if;
CAN_read(data, SETTINGS_ADR, ID, mem_bus, BIT_8);
......
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