Commit 339a0656 authored by Ille, Ondrej, Ing.'s avatar Ille, Ondrej, Ing.

src: Decrement REC on succesfull ACK, not on rec_valid.

parent 752f996d
......@@ -446,6 +446,9 @@ architecture rtl of can_core is
signal retr_ctr_i : std_logic_vector(G_RETR_LIM_CTR_WIDTH - 1 downto 0);
-- Decrement Receive Error counter
signal decrement_rec : std_logic;
begin
----------------------------------------------------------------------------
......@@ -580,7 +583,8 @@ begin
tran_delay_meas => tran_delay_meas_i, -- OUT
tran_valid => tran_valid_i, -- OUT
rec_valid => rec_valid_i, -- OUT
decrement_rec => decrement_rec, -- OUT
-- Status signals
ack_received => ack_received_i, -- OUT
br_shifted => br_shifted_i, -- OUT
......@@ -654,6 +658,7 @@ begin
err_delim_late => err_delim_late, -- IN
tran_valid => tran_valid_i, -- IN
rec_valid => rec_valid_i, -- IN
decrement_rec => decrement_rec, -- IN
-- Fault confinement State indication
is_err_active => is_err_active, -- OUT
......
......@@ -134,6 +134,9 @@ entity fault_confinement is
-- Reception of frame valid
rec_valid :in std_logic;
-- Decrement receive Error counter
decrement_rec :in std_logic;
-----------------------------------------------------------------------
-- Fault confinement State indication
......@@ -278,7 +281,7 @@ begin
act_err_ovr_flag => act_err_ovr_flag, -- IN
err_delim_late => err_delim_late, -- IN
tran_valid => tran_valid, -- IN
rec_valid => rec_valid, -- IN
decrement_rec => decrement_rec, -- IN
inc_one => inc_one, -- OUT
inc_eight => inc_eight, -- OUT
......
......@@ -97,8 +97,8 @@ entity fault_confinement_rules is
-- Transmission of frame valid
tran_valid :in std_logic;
-- Reception of frame valid
rec_valid :in std_logic;
-- Decrement receive Error counter
decrement_rec :in std_logic;
-----------------------------------------------------------------------
-- Output signals to error counters
......@@ -150,7 +150,7 @@ begin
---------------------------------------------------------------------------
-- Decrement by 1 when either transmission or reception is valid
---------------------------------------------------------------------------
dec_one <= '1' when (rec_valid = '1' or tran_valid = '1') else
dec_one <= '1' when (decrement_rec = '1' or tran_valid = '1') else
'0';
end architecture;
......@@ -393,6 +393,9 @@ entity protocol_control is
-- Received frame is valid
rec_valid :out std_logic;
-- Decrement Receive Error counter
decrement_rec :out std_logic;
-----------------------------------------------------------------------
-- Status signals
......@@ -788,7 +791,8 @@ begin
is_err_active => is_err_active, -- IN
is_err_passive => is_err_passive, -- IN
is_bus_off => is_bus_off, -- IN
decrement_rec => decrement_rec, -- OUT
-- Other control signals
sp_control => sp_control, -- OUT
sp_control_q => sp_control_q, -- OUT
......
......@@ -463,6 +463,9 @@ entity protocol_control_fsm is
-- Unit is Bus off
is_bus_off :in std_logic;
-- Decrement REC
decrement_rec :out std_logic;
-----------------------------------------------------------------------
-- Other control signals
-----------------------------------------------------------------------
......@@ -726,8 +729,9 @@ architecture rtl of protocol_control_fsm is
-- Increment Retransmitt counter by 1
signal retr_ctr_add_i : std_logic;
-- Decrement Receive error counter (internal value)
signal decrement_rec_i : std_logic;
-- Blocking register for retransmitt counter add signal.
signal retr_ctr_add_block : std_logic;
signal retr_ctr_add_block_clr : std_logic;
......@@ -1093,7 +1097,8 @@ begin
end if;
-------------------------------------------------------------------
-- Secondary CRC Delimiter, or an ACK Slot if DOMINANT.
-- Secondary CRC Delimiter (Transmitter of FD frame only), or an
-- ACK Slot if DOMINANT.
-------------------------------------------------------------------
when s_pc_crc_delim_sec =>
if (rx_data_nbs = DOMINANT) then
......@@ -1446,6 +1451,7 @@ begin
is_sof <= '0';
clr_bus_off_rst_flg <= '0';
decrement_rec_i <= '0';
if (err_frm_req = '1') then
tick_state_reg <= '1';
......@@ -2082,6 +2088,10 @@ begin
dbt_ctrs_en <= '1';
bit_err_disable <= '1';
-- Note: We don't have to consider decrement of REC here,
-- because we get here only for transmitter of CAN FD
-- frame!
-------------------------------------------------------------------
-- ACK Slot, or a ACK delim, if previous two bits were recessive!
-------------------------------------------------------------------
......@@ -2096,13 +2106,19 @@ begin
drv_ack_forb = '0')
then
tx_dominant <= '1';
-- Bit Error still shall be detected when unit sends dominant
-- (receiver) and receives recessive!
else
bit_err_disable <= '1';
end if;
if (is_receiver = '1' and crc_match = '1' and
rx_data_nbs = DOMINANT)
then
decrement_rec_i <= '1';
end if;
if (is_transmitter = '1' and drv_self_test_ena = '0' and
rx_data_nbs = RECESSIVE)
then
......@@ -2753,6 +2769,7 @@ begin
ack_err <= ack_err_i and rx_trigger;
crc_err <= crc_err_i and rx_trigger;
bit_err_arb <= bit_err_arb_i and rx_trigger;
decrement_rec <= decrement_rec_i and rx_trigger;
-----------------------------------------------------------------------
-- Switching of Bit-rate
......
......@@ -902,7 +902,7 @@ package can_components is
-- Unit is transmitter
is_transmitter :in std_logic;
-- Unit is receiver
is_receiver :in std_logic;
......@@ -1019,8 +1019,8 @@ package can_components is
-- Transmission of frame valid
tran_valid :in std_logic;
-- Reception of frame valid
rec_valid :in std_logic;
-- Decrement receive Error counter
decrement_rec :in std_logic;
-----------------------------------------------------------------------
-- Output signals to error counters
......@@ -1105,6 +1105,9 @@ package can_components is
-- Reception of frame valid
rec_valid :in std_logic;
-- Decrement receive Error counter
decrement_rec :in std_logic;
-----------------------------------------------------------------------
-- Fault confinement State indication
......@@ -1842,6 +1845,9 @@ package can_components is
-- Unit is Bus off
is_bus_off :in std_logic;
-- Decrement REC
decrement_rec :out std_logic;
-----------------------------------------------------------------------
-- Other control signals
-----------------------------------------------------------------------
......@@ -2232,6 +2238,9 @@ package can_components is
-- Received frame is valid
rec_valid :out std_logic;
-- Decrement Receive Error counter
decrement_rec :out std_logic;
-----------------------------------------------------------------------
-- Status signals
......
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