Commit 5aec501b authored by Ille, Ondrej, Ing.'s avatar Ille, Ondrej, Ing.

Added Coverage exclusion to feature tests.

parent 1222a816
......@@ -175,7 +175,10 @@ package body abort_transmittion_feature is
get_controller_status(status, ID_1, mem_bus(1));
if (status.transmitter) then
-- LCOV_EXCL_START
o.outcome := false;
report "Unit did not abort the transmission!" severity error;
-- LCOV_EXCL_STOP
end if;
--------------------------------------------------------------------
......@@ -207,7 +210,10 @@ package body abort_transmittion_feature is
--------------------------------------------------------------------
get_controller_status(status, ID_1, mem_bus(1));
if (not status.bus_status) then
-- LCOV_EXCL_START
report "Unit is not Idle!" severity error;
o.outcome := false;
-- LCOV_EXCL_STOP
end if;
end if;
......
......@@ -315,6 +315,7 @@ package body Arbitration_feature is
if (unit_rec = 1 and exp_winner = 0) or
(unit_rec = 2 and exp_winner = 1)
then
-- LCOV_EXCL_START
report "Wrong unit lost arbitration. Expected: " &
integer'image(exp_winner) & " Real: " & integer'image(unit_rec)
severity error;
......@@ -325,6 +326,7 @@ package body Arbitration_feature is
CAN_print_frame(frame_2, info_l);
o.outcome := false;
-- LCOV_EXCL_STOP
end if;
------------------------------------------------------------------------
......@@ -349,6 +351,7 @@ package body Arbitration_feature is
-- If error frame is transmitted and collision not have appeared
------------------------------------------------------------------------
if (unit_rec = 3 and exp_winner /= 2) then
-- LCOV_EXCL_START
report "Collision should have appeared" severity error;
report "Frame 1:";
......@@ -357,6 +360,7 @@ package body Arbitration_feature is
CAN_print_frame(frame_2, info_l);
o.outcome := false;
-- LCOV_EXCL_STOP
end if;
wait for 100000 ns;
......
......@@ -79,10 +79,10 @@ package body byte_enable_feature is
signal bus_level : in std_logic
) is
variable data : std_logic_vector(31 downto 0) :=
(OTHERS => '0');
variable address : std_logic_vector(11 downto 0) :=
(OTHERS => '0');
variable ID : natural := 1;
(OTHERS => '0');
variable address : std_logic_vector(11 downto 0) :=
(OTHERS => '0');
variable ID : natural := 1;
begin
o.outcome := true;
......@@ -93,8 +93,10 @@ package body byte_enable_feature is
CAN_read(data, address, ID, mem_bus(1), BIT_32);
if (data /= x"DEADBEEF") then
-- LCOV_EXCL_START
o.outcome := false;
report "32 bit read error" severity error;
-- LCOV_EXCL_STOP
end if;
------------------------------------------------------------------------
......@@ -110,16 +112,20 @@ package body byte_enable_feature is
if (data(16 * i + 15 downto 16 * i) /=
YOLO_VAL_RSTVAL(16 * i + 15 downto 16 * i))
then
-- LCOV_EXCL_START
report "16 bit read error (valid byte), Index :" &
Integer'image(i) severity error;
o.outcome := false;
-- LCOV_EXCL_STOP
end if;
-- Checking invalid 2 bytes are 0
if (data(16 * (1 - i) + 15 downto 16 * (1 - i)) /= x"0000") then
-- LCOV_EXCL_START
report "16 bit read error (empty byte), Index :" &
Integer'image(i) severity error;
o.outcome := false;
-- LCOV_EXCL_STOP
end if;
end loop;
......@@ -136,39 +142,49 @@ package body byte_enable_feature is
if (data(8 * i + 7 downto 8 * i) /=
YOLO_VAL_RSTVAL(8 * i + 7 downto 8 * i))
then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit read error (valid byte), Index :" &
Integer'image(i) severity error;
Integer'image(i) severity error;
-- LCOV_EXCL_STOP
end if;
-- Checking if other bytes are 0
case i is
when 0 =>
if (data(31 downto 8) /= x"000000") then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit read error (Empty byte 0)" severity error;
-- LCOV_EXCL_STOP
end if;
when 1 =>
if (data(31 downto 16) /= x"0000" or
data(7 downto 0) /= x"00")
then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit read error (Empty byte 1)" severity error;
-- LCOV_EXCL_STOP
end if;
when 2 =>
if (data(31 downto 24) /= x"00" or
data(15 downto 0) /= x"0000")
then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit read error (Empty byte 2)" severity error;
-- LCOV_EXCL_STOP
end if;
when 3 =>
if (data(23 downto 0) /= x"000000") then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit read error (Empty byte 3)" severity error;
-- LCOV_EXCL_STOP
end if;
when others =>
report "Invalid byte index" severity error;
report "Invalid byte index" severity error; -- LCOV_EXCL_LINE
end case;
end loop;
......@@ -195,39 +211,49 @@ package body byte_enable_feature is
-- Checking if one written byte was written OK!
if (data(8 * i + 7 downto 8 * i) /= x"0A") then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit write error (valid byte), Index :" &
Integer'image(i) severity error;
Integer'image(i) severity error;
-- LCOV_EXCL_STOP
end if;
-- Checking if other bytes are 0
case i is
when 0 =>
if (data(31 downto 8) /= x"000000") then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit write error (Empty byte 0)" severity error;
-- LCOV_EXCL_STOP
end if;
when 1 =>
if (data(31 downto 16) /= x"0000" or
data(7 downto 0) /= x"00")
then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit write error (Empty byte 1)" severity error;
-- LCOV_EXCL_STOP
end if;
when 2 =>
if (data(31 downto 24) /= x"00" or
data(15 downto 0) /= x"0000")
then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit write error (Empty byte 2)" severity error;
-- LCOV_EXCL_STOP
end if;
when 3 =>
if (data(23 downto 0) /= x"000000") then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit write error (Empty byte 3)" severity error;
-- LCOV_EXCL_STOP
end if;
when others =>
report "Invalid byte index" severity error;
report "Invalid byte index" severity error; -- LCOV_EXCL_LINE
end case;
end loop;
......
......@@ -125,15 +125,20 @@ package body data_length_code_feature is
if (CAN_frame_2.rwcnt /= 5 or
CAN_frame_2.dlc /= CAN_frame.dlc)
then
-- LCOV_EXCL_START
o.outcome := false;
CAN_print_frame(CAN_frame_2, info_l);
report "Invalid DLC received!" severity error;
-- LCOV_EXCL_STOP
end if;
for i in 8 to 63 loop
if (CAN_frame_2.data(i) /= "00000000") then
-- LCOV_EXCL_START
o.outcome := false;
report "Byte index " & integer'image(i) & " not zero!"
severity error;
-- LCOV_EXCL_STOP
end if;
end loop;
......
......@@ -125,11 +125,19 @@ package body fault_confinement_feature is
get_fault_thresholds(fault_th_2, ID_1, mem_bus(1));
if (fault_th.ewl /= fault_th_2.ewl) then
-- LCOV_EXCL_START
o.outcome := false;
report "Error warning limit threshold was not set properly!"
severity error;
-- LCOV_EXCL_START
end if;
if (fault_th.erp /= fault_th_2.erp) then
-- LCOV_EXCL_START
o.outcome := false;
report "Error passive threshold was not set properly!"
severity error;
-- LCOV_EXCL_STOP
end if;
------------------------------------------------------------------------
......@@ -141,17 +149,29 @@ package body fault_confinement_feature is
err_counters.rx_counter > 255)
then
if (fault_state /= fc_bus_off) then
-- LCOV_EXCL_START
o.outcome := false;
report "Unit not Bus off as expected!"
severity error;
-- LCOV_EXCL_STOP
end if;
elsif (err_counters.tx_counter < fault_th.ewl and
err_counters.rx_counter < fault_th.ewl)
then
if (fault_state /= fc_error_active) then
-- LCOV_EXCL_START
o.outcome := false;
report "Unit not Error Active as expected!"
severity error;
-- LCOV_EXCL_STOP
end if;
else
if (fault_state /= fc_error_passive) then
-- LCOV_EXCL_START
o.outcome := false;
report "Unit not Error Passive as expected!"
severity error;
-- LCOV_EXCL_STOP
end if;
end if;
......
......@@ -140,7 +140,10 @@ package body forbid_fd_feature is
-- Counter should be increased
if ((err_counters_1.rx_counter + 1 + 8) /= err_counters_2.rx_counter) then
-- LCOV_EXCL_START
o.outcome := false;
report "RX Error counter not incremented as expected!" severity error;
-- LCOV_EXCL_STOP
end if;
------------------------------------------------------------------------
......@@ -161,7 +164,10 @@ package body forbid_fd_feature is
-- detected the error!
------------------------------------------------------------------------
if ((err_counters_1.rx_counter + 8) /= err_counters_2.rx_counter) then
-- LCOV_EXCL_START
o.outcome := false;
report "RX Error counter not incremented as expected!" severity error;
-- LCOV_EXCL_STOP
end if;
------------------------------------------------------------------------
......@@ -188,7 +194,10 @@ package body forbid_fd_feature is
-- zeroes when counter cannnot already be lowered...
------------------------------------------------------------------------
if ((err_counters_1.rx_counter + 7) /= err_counters_2.rx_counter) then
-- LCOV_EXCL_START
o.outcome := false;
report "RX Error counter not decremented as expected!" severity error;
-- LCOV_EXCL_STOP
end if;
------------------------------------------------------------------------
......
......@@ -168,7 +168,10 @@ package body interrupt_feature is
------------------------------------------------------------------------
read_int_status(int_stat, ID_1, mem_bus(1));
if (not int_stat.receive_int) then
-- LCOV_EXCL_START
o.outcome := false;
report "RX Interrupt not present!" severity error;
-- LCOV_EXCL_STOP
end if;
clear_int_status(int_stat, ID_1, mem_bus(1));
......@@ -210,14 +213,19 @@ package body interrupt_feature is
------------------------------------------------------------------------
read_int_status(int_stat, ID_1, mem_bus(1));
if (not int_stat.bus_error_int) then
-- LCOV_EXCL_START
o.outcome := false;
report "Bus error Interrput not present (Node 1)" severity error;
-- LCOV_EXCL_STOP
end if;
clear_int_status(int_stat, ID_1, mem_bus(1));
read_int_status(int_stat, ID_2, mem_bus(2));
if (not int_stat.bus_error_int) then
report "FUCK" severity error;
-- LCOV_EXCL_START
report "Bus error Interrupt no present (Node 2)" severity error;
o.outcome := false;
-- LCOV_EXCL_STOP
end if;
CAN_wait_frame_sent(ID_1, mem_bus(1));
clear_int_status(int_stat, ID_2, mem_bus(2));
......@@ -263,7 +271,11 @@ package body interrupt_feature is
-- fired and clear it!
if (i = (buf_info.rx_buff_size / 4)) then
if (iout(2).irq = '0') then
-- LCOV_EXCL_START
report "RX Buffer Full interrupt is not active!"
severity error;
o.outcome := false;
-- LCOV_EXCL_STOP
else
read_int_status(int_stat, ID_2, mem_bus(2));
clear_int_status(int_stat, ID_2, mem_bus(2));
......@@ -278,10 +290,17 @@ package body interrupt_feature is
read_int_status(int_stat, ID_2, mem_bus(2));
if (not int_stat.rx_buffer_full_int) then
-- LCOV_EXCL_START
o.outcome := false;
report "RX Buffer Full Interrupt not present!" severity error;
-- LCOV_EXCL_STOP
end if;
if (not int_stat.data_overrun_int) then
-- LCOV_EXCL_START
o.outcome := false;
report "Data overrun Interrupt not present!" severity error;
-- LCOV_EXCL_STOP
end if;
clear_int_status(int_stat, ID_2, mem_bus(2));
wait for 30000 ns;
......@@ -315,7 +334,10 @@ package body interrupt_feature is
------------------------------------------------------------------------
read_int_status(int_stat, ID_2, mem_bus(2));
if (not int_stat.bit_rate_shift_int) then
-- LCOV_EXCL_START
o.outcome := false;
report "Bit Rate shift interrupt not present" severity error;
-- LCOV_EXCL_STOP
end if;
CAN_wait_frame_sent(ID_2,mem_bus(2));
clear_int_status(int_stat, ID_2, mem_bus(2));
......@@ -348,7 +370,10 @@ package body interrupt_feature is
read_int_status(int_stat, ID_1, mem_bus(1));
if (not int_stat.arb_lost_int) then
-- LCOV_EXCL_START
o.outcome := false;
report "Arbitration Lost Interrupt not present!" severity error;
-- LCOV_EXCL_STOP
end if;
clear_int_status(int_stat, ID_1, mem_bus(1));
......
......@@ -115,7 +115,11 @@ package body invalid_configs_feature is
------------------------------------------------------------------------
CAN_read_frame(rx_frame, ID_2, mem_bus(2));
if (rx_frame.brs = BR_SHIFT or rx_frame.frame_format = FD_CAN) then
-- LCOV_EXCL_START
o.outcome := false;
report "Frame with BRS Bit or CAN FD Frame received!"
severity error;
-- LCOV_EXCL_STOP
end if;
......@@ -136,12 +140,18 @@ package body invalid_configs_feature is
CAN_send_frame(tx_frame, 1, ID_1, mem_bus(1), frame_sent);
CAN_wait_frame_sent(ID_1, mem_bus(1));
wait for 100 ns;
------------------------------------------------------------------------
-- Read frame. CAN FD Frame without RTR bit should be read
------------------------------------------------------------------------
CAN_read_frame(rx_frame, ID_2, mem_bus(2));
if (rx_frame.frame_format = NORMAL_CAN or rx_frame.rtr = RTR_FRAME) then
-- LCOV_EXCL_START
o.outcome := false;
report "CAN 2.0 Frame or RTR Flag Frame received!"
severity error;
-- LCOV_EXCL_STOP
end if;
end procedure;
......
......@@ -128,8 +128,10 @@ package body overload_feature is
iout(1).stat_bus(STAT_PC_STATE_HIGH downto STAT_PC_STATE_LOW)))) /=
overload)
then
report "Overload did not start";
-- LCOV_EXCL_START
report "Overload Frame did not start" severity error;
o.outcome:=false;
-- LCOV_EXCL_STOP
end if;
so.bl_inject <= RECESSIVE;
......
......@@ -138,14 +138,18 @@ package body retr_limit_feature is
get_tx_buf_state(1, buf_state, ID_1, mem_bus(1));
if (i /= retr_th) then
if (buf_state /= buf_ready) then
report "Buffer not ready";
-- LCOV_EXCL_START
report "TXT Buffer not ready" severity error;
o.outcome := false;
exit;
-- LCOV_EXCL_STOP
end if;
else
if (buf_state /= buf_failed) then
report "Buffer not failed";
-- LCOV_EXCL_START
report "TXT Buffer not failed" severity error;
o.outcome := false;
-- LCOV_EXCL_STOP
end if;
end if;
end loop;
......@@ -156,9 +160,12 @@ package body retr_limit_feature is
------------------------------------------------------------------------
read_error_counters(err_counters, ID_1, mem_bus(1));
if (err_counters.tx_counter /= 8 * (retr_th + 1)) then
-- LCOV_EXCL_START
report "Counters exp: " & Integer'Image(err_counters.tx_counter) &
" coutners real: " & Integer'image(8 * (retr_th + 1));
" coutners real: " & Integer'image(8 * (retr_th + 1))
severity error;
o.outcome := false;
-- LCOV_EXCL_STOP
end if;
------------------------------------------------------------------------
......
......@@ -138,7 +138,11 @@ package body rtr_pref_feature is
------------------------------------------------------------------------
CAN_send_frame(tx_frame, 1, ID_1, mem_bus(1), frame_sent);
if (not frame_sent) then
-- LCOV_EXCL_START
o.outcome := false;
report "Frame was not inserted for transmission properly!"
severity error;
-- LCOV_EXCL_STOP
end if;
CAN_wait_frame_sent(ID_2, mem_bus(2));
......@@ -147,7 +151,11 @@ package body rtr_pref_feature is
------------------------------------------------------------------------
CAN_read_frame(rx_frame, ID_2, mem_bus(2));
if (rx_frame.dlc /= x"0") then
-- LCOV_EXCL_START
o.outcome := false;
report "DLC of Received frame is not zero as expected"
severity error;
-- LCOV_EXCL_STOP
end if;
......@@ -173,7 +181,11 @@ package body rtr_pref_feature is
------------------------------------------------------------------------
CAN_send_frame(tx_frame, 1, ID_1, mem_bus(1), frame_sent);
if (not frame_sent) then
-- LCOV_EXCL_START
o.outcome := false;
report "Frame was not inserted for transmission properly!"
severity error;
-- LCOV_EXCL_STOP
end if;
CAN_wait_frame_sent(ID_2, mem_bus(2));
......@@ -182,7 +194,10 @@ package body rtr_pref_feature is
------------------------------------------------------------------------
CAN_read_frame(rx_frame, ID_2, mem_bus(2));
if (rx_frame.dlc /= tx_frame.dlc) then
-- LCOV_EXCL_START
o.outcome := false;
report "TX DLC is not equal to RX DLC" severity error;
-- LCOV_EXCL_STOP
end if;
end procedure;
......
......@@ -120,14 +120,22 @@ package body rx_status_feature is
-- Check that buffer is empty
------------------------------------------------------------------------
if (not buf_info.rx_empty) then
-- LCOV_EXCL_START
o.outcome := false;
report "RX Buffer is not empty after Release receive Buffer command"
severity error;
-- LCOV_EXCL_STOP
end if;
------------------------------------------------------------------------
-- Check that free memory is equal to buffer size
------------------------------------------------------------------------
if (buf_info.rx_buff_size /= buf_info.rx_mem_free) then
-- LCOV_EXCL_START
report "Number of free words in RX Buffer after Release Receive " &
"Buffer command is not equal to buffer size" severity error;
o.outcome := false;
-- LCOV_EXCL_STOP
end if;
------------------------------------------------------------------------
......@@ -137,7 +145,11 @@ package body rx_status_feature is
if (buf_info.rx_frame_count /= 0 or buf_info.rx_write_pointer /= 0 or
buf_info.rx_read_pointer /= 0)
then
-- LCOV_EXCL_START
o.outcome := false;
report "RX Buffer pointers are not 0 after Release Receieve Buffer" &
" command" severity error;
-- LCOV_EXCL_START
end if;
------------------------------------------------------------------------
......@@ -179,12 +191,20 @@ package body rx_status_feature is
--------------------------------------------------------------------
get_rx_buf_state(buf_info, ID_1, mem_bus(1));
if (number_frms_sent /= buf_info.rx_frame_count and send_more) then
-- LCOV_EXCL_START
o.outcome := false;
report "Number of frames in RX Buffer not incremented"
severity error;
-- LCOV_EXCL_STOP
end if;
if ((buf_info.rx_mem_free + in_RX_buf) /= buf_info.rx_buff_size
and send_more)
then
-- LCOV_EXCL_START
o.outcome := false;
report "RX Buffer free memory + Number of stored words does "
"not equal to RX Buffer size!" severity error;
-- LCOV_EXCL_STOP
end if;
end loop;
......@@ -195,7 +215,10 @@ package body rx_status_feature is
------------------------------------------------------------------------
get_controller_status(status, ID_1, mem_bus(1));
if (not status.data_overrun) then
-- LCOV_EXCL_START
o.outcome := false;
report "Data overrun not ocurred as expected!" severity error;
-- LCOV_EXCL_STOP
end if;
------------------------------------------------------------------------
......@@ -210,7 +233,10 @@ package body rx_status_feature is
------------------------------------------------------------------------
get_controller_status(status, ID_1, mem_bus(1));
if (status.data_overrun) then
-- LCOV_EXCL_START
o.outcome := false;
report "Data Overrun flag not active!" severity error;
-- LCOV_EXCL_STOP
end if;
end procedure;
......
......@@ -170,7 +170,11 @@ package body spec_mode_feature is
loop
wait until rising_edge(mem_bus(1).clk_sys);
if (bus_level = DOMINANT) then
-- LCOV_EXCL_START
o.outcome := false;
report "ACK detected when there should be no ACK!"
severity error;
-- LCOV_EXCL_STOP
end if;
end loop;
......@@ -183,11 +187,19 @@ package body spec_mode_feature is
read_traffic_counters(ctr_2_2, ID_2, mem_bus(2));
if (ctr_1_1.tx_frames + 1 /= ctr_2_1.tx_frames) then
-- LCOV_EXCL_START
o.outcome := false;
report "TX Frames counter incremented unexpectedly!"
severity error;
-- LCOV_EXCL_STOP
end if;
if (ctr_1_2.rx_frames + 1 /= ctr_2_2.rx_frames) then
-- LCOV_EXCL_START
o.outcome := false;
report "RX Frames counter incremented unexpectedly!"
severity error;
-- LCOV_EXCL_STOP
end if;
......@@ -252,11 +264,19 @@ package body spec_mode_feature is
read_traffic_counters(ctr_2_2, ID_2, mem_bus(2));
if (ctr_1_1.tx_frames + 2 /= ctr_2_1.tx_frames) then
-- LCOV_EXCL_START
o.outcome := false;
report "TX Frames counter incremented unexpectedly!"
severity error;