Commit 6a6ae866 authored by Ille, Ondrej, Ing.'s avatar Ille, Ondrej, Ing.

Added comments to bus start bench.

parent badb6f59
......@@ -131,6 +131,7 @@ package body bus_start_feature is
------------------------------------------------------------------------
-- Turn on Node 1, Wait until it starts transmitting
------------------------------------------------------------------------
report "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))))
......@@ -143,6 +144,7 @@ package body bus_start_feature is
-- Modify frame to have ID 9, and insert it to Node 2 for transmission.
-- Enable Node 2, so that it may start integration.
------------------------------------------------------------------------
report "Turning ON Node 2.";
wait_rand_cycles(rand_ctr, mem_bus(1).clk_sys, 10, 11);
CAN_frame.identifier := 9;
CAN_send_frame(CAN_frame, 1, ID_2, mem_bus(2), frame_sent);
......@@ -161,10 +163,12 @@ package body bus_start_feature is
-- Assuming default timing configuration -> 200 cycles per Bit
-- Wait through CRC Delimiter + little bit
wait_rand_cycles(rand_ctr, mem_bus(1).clk_sys, 210, 210);
report "Started delim_ack";
wait_rand_cycles(rand_ctr, mem_bus(1).clk_sys, 209, 210);
report "Forcing ACK";
so.bl_inject <= DOMINANT;
so.bl_force <= true;
wait_rand_cycles(rand_ctr, mem_bus(1).clk_sys, 200, 200);
wait_rand_cycles(rand_ctr, mem_bus(1).clk_sys, 200, 201);
so.bl_force <= false;
so.bl_inject <= RECESSIVE;
......@@ -172,12 +176,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";
------------------------------------------------------------------------
-- 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!";
------------------------------------------------------------------------
-- Read status of RX Buffer in Node 1! It should have sent ACK and
......@@ -186,6 +192,7 @@ package body bus_start_feature is
-- minimal necessary time, and test fails!
------------------------------------------------------------------------
get_rx_buf_state(rx_state, ID_1, mem_bus(1));
report "Read RX Buffer state";
if (rx_state.rx_empty) then
-- LCOV_EXCL_START
......
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