...
 
Commits (2)
......@@ -4210,11 +4210,11 @@ ACF\end_layout
\begin_inset Text
\begin_layout Plain Layout
TSM\end_layout
Reserved\end_layout
\end_inset
</cell>
<cell alignment="center" leftline="true" multicolumn="1" topline="true" usebox="none" valignment="top">
<cell alignment="center" leftline="true" multicolumn="2" topline="true" usebox="none" valignment="top">
\begin_inset Text
\begin_layout Plain Layout
......@@ -4284,7 +4284,7 @@ Reset value\end_layout
\begin_inset Text
\begin_layout Plain Layout
0\end_layout
-\end_layout
\end_inset
</cell>
......@@ -4367,11 +4367,6 @@ FDE Enable flexible data rate support. When disabled, receiving recessive EDL bi
0b1 - FDE_ENABLE - Flexible data-rate support enabled.
\end_layout
\begin_layout Description
TSM Tripple sampling mode. Bus value is sampled three times when this mode is enabled. Even if this bit is set, triple sampling is used only during Nominal data rate. CAN standard reccomends to use tripple sampling at low Bit rates.\begin_inset Newline newline\end_inset
0b0 - TSM_DISABLE - Tripple sampling mode disabled\begin_inset Newline newline\end_inset
0b1 - TSM_ENABLE - Tripple sampling mode enabled
\end_layout
\begin_layout Description
ACF Acknowledge forbidden mode. When this mode is enabled, acknowledge is not sent even if received CRC matches the calculated one.\begin_inset Newline newline\end_inset
0b0 - ACF_DISABLED - Acknowledge forbidden mode disabled.\begin_inset Newline newline\end_inset
0b1 - ACF_ENABLED - Acknowledge forbidden mode enabled.
......@@ -30766,11 +30761,12 @@ ALC_BIT Arbitration lost capture bit position. If ALC_ID_FIELD = ALC_BASE_ID th
\end_layout
\begin_layout Description
ALC_ID_FIELD Sub field of CAN Identifier in which arbitration was lost.\begin_inset Newline newline\end_inset
0b000 - ALC_BASE_ID - Arbitration was lost during base identifier.\begin_inset Newline newline\end_inset
0b001 - ALC_SRR_RTR - Arbitration was lost during first bit after Base identifier (SRR of Extended Frame, RTR bit of CAN 2.0 Base Frame)\begin_inset Newline newline\end_inset
0b010 - ALC_IDE - Arbitration was lost during IDE bit.\begin_inset Newline newline\end_inset
0b011 - ALC_EXTENSION - Arbitration was lost during Identifier extension.\begin_inset Newline newline\end_inset
0b100 - ALC_RTR - Arbitration was lost during RTR bit after Identifier extension!
0b000 - ALC_RSVD - Unit did not loose arbitration since last reset.\begin_inset Newline newline\end_inset
0b001 - ALC_BASE_ID - Arbitration was lost during base identifier.\begin_inset Newline newline\end_inset
0b010 - ALC_SRR_RTR - Arbitration was lost during first bit after Base identifier (SRR of Extended Frame, RTR bit of CAN 2.0 Base Frame)\begin_inset Newline newline\end_inset
0b011 - ALC_IDE - Arbitration was lost during IDE bit.\begin_inset Newline newline\end_inset
0b100 - ALC_EXTENSION - Arbitration was lost during Identifier extension.\begin_inset Newline newline\end_inset
0b101 - ALC_RTR - Arbitration was lost during RTR bit after Identifier extension!
\end_layout
\begin_layout Standard
\begin_inset VSpace bigskip
......
......@@ -838,11 +838,12 @@ enum ctu_can_fd_err_capt_err_type {
};
enum ctu_can_fd_alc_alc_id_field {
ALC_BASE_ID = 0x0,
ALC_SRR_RTR = 0x1,
ALC_IDE = 0x2,
ALC_EXTENSION = 0x3,
ALC_RTR = 0x4,
ALC_RSVD = 0x0,
ALC_BASE_ID = 0x1,
ALC_SRR_RTR = 0x2,
ALC_IDE = 0x3,
ALC_EXTENSION = 0x4,
ALC_RTR = 0x5,
};
union ctu_can_fd_trv_delay_ssp_cfg {
......
......@@ -998,31 +998,37 @@
<ipxact:name>ALC_BASE_ID</ipxact:name>
<ipxact:displayName>ALC_BASE_ID</ipxact:displayName>
<ipxact:description>Arbitration was lost during base identifier.</ipxact:description>
<ipxact:value>00</ipxact:value>
<ipxact:value>01</ipxact:value>
</ipxact:enumeratedValue>
<ipxact:enumeratedValue>
<ipxact:name>ALC_SRR_RTR</ipxact:name>
<ipxact:displayName>ALC_SRR_RTR</ipxact:displayName>
<ipxact:description>Arbitration was lost during first bit after Base identifier (SRR of Extended Frame, RTR bit of CAN 2.0 Base Frame)</ipxact:description>
<ipxact:value>01</ipxact:value>
<ipxact:value>02</ipxact:value>
</ipxact:enumeratedValue>
<ipxact:enumeratedValue>
<ipxact:name>ALC_IDE</ipxact:name>
<ipxact:displayName>ALC_IDE</ipxact:displayName>
<ipxact:description>Arbitration was lost during IDE bit.</ipxact:description>
<ipxact:value>02</ipxact:value>
<ipxact:value>03</ipxact:value>
</ipxact:enumeratedValue>
<ipxact:enumeratedValue>
<ipxact:name>ALC_EXTENSION</ipxact:name>
<ipxact:displayName>ALC_EXTENSION</ipxact:displayName>
<ipxact:description>Arbitration was lost during Identifier extension.</ipxact:description>
<ipxact:value>03</ipxact:value>
<ipxact:value>04</ipxact:value>
</ipxact:enumeratedValue>
<ipxact:enumeratedValue>
<ipxact:name>ALC_RTR</ipxact:name>
<ipxact:displayName>ALC_RTR</ipxact:displayName>
<ipxact:description>Arbitration was lost during RTR bit after Identifier extension!</ipxact:description>
<ipxact:value>04</ipxact:value>
<ipxact:value>05</ipxact:value>
</ipxact:enumeratedValue>
<ipxact:enumeratedValue>
<ipxact:name>ALC_RSVD</ipxact:name>
<ipxact:displayName>ALC_RSVD</ipxact:displayName>
<ipxact:description>Unit did not loose arbitration since last reset.</ipxact:description>
<ipxact:value>00</ipxact:value>
</ipxact:enumeratedValue>
</ipxact:enumeratedValues>
</ipxact:field>
......
......@@ -97,7 +97,13 @@ entity control_counter is
ctrl_ctr_pload_val :in std_logic_vector(G_CTRL_CTR_WIDTH - 1 downto 0);
-- Complementary counter enable
compl_ctr_ena :in std_logic;
compl_ctr_ena :in std_logic;
-- Arbitration lost
arbitration_lost :in std_logic;
-- Arbitration lost
alc_id_field :in std_logic_vector(2 downto 0);
-----------------------------------------------------------------------
-- Status signals
......@@ -115,7 +121,10 @@ entity control_counter is
ctrl_counted_byte_index :out std_logic_vector(1 downto 0);
-- Index of memory word in TXT Buffer
ctrl_ctr_mem_index :out std_logic_vector(4 downto 0)
ctrl_ctr_mem_index :out std_logic_vector(4 downto 0);
-- Arbitration lost capture
alc :out std_logic_vector(7 downto 0)
);
end entity;
......@@ -169,7 +178,7 @@ begin
end if;
end if;
end process;
---------------------------------------------------------------------------
-- Complementary counter.
--
......@@ -182,11 +191,11 @@ begin
---------------------------------------------------------------------------
compl_ctr_d <= (OTHERS => '0') when (ctrl_ctr_pload = '1') else
compl_ctr_q + 1;
compl_ctr_ce <= '1' when (ctrl_ctr_pload = '1') else
'1' when (compl_ctr_ena = '1') else
'0';
compl_reg_proc : process(clk_sys, res_n)
begin
if (res_n = G_RESET_POLARITY) then
......@@ -225,10 +234,26 @@ begin
---------------------------------------------------------------------------
ctrl_ctr_mem_index <= std_logic_vector(to_unsigned(compl_ctr_div_32_plus_5, 5));
---------------------------------------------------------------------------
-- Arbitration lost capture register
---------------------------------------------------------------------------
alc_capt_reg_proc : process(res_n, clk_sys)
begin
if (res_n = G_RESET_POLARITY) then
alc <= (OTHERS => '0');
elsif (rising_edge(clk_sys)) then
if (arbitration_lost = '1') then
alc(4 downto 0) <= std_logic_vector(ctrl_ctr_q(4 downto 0));
alc(7 downto 5) <= alc_id_field;
end if;
end if;
end process;
---------------------------------------------------------------------------
-- Assertions
---------------------------------------------------------------------------
-- psl default clock is rising_edge(clk_sys);
end architecture;
\ No newline at end of file
......@@ -574,6 +574,12 @@ architecture rtl of protocol_control is
-- Fixed Stuff (internal)
signal fixed_stuff_i : std_logic;
-- Arbitration lost (internal)
signal arbitration_lost_i : std_logic;
-- Arbitration lost capture - ID field
signal alc_id_field : std_logic_vector(2 downto 0);
begin
---------------------------------------------------------------------------
......@@ -704,6 +710,7 @@ begin
ctrl_counted_byte_index => ctrl_counted_byte_index, -- IN
ctrl_ctr_mem_index => ctrl_ctr_mem_index, -- IN
compl_ctr_ena => compl_ctr_ena, -- OUT
alc_id_field => alc_id_field, -- OUT
-- Reintegration counter interface
reinteg_ctr_clr => reinteg_ctr_clr, -- OUT
......@@ -738,7 +745,7 @@ begin
is_transmitter => is_transmitter, -- IN
is_receiver => is_receiver, -- IN
is_idle => is_idle, -- IN
arbitration_lost => arbitration_lost, -- OUT
arbitration_lost => arbitration_lost_i, -- OUT
set_transmitter => set_transmitter, -- OUT
set_receiver => set_receiver, -- OUT
set_idle => set_idle, -- OUT
......@@ -784,13 +791,16 @@ begin
ctrl_ctr_pload => ctrl_ctr_pload, -- IN
ctrl_ctr_pload_val => ctrl_ctr_pload_val, -- IN
compl_ctr_ena => compl_ctr_ena, -- IN
arbitration_lost => arbitration_lost_i, -- IN
alc_id_field => alc_id_field, -- IN
-- Status signals
ctrl_ctr_zero => ctrl_ctr_zero, -- OUT
ctrl_ctr_one => ctrl_ctr_one, -- OUT
ctrl_counted_byte => ctrl_counted_byte, -- OUT
ctrl_counted_byte_index => ctrl_counted_byte_index, -- OUT
ctrl_ctr_mem_index => ctrl_ctr_mem_index -- OUT
ctrl_ctr_mem_index => ctrl_ctr_mem_index, -- OUT
alc => alc -- OUT
);
......@@ -988,6 +998,7 @@ begin
stuff_error_enable <= stuff_error_enable_i;
fixed_stuff <= fixed_stuff_i;
crc_src <= crc_src_i;
arbitration_lost <= arbitration_lost_i;
---------------------------------------------------------------------------
-- Assertions
......
......@@ -318,6 +318,9 @@ entity protocol_control_fsm is
-- Complementary counter enable
compl_ctr_ena :out std_logic;
-- Arbitration lost capture ID field
alc_id_field :out std_logic_vector(2 downto 0);
-----------------------------------------------------------------------
-- Reintegration counter interface
......@@ -1171,10 +1174,13 @@ begin
-----------------------------------------------------------------------
-- Default values
-----------------------------------------------------------------------
-- Control counter
ctrl_ctr_pload_i <= '0';
ctrl_ctr_pload_val <= (OTHERS => '0');
ctrl_ctr_ena <= '0';
compl_ctr_ena_i <= '0';
alc_id_field <= ALC_RSVD;
-- RX Buffer storing protocol
store_metadata_d <= '0';
......@@ -1372,6 +1378,7 @@ begin
err_pos <= ERC_POS_ARB;
crc_enable <= '1';
txtb_ptr_d <= 1;
alc_id_field <= ALC_BASE_ID;
if (arbitration_lost_condition = '1') then
txtb_hw_cmd_d.unlock <= '1';
......@@ -1403,6 +1410,7 @@ begin
rx_store_rtr_i <= '1';
err_pos <= ERC_POS_ARB;
txtb_ptr_d <= 1;
alc_id_field <= ALC_SRR_RTR;
if (arbitration_lost_condition = '1') then
txtb_hw_cmd_d.unlock <= '1';
......@@ -1435,6 +1443,7 @@ begin
rx_store_ide_i <= '1';
crc_enable <= '1';
txtb_ptr_d <= 1;
alc_id_field <= ALC_IDE;
if (rx_data = RECESSIVE) then
ctrl_ctr_pload_i <= '1';
......@@ -1486,6 +1495,7 @@ begin
err_pos <= ERC_POS_ARB;
bit_err_disable <= '1';
crc_enable <= '1';
alc_id_field <= ALC_EXTENSION;
if (arbitration_lost_condition = '1') then
txtb_hw_cmd_d.unlock <= '1';
......@@ -1516,6 +1526,7 @@ begin
crc_enable <= '1';
rx_store_rtr_i <= '1';
err_pos <= ERC_POS_ARB;
alc_id_field <= ALC_RTR;
if (arbitration_lost_condition = '1') then
txtb_hw_cmd_d.unlock <= '1';
......
......@@ -1118,6 +1118,12 @@ package can_components is
-- Complementary counter enable
compl_ctr_ena :in std_logic;
-- Arbitration lost
arbitration_lost :in std_logic;
-- Arbitration lost
alc_id_field :in std_logic_vector(2 downto 0);
-----------------------------------------------------------------------
-- Status signals
-----------------------------------------------------------------------
......@@ -1134,7 +1140,10 @@ package can_components is
ctrl_counted_byte_index :out std_logic_vector(1 downto 0);
-- Index of memory word in TXT Buffer
ctrl_ctr_mem_index :out std_logic_vector(4 downto 0)
ctrl_ctr_mem_index :out std_logic_vector(4 downto 0);
-- Arbitration lost capture
alc :out std_logic_vector(7 downto 0)
);
end component control_counter;
......@@ -1518,6 +1527,9 @@ package can_components is
-- Complementary counter enable
compl_ctr_ena :out std_logic;
-- Arbitration lost capture ID field
alc_id_field :out std_logic_vector(2 downto 0);
-----------------------------------------------------------------------
-- Reintegration counter interface
-----------------------------------------------------------------------
......
......@@ -1233,11 +1233,12 @@ package can_fd_register_map is
constant ALC_ID_FIELD_H : natural := 23;
-- "ALC_ID_FIELD" field enumerated values
constant ALC_BASE_ID : std_logic_vector(2 downto 0) := "000";
constant ALC_SRR_RTR : std_logic_vector(2 downto 0) := "001";
constant ALC_IDE : std_logic_vector(2 downto 0) := "010";
constant ALC_EXTENSION : std_logic_vector(2 downto 0) := "011";
constant ALC_RTR : std_logic_vector(2 downto 0) := "100";
constant ALC_RSVD : std_logic_vector(2 downto 0) := "000";
constant ALC_BASE_ID : std_logic_vector(2 downto 0) := "001";
constant ALC_SRR_RTR : std_logic_vector(2 downto 0) := "010";
constant ALC_IDE : std_logic_vector(2 downto 0) := "011";
constant ALC_EXTENSION : std_logic_vector(2 downto 0) := "100";
constant ALC_RTR : std_logic_vector(2 downto 0) := "101";
-- ALC register reset values
constant ALC_BIT_RSTVAL : std_logic_vector(4 downto 0) := "00000";
......
......@@ -526,10 +526,11 @@ begin
input => rx_buf_res_d, -- IN
ce => '1', -- IN
output => rx_buf_res_q -- OUT
);
----------------------------------------------------------------------------
-- RX Buffer FSM component
......@@ -836,7 +837,7 @@ begin
-- memory, and there is not enough free space, data overrun flag will be
-- set, and no further writes will be executed.
----------------------------------------------------------------------------
dor_proc : process(res_n, rx_buf_res_q)
dor_proc : process(clk_sys, rx_buf_res_q)
begin
if (rx_buf_res_q = G_RESET_POLARITY) then
data_overrun_r <= '0';
......