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

Merge branch '151-fix-alc' into 'master'

Resolve "Fix ALC"

Closes #151

See merge request illeondr/CAN_FD_IP_Core!99
parents f27ae22d bde1936e
......@@ -28306,7 +28306,7 @@ Address: 0x75
Size: 1 byte
\end_layout
\begin_layout Standard
Arbitration lost capture register.
Arbitration lost capture register. Determines bit position of last arbitration lost.
\end_layout
\begin_layout Standard
\noindent
......@@ -28410,7 +28410,7 @@ Field name\end_layout
\begin_inset Text
\begin_layout Plain Layout
Reserved\end_layout
ALC_ID_FIELD\end_layout
\end_inset
</cell>
......@@ -28418,7 +28418,7 @@ Reserved\end_layout
\begin_inset Text
\begin_layout Plain Layout
Reserved\end_layout
ALC_ID_FIELD\end_layout
\end_inset
</cell>
......@@ -28426,7 +28426,7 @@ Reserved\end_layout
\begin_inset Text
\begin_layout Plain Layout
Reserved\end_layout
ALC_ID_FIELD\end_layout
\end_inset
</cell>
......@@ -28434,7 +28434,7 @@ Reserved\end_layout
\begin_inset Text
\begin_layout Plain Layout
ALC_VAL\end_layout
ALC_BIT\end_layout
\end_inset
</cell>
......@@ -28442,7 +28442,7 @@ ALC_VAL\end_layout
\begin_inset Text
\begin_layout Plain Layout
ALC_VAL\end_layout
ALC_BIT\end_layout
\end_inset
</cell>
......@@ -28450,7 +28450,7 @@ ALC_VAL\end_layout
\begin_inset Text
\begin_layout Plain Layout
ALC_VAL\end_layout
ALC_BIT\end_layout
\end_inset
</cell>
......@@ -28458,7 +28458,7 @@ ALC_VAL\end_layout
\begin_inset Text
\begin_layout Plain Layout
ALC_VAL\end_layout
ALC_BIT\end_layout
\end_inset
</cell>
......@@ -28466,7 +28466,7 @@ ALC_VAL\end_layout
\begin_inset Text
\begin_layout Plain Layout
ALC_VAL\end_layout
ALC_BIT\end_layout
\end_inset
</cell>
......@@ -28484,7 +28484,7 @@ Reset value\end_layout
\begin_inset Text
\begin_layout Plain Layout
-\end_layout
0\end_layout
\end_inset
</cell>
......@@ -28492,7 +28492,7 @@ Reset value\end_layout
\begin_inset Text
\begin_layout Plain Layout
-\end_layout
0\end_layout
\end_inset
</cell>
......@@ -28500,7 +28500,7 @@ Reset value\end_layout
\begin_inset Text
\begin_layout Plain Layout
-\end_layout
0\end_layout
\end_inset
</cell>
......@@ -28552,7 +28552,15 @@ Reset value\end_layout
\end_layout
\begin_layout Description
ALC_VAL Arbitration lost capture value. Not supported yet. Do not use!
ALC_BIT Arbitration lost capture bit position. If ALC_ID_FIELD = ALC_BASE_ID then bit index of BASE identifier in which arbitration was lost is given as: 11 - ALC_VAL. If ALC_ID_FIELD = ALC_EXTENSION then bit index of EXTENDED identifier in which arbitration was lost is given as: 18 - ALC_VAL. For other values of ALC_ID_FIELD, this value is undefined.
\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!
\end_layout
\begin_layout Standard
\begin_inset VSpace bigskip
......
......@@ -790,11 +790,13 @@ union ctu_can_fd_err_capt_alc {
uint32_t err_pos : 5;
uint32_t err_type : 3;
/* ALC */
uint32_t alc_val : 5;
uint32_t reserved_31_13 : 19;
uint32_t alc_bit : 5;
uint32_t alc_id_field : 3;
uint32_t reserved_31_16 : 16;
#else
uint32_t reserved_31_13 : 19;
uint32_t alc_val : 5;
uint32_t reserved_31_16 : 16;
uint32_t alc_id_field : 3;
uint32_t alc_bit : 5;
uint32_t err_type : 3;
uint32_t err_pos : 5;
#endif
......@@ -822,6 +824,14 @@ enum ctu_can_fd_err_capt_err_type {
ERC_STUF_ERR = 0x4,
};
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,
};
union ctu_can_fd_trv_delay {
uint32_t u32;
struct ctu_can_fd_trv_delay_s {
......
......@@ -972,16 +972,16 @@
<ipxact:register>
<ipxact:name>ALC</ipxact:name>
<ipxact:displayName>ALC</ipxact:displayName>
<ipxact:description>Arbitration lost capture register. </ipxact:description>
<ipxact:description>Arbitration lost capture register. Determines bit position of last arbitration lost.</ipxact:description>
<ipxact:dim>0</ipxact:dim>
<ipxact:addressOffset>'h75</ipxact:addressOffset>
<ipxact:size>8</ipxact:size>
<ipxact:volatile>true</ipxact:volatile>
<ipxact:access>read-only</ipxact:access>
<ipxact:field>
<ipxact:name>ALC_VAL</ipxact:name>
<ipxact:displayName>ALC_VAL</ipxact:displayName>
<ipxact:description>Arbitration lost capture value. Not supported yet. Do not use!</ipxact:description>
<ipxact:name>ALC_BIT</ipxact:name>
<ipxact:displayName>ALC_BIT</ipxact:displayName>
<ipxact:description>Arbitration lost capture bit position. If ALC_ID_FIELD = ALC_BASE_ID then bit index of BASE identifier in which arbitration was lost is given as: 11 - ALC_VAL. If ALC_ID_FIELD = ALC_EXTENSION then bit index of EXTENDED identifier in which arbitration was lost is given as: 18 - ALC_VAL. For other values of ALC_ID_FIELD, this value is undefined.</ipxact:description>
<ipxact:bitOffset>0</ipxact:bitOffset>
<ipxact:resets>
<ipxact:reset>
......@@ -990,6 +990,50 @@
</ipxact:resets>
<ipxact:bitWidth>5</ipxact:bitWidth>
</ipxact:field>
<ipxact:field>
<ipxact:name>ALC_ID_FIELD</ipxact:name>
<ipxact:displayName>ALC_ID_FIELD</ipxact:displayName>
<ipxact:description>Sub field of CAN Identifier in which arbitration was lost.</ipxact:description>
<ipxact:bitOffset>5</ipxact:bitOffset>
<ipxact:resets>
<ipxact:reset>
<ipxact:value>0</ipxact:value>
</ipxact:reset>
</ipxact:resets>
<ipxact:bitWidth>3</ipxact:bitWidth>
<ipxact:enumeratedValues>
<ipxact:enumeratedValue>
<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: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: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: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: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:enumeratedValue>
</ipxact:enumeratedValues>
</ipxact:field>
</ipxact:register>
<ipxact:register>
<ipxact:name>EWL</ipxact:name>
......
......@@ -373,7 +373,7 @@ entity core_top is
signal set_transciever : std_logic;
signal set_reciever : std_logic;
signal is_idle : std_logic;
signal alc : std_logic_vector(4 downto 0);
signal alc : std_logic_vector(7 downto 0);
--Transcieve buffer output
signal tran_dlc : std_logic_vector(3 downto 0);
......@@ -1017,7 +1017,8 @@ begin
--STATUS Bus Implementation --
------------------------------
stat_bus(511 downto 370) <= (OTHERS=>'0');
stat_bus(299 downto 289) <= (OTHERS=>'0');
stat_bus(299 downto 297) <= (OTHERS=>'0');
stat_bus(187 downto 183) <= (OTHERS=>'0');
stat_bus(99 downto 90) <= (OTHERS=>'0');
stat_bus(60 downto 32) <= (OTHERS => '0');
......
This diff is collapsed.
......@@ -921,13 +921,24 @@ package CAN_FD_register_map is
------------------------------------------------------------------------------
-- ALC register
--
-- Arbitration lost capture register.
-- Arbitration lost capture register. Determines bit position of last arbitrat
-- ion lost.
------------------------------------------------------------------------------
constant ALC_VAL_L : natural := 8;
constant ALC_VAL_H : natural := 12;
constant ALC_BIT_L : natural := 8;
constant ALC_BIT_H : natural := 12;
constant ALC_ID_FIELD_L : natural := 13;
constant ALC_ID_FIELD_H : natural := 15;
-- "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";
-- ALC register reset values
constant ALC_VAL_RSTVAL : std_logic_vector(4 downto 0) := "00000";
constant ALC_BIT_RSTVAL : std_logic_vector(4 downto 0) := "00000";
constant ALC_ID_FIELD_RSTVAL : std_logic_vector(2 downto 0) := "000";
------------------------------------------------------------------------------
-- TRV_DELAY register
......
......@@ -591,7 +591,7 @@ package CANcomponents is
signal drv_bus : in std_logic_vector(1023 downto 0);
signal int_loop_back_ena : out std_logic;
signal PC_State_out : out protocol_type;
signal alc : out std_logic_vector(4 downto 0);
signal alc : out std_logic_vector(7 downto 0);
signal tran_data : in std_logic_vector(31 downto 0);
signal tran_dlc : in std_logic_vector(3 downto 0);
signal tran_is_rtr : in std_logic;
......
......@@ -657,8 +657,8 @@ package CANconstants is
constant STAT_REC_TRIG : natural := 182;
--Arbitration lost capture
constant STAT_ALC_HIGH : natural := 187;
constant STAT_ALC_LOW : natural := 183;
constant STAT_ALC_HIGH : natural := 296;
constant STAT_ALC_LOW : natural := 289;
--Bus traffic registers
constant STAT_RX_CTR_HIGH : natural := 219;
......
......@@ -1498,7 +1498,7 @@ begin
data_out_int <= (OTHERS =>'0');
data_out_int(7 downto 0)
<= stat_bus(STAT_ERC_HIGH downto STAT_ERC_LOW);
data_out_int(ALC_VAL_H downto ALC_VAL_L)
data_out_int(ALC_ID_FIELD_H downto ALC_BIT_L)
<= stat_bus(STAT_ALC_HIGH downto STAT_ALC_LOW);
-------------------------------------------------------
......
......@@ -104,4 +104,8 @@ set_global_assignment -name VHDL_FILE ../../src/Buffers_Message_Handling/message
set_global_assignment -name VHDL_FILE ../../src/ID_transfer.vhd
set_global_assignment -name VHDL_FILE ../../src/CAN_top_level.vhd
set_global_assignment -name TCL_SCRIPT_FILE ../../scripts/resource_benchmark.tcl
set_global_assignment -name OPTIMIZATION_MODE "HIGH PERFORMANCE EFFORT"
set_global_assignment -name STATE_MACHINE_PROCESSING "ONE-HOT"
set_global_assignment -name REMOVE_REDUNDANT_LOGIC_CELLS ON
set_global_assignment -name AUTO_RESOURCE_SHARING ON
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
\ No newline at end of file
......@@ -213,7 +213,7 @@ architecture Protocol_Control_unit_test of CAN_test is
signal set_reciever_1 : std_logic;
-- Arbitration lost capture
signal alc_1 : std_logic_vector(4 downto 0);
signal alc_1 : std_logic_vector(7 downto 0);
-- Fault confinement state
signal error_state_1 : error_state_type;
......@@ -379,7 +379,7 @@ architecture Protocol_Control_unit_test of CAN_test is
signal set_reciever_2 : std_logic;
-- Arbitration lost capture
signal alc_2 : std_logic_vector(4 downto 0);
signal alc_2 : std_logic_vector(7 downto 0);
-- Fault confinement state
signal error_state_2 : error_state_type;
......
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