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

test: Used Vunit Logger

parent fe7d39a9
......@@ -147,7 +147,7 @@ package body abort_transmittion_feature is
PC_State := protocol_type'VAL(to_integer(unsigned(
iout(1).stat_bus(STAT_PC_STATE_HIGH downto STAT_PC_STATE_LOW))));
report "PC State: " & protocol_type'Image(PC_State);
info("PC State: " & protocol_type'Image(PC_State));
if (PC_State = sof or PC_State = arbitration or PC_State = control or
PC_State = data or PC_State = crc)
then
......@@ -155,7 +155,7 @@ package body abort_transmittion_feature is
else
still_tx := false;
end if;
report "Wait end";
info("Wait end");
if still_tx then
......@@ -176,7 +176,7 @@ package body abort_transmittion_feature is
if (status.transmitter) then
-- LCOV_EXCL_START
o.outcome := false;
report "Unit did not abort the transmission!" severity error;
error("Unit did not abort the transmission!");
-- LCOV_EXCL_STOP
end if;
......@@ -210,7 +210,7 @@ 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;
error("Unit is not Idle!");
o.outcome := false;
-- LCOV_EXCL_STOP
end if;
......
......@@ -197,37 +197,37 @@ package body Arbitration_feature is
frame_1.ident_type = frame_2.ident_type)
then
exp_winner := 2;
report "Expecting collision";
info("Expecting collision");
-- CAN 2.0 and CAN FD frames with matching ID will cause collision!
elsif (frame_1.frame_format /= frame_2.frame_format) then
exp_winner := 2;
report "Expecting collision";
info("Expecting collision");
-- Same RTR, but different ident type, IDENT type selects winner!
elsif (frame_1.ident_type = BASE and
frame_2.ident_type = EXTENDED)
then
report "Testing victory of BASE against EXTENDED";
info("Testing victory of BASE against EXTENDED");
exp_winner := 0;
elsif (frame_1.ident_type = EXTENDED and
frame_2.ident_type = BASE)
then
report "Testing victory of BASE against EXTENDED";
info("Testing victory of BASE against EXTENDED");
exp_winner := 1;
-- Same identifiers, different RTRs, RTR always selects winner!
elsif (frame_1.rtr = NO_RTR_FRAME and
frame_2.rtr = RTR_FRAME)
then
report "Testing victory of non RTR against RTR";
info("Testing victory of non RTR against RTR");
exp_winner := 0;
elsif (frame_1.rtr = RTR_FRAME and
frame_2.rtr = NO_RTR_FRAME)
then
report "Testing victory of non RTR against RTR";
info("Testing victory of non RTR against RTR");
exp_winner := 1;
end if;
......@@ -311,14 +311,13 @@ package body Arbitration_feature is
(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;
report "Frame 1:";
info("Frame 1:");
CAN_print_frame(frame_1, info_l);
report "Frame 2:";
info("Frame 2:");
CAN_print_frame(frame_2, info_l);
error("Wrong unit lost arbitration. Expected: " &
integer'image(exp_winner) & " Real: " & integer'image(unit_rec));
o.outcome := false;
-- LCOV_EXCL_STOP
......@@ -347,13 +346,13 @@ package body Arbitration_feature is
------------------------------------------------------------------------
if (unit_rec = 3 and exp_winner /= 2) then
-- LCOV_EXCL_START
report "Collision should have appeared" severity error;
report "Frame 1:";
info("Frame 1:");
CAN_print_frame(frame_1, info_l);
report "Frame 2:";
info("Frame 2:");
CAN_print_frame(frame_2, info_l);
error("Collision should have appeared");
o.outcome := false;
-- LCOV_EXCL_STOP
end if;
......
......@@ -127,7 +127,7 @@ package body bus_start_feature is
------------------------------------------------------------------------
-- Turn on Node 1, Wait until it starts transmitting
------------------------------------------------------------------------
report "Turning ON Node 1.";
info("Turning ON Node 1.");
CAN_turn_controller(true, ID_1, mem_bus(1));
while (protocol_type'VAL(to_integer(unsigned(
iout(1).stat_bus(STAT_PC_STATE_HIGH downto STAT_PC_STATE_LOW))))
......@@ -140,7 +140,7 @@ package body bus_start_feature is
-- Modify frame to have ID 513, and insert it to Node 2 for transmission.
-- Enable Node 2, so that it may start integration.
------------------------------------------------------------------------
report "Turning ON Node 2.";
info("Turning ON Node 2.");
wait_rand_cycles(rand_ctr, mem_bus(1).clk_sys, 10, 11);
CAN_frame.identifier := 513;
CAN_send_frame(CAN_frame, 1, ID_2, mem_bus(2), frame_sent);
......@@ -159,9 +159,9 @@ package body bus_start_feature is
-- Assuming default timing configuration -> 200 cycles per Bit
-- Wait through CRC Delimiter + little bit
report "Started delim_ack";
info("Started delim_ack");
wait_rand_cycles(rand_ctr, mem_bus(1).clk_sys, 209, 210);
report "Forcing ACK";
info("Forcing ACK");
so.bl_inject <= DOMINANT;
so.bl_force <= true;
wait_rand_cycles(rand_ctr, mem_bus(1).clk_sys, 200, 201);
......@@ -172,14 +172,14 @@ package body bus_start_feature is
-- Wait until bus is idle.
------------------------------------------------------------------------
CAN_wait_bus_idle(ID_1, mem_bus(1));
report "Bus is idle";
info("Bus is idle");
------------------------------------------------------------------------
-- Now wait until another frame is transmitted. This one should be
-- arbitrated, and Node 2 should have won.
------------------------------------------------------------------------
CAN_wait_frame_sent(ID_1, mem_bus(1));
report "Second frame was sent!";
info("Second frame was sent!");
------------------------------------------------------------------------
-- Read status of RX Buffer in Node 1! It should have sent ACK and
......@@ -201,13 +201,12 @@ package body bus_start_feature is
-- in special feature test!
------------------------------------------------------------------------
get_rx_buf_state(rx_state, ID_1, mem_bus(1));
report "Read RX Buffer state";
info("Read RX Buffer state");
if (rx_state.rx_empty) then
-- LCOV_EXCL_START
o.outcome := false;
report "RX Buffer is empty, but Frame should be received!"
severity error;
error("RX Buffer is empty, but Frame should be received!");
-- LCOV_EXCL_STOP
end if;
......@@ -216,8 +215,8 @@ package body bus_start_feature is
if (CAN_frame.identifier /= 513) then
-- LCOV_EXCL_START
o.outcome := false;
report "Wrong Identifier received by Node 1. Expected: 513 , Real: " &
integer'image(CAN_frame.identifier) severity error;
error("Wrong Identifier received by Node 1. Expected: 513 , Real: " &
integer'image(CAN_frame.identifier));
-- LCOV_EXCL_STOP
end if;
......@@ -227,7 +226,7 @@ package body bus_start_feature is
-- Buffers.
------------------------------------------------------------------------
CAN_wait_bus_idle(ID_1, mem_bus(1));
report "Last frame was sent!";
info("Last frame was sent!");
end procedure;
......
......@@ -81,6 +81,7 @@ package body byte_enable_feature is
variable address : std_logic_vector(11 downto 0) :=
(OTHERS => '0');
variable ID : natural := 1;
variable errmsg : line;
begin
o.outcome := true;
......@@ -93,7 +94,7 @@ package body byte_enable_feature is
if (data /= x"DEADBEEF") then
-- LCOV_EXCL_START
o.outcome := false;
report "32 bit read error" severity error;
error("32 bit read error");
-- LCOV_EXCL_STOP
end if;
......@@ -111,8 +112,8 @@ package body byte_enable_feature is
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;
info("Read error - 16 bit access (valid byte), Index:");
error(integer'image(i));
o.outcome := false;
-- LCOV_EXCL_STOP
end if;
......@@ -120,8 +121,8 @@ package body byte_enable_feature is
-- 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;
info("Read error -16 bit access (empty byte), Index :");
error(integer'image(i));
o.outcome := false;
-- LCOV_EXCL_STOP
end if;
......@@ -142,8 +143,8 @@ package body byte_enable_feature is
then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit read error (valid byte), Index :" &
Integer'image(i) severity error;
info("Read error - 8 bit access (valid byte), Index :");
error(Integer'image(i));
-- LCOV_EXCL_STOP
end if;
......@@ -153,7 +154,7 @@ package body byte_enable_feature is
if (data(31 downto 8) /= x"000000") then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit read error (Empty byte 0)" severity error;
error("Read error - 8 bit (Empty byte 0)");
-- LCOV_EXCL_STOP
end if;
when 1 =>
......@@ -162,7 +163,7 @@ package body byte_enable_feature is
then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit read error (Empty byte 1)" severity error;
error("Read error - 8 bit (Empty byte 1)");
-- LCOV_EXCL_STOP
end if;
when 2 =>
......@@ -171,18 +172,18 @@ package body byte_enable_feature is
then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit read error (Empty byte 2)" severity error;
error("Read error - 8 bit (Empty byte 2)");
-- 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;
error("Read error - 8 bit (Empty byte 3)");
-- LCOV_EXCL_STOP
end if;
when others =>
report "Invalid byte index" severity error; -- LCOV_EXCL_LINE
error("Invalid byte index"); -- LCOV_EXCL_LINE
end case;
end loop;
......@@ -211,8 +212,8 @@ package body byte_enable_feature is
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;
info("Write error - 8 bit (valid byte), Index :");
error(Integer'image(i));
-- LCOV_EXCL_STOP
end if;
......@@ -222,7 +223,7 @@ package body byte_enable_feature is
if (data(31 downto 8) /= x"000000") then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit write error (Empty byte 0)" severity error;
error("Write error - 8 bit (Empty byte 0)");
-- LCOV_EXCL_STOP
end if;
when 1 =>
......@@ -231,7 +232,7 @@ package body byte_enable_feature is
then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit write error (Empty byte 1)" severity error;
error("Write error - 8 bit (Empty byte 1)");
-- LCOV_EXCL_STOP
end if;
when 2 =>
......@@ -240,18 +241,18 @@ package body byte_enable_feature is
then
-- LCOV_EXCL_START
o.outcome := false;
report "8 bit write error (Empty byte 2)" severity error;
error("Write error - 8 bit (Empty byte 2)");
-- 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;
error("Write error - 8 bit (Empty byte 3)");
-- LCOV_EXCL_STOP
end if;
when others =>
report "Invalid byte index" severity error; -- LCOV_EXCL_LINE
error("Invalid byte index"); -- LCOV_EXCL_LINE
end case;
end loop;
......
......@@ -125,7 +125,7 @@ package body data_length_code_feature is
-- LCOV_EXCL_START
o.outcome := false;
CAN_print_frame(CAN_frame_2, info_l);
report "Invalid DLC received!" severity error;
error("Invalid DLC received!");
-- LCOV_EXCL_STOP
end if;
......@@ -133,8 +133,7 @@ package body data_length_code_feature is
if (CAN_frame_2.data(i) /= "00000000") then
-- LCOV_EXCL_START
o.outcome := false;
report "Byte index " & integer'image(i) & " not zero!"
severity error;
error("Byte index " & integer'image(i) & " not zero!");
-- LCOV_EXCL_STOP
end if;
end loop;
......
......@@ -133,7 +133,7 @@ package body data_overrun_clear_feature is
CAN_wait_frame_sent(ID_1, mem_bus(1));
get_controller_status(status, ID_1, mem_bus(1));
if (status.data_overrun) then
report "Overrun Flag Detected!";
error("Overrun Flag Detected!");
exit;
end if;
end loop;
......@@ -143,8 +143,7 @@ package body data_overrun_clear_feature is
------------------------------------------------------------------------
read_int_status(interrupts, ID_1, mem_bus(1));
if (not interrupts.data_overrun_int) then
report "Data overrun Interrupt not captured as expected!"
severity error;
error("Data overrun Interrupt not captured as expected!");
end if;
------------------------------------------------------------------------
......@@ -160,7 +159,7 @@ package body data_overrun_clear_feature is
------------------------------------------------------------------------
read_int_status(interrupts, ID_1, mem_bus(1));
if (interrupts.data_overrun_int) then
report "Data overrun Interrupt was not cleared!" severity error;
error("Data overrun Interrupt was not cleared!");
end if;
end procedure;
......
......@@ -125,16 +125,14 @@ package body fault_confinement_feature is
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;
error("Error warning limit threshold was not set properly!");
-- 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;
error("Error passive threshold was not set properly!");
-- LCOV_EXCL_STOP
end if;
......@@ -149,8 +147,7 @@ package body fault_confinement_feature is
if (fault_state /= fc_bus_off) then
-- LCOV_EXCL_START
o.outcome := false;
report "Unit not Bus off as expected!"
severity error;
error("Unit not Bus off as expected!");
-- LCOV_EXCL_STOP
end if;
elsif (err_counters.tx_counter < fault_th.ewl and
......@@ -159,16 +156,14 @@ package body fault_confinement_feature is
if (fault_state /= fc_error_active) then
-- LCOV_EXCL_START
o.outcome := false;
report "Unit not Error Active as expected!"
severity error;
error("Unit not Error Active as expected!");
-- 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;
error("Unit not Error Passive as expected!");
-- LCOV_EXCL_STOP
end if;
end if;
......
......@@ -138,7 +138,7 @@ package body forbid_fd_feature is
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;
error("RX Error counter not incremented as expected!");
-- LCOV_EXCL_STOP
end if;
......@@ -162,7 +162,7 @@ package body forbid_fd_feature is
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;
error("RX Error counter not incremented as expected!");
-- LCOV_EXCL_STOP
end if;
......@@ -192,7 +192,7 @@ package body forbid_fd_feature is
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;
error("RX Error counter not decremented as expected!");
-- LCOV_EXCL_STOP
end if;
......@@ -202,7 +202,7 @@ package body forbid_fd_feature is
-- this we clear error counters
------------------------------------------------------------------------
if (err_counters_2.rx_counter > 70) then
report "Resetting error counters";
info("Resetting error counters");
err_counters_2.rx_counter := 0;
err_counters_2.tx_counter := 0;
set_error_counters(err_counters_2, ID_1, mem_bus(1));
......
......@@ -140,7 +140,7 @@ package body interrupt_feature is
------------------------------------------------------------------------
-- Recieve INT node 1, TX int node 2
------------------------------------------------------------------------
report "Starting TX RX interrupt";
info("Starting TX RX interrupt");
int_ena.receive_int := true;
write_int_enable(int_ena, ID_1, mem_bus(1));
int_ena.receive_int := false;
......@@ -167,7 +167,7 @@ package body interrupt_feature is
if (not int_stat.receive_int) then
-- LCOV_EXCL_START
o.outcome := false;
report "RX Interrupt not present!" severity error;
error("RX Interrupt not present!");
-- LCOV_EXCL_STOP
end if;
clear_int_status(int_stat, ID_1, mem_bus(1));
......@@ -184,7 +184,7 @@ package body interrupt_feature is
------------------------------------------------------------------------
-- Error Interrupt both nodes
------------------------------------------------------------------------
report "Starting Error interrupt";
info("Starting Error interrupt");
int_ena.bus_error_int := true;
write_int_enable(int_ena, ID_1, mem_bus(1));
write_int_enable(int_ena, ID_2, mem_bus(2));
......@@ -212,7 +212,7 @@ package body interrupt_feature is
if (not int_stat.bus_error_int) then
-- LCOV_EXCL_START
o.outcome := false;
report "Bus error Interrput not present (Node 1)" severity error;
error("Bus error Interrput not present (Node 1)");
-- LCOV_EXCL_STOP
end if;
clear_int_status(int_stat, ID_1, mem_bus(1));
......@@ -220,7 +220,7 @@ package body interrupt_feature is
read_int_status(int_stat, ID_2, mem_bus(2));
if (not int_stat.bus_error_int) then
-- LCOV_EXCL_START
report "Bus error Interrupt no present (Node 2)" severity error;
error("Bus error Interrupt no present (Node 2)");
o.outcome := false;
-- LCOV_EXCL_STOP
end if;
......@@ -235,7 +235,7 @@ package body interrupt_feature is
------------------------------------------------------------------------
-- Data overrun interrupt and recieve buffer full interrupt node 2
------------------------------------------------------------------------
report "Starting Data overrun, recieve buffer interrupt";
info("Starting Data overrun, recieve buffer interrupt");
int_ena.data_overrun_int := true;
int_ena.rx_buffer_full_int := true;
write_int_enable(int_ena, ID_2, mem_bus(2));
......@@ -269,8 +269,7 @@ package body interrupt_feature is
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;
error("RX Buffer Full interrupt is not active!");
o.outcome := false;
-- LCOV_EXCL_STOP
else
......@@ -289,14 +288,14 @@ package body interrupt_feature is
if (not int_stat.rx_buffer_full_int) then
-- LCOV_EXCL_START
o.outcome := false;
report "RX Buffer Full Interrupt not present!" severity error;
error("RX Buffer Full Interrupt not present!");
-- 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;
error("Data overrun Interrupt not present!");
-- LCOV_EXCL_STOP
end if;
clear_int_status(int_stat, ID_2, mem_bus(2));
......@@ -309,7 +308,7 @@ package body interrupt_feature is
------------------------------------------------------------------------
-- Bit rate shift interrupt on both nodes
------------------------------------------------------------------------
report "Starting Bit rate shift interrupt";
info("Starting Bit rate shift interrupt");
int_ena.bit_rate_shift_int := true;
write_int_enable(int_ena, ID_1, mem_bus(1));
......@@ -333,7 +332,7 @@ package body interrupt_feature is
if (not int_stat.bit_rate_shift_int) then
-- LCOV_EXCL_START
o.outcome := false;
report "Bit Rate shift interrupt not present" severity error;
error("Bit Rate shift interrupt not present");
-- LCOV_EXCL_STOP
end if;
CAN_wait_frame_sent(ID_2,mem_bus(2));
......@@ -348,7 +347,7 @@ package body interrupt_feature is
------------------------------------------------------------------------
-- Arbitration lost interrupt in node 1
------------------------------------------------------------------------
report "Starting arbitration lost int";
info("Starting arbitration lost int");
int_ena.arb_lost_int := true;
write_int_enable(int_ena, ID_1, mem_bus(1));
......@@ -369,7 +368,7 @@ package body interrupt_feature is
if (not int_stat.arb_lost_int) then
-- LCOV_EXCL_START
o.outcome := false;
report "Arbitration Lost Interrupt not present!" severity error;
error("Arbitration Lost Interrupt not present!");
-- LCOV_EXCL_STOP
end if;
clear_int_status(int_stat, ID_1, mem_bus(1));
......@@ -389,7 +388,7 @@ package body interrupt_feature is
read_int_status(int_stat, ID_2, mem_bus(2));
clear_int_status(int_stat, ID_2, mem_bus(2));
report "Finished interrupt test";
info("Finished interrupt test");
wait for 300000 ns;
end procedure;
......
......@@ -114,8 +114,7 @@ package body invalid_configs_feature is
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;
error("Frame with BRS Bit or CAN FD Frame received!");
-- LCOV_EXCL_STOP
end if;
......</