ROD firmware  1.0.5
ATLAS l1-calo - ROD_eFEX and ROD_jFEX firmware for the L1Calo ROD board

Back to ROD documentation
fex_rx_checker.vhd
1 ----------------------------------------------------------------------------------
2 -- Company:
3 -- Engineer:
4 --
5 -- Create Date: 01.04.2022 14:17:38
6 -- Design Name:
7 -- Module Name: fex_rx_checker - RTL
8 -- Project Name:
9 -- Target Devices:
10 -- Tool Versions:
11 -- Description:
12 --
13 -- Dependencies:
14 --
15 -- Revision:
16 -- Revision 0.01 - File Created
17 -- Additional Comments:
18 --
19 ----------------------------------------------------------------------------------
20 
21 
22 library IEEE;
23 use IEEE.STD_LOGIC_1164.ALL;
24 
25 -- Uncomment the following library declaration if using
26 -- arithmetic functions with Signed or Unsigned values
27 --use IEEE.NUMERIC_STD.ALL;
28 
29 -- Uncomment the following library declaration if instantiating
30 -- any Xilinx leaf cells in this code.
31 --library UNISIM;
32 --use UNISIM.VComponents.all;
33 
34 entity fex_rx_checker is
35  Port ( clock : in STD_LOGIC;
36  reset : in STD_LOGIC;
37  tvalid : in STD_LOGIC;
38  tlast : in STD_LOGIC;
39  tdata : in STD_logic_vector(63 downto 0);
40  channel_up : in STD_LOGIC;
41  soft_error : in STD_LOGIC;
42  hard_error : in STD_LOGIC;
43  L1A : in STD_LOGIC;
44  l1id_mis_stretch : in std_logic
45  );
46 end fex_rx_checker;
47 
48 architecture RTL of fex_rx_checker is
49 
50 component backplane_crc is
51  generic (
52  fex_check : integer := 0;
53  crc20_G_Poly : std_logic_vector(19 downto 0) := x"8349f" --old poly
54  );
55  Port (
56  clock : in std_logic;
57  reset : in std_logic;
58  s_tvalid : in std_logic;
59  s_tlast : in std_logic;
60  s_tdata : in std_logic_vector(63 downto 0);
61  header_error : out std_logic;
62  payload_error : out std_logic;
63  length_error : out std_logic
64  );
65 end component;
66 
67 COMPONENT chan_crc_ila
68 
69 PORT (
70  clk : IN STD_LOGIC;
71  probe0 : IN STD_LOGIC_VECTOR(63 DOWNTO 0);
72  probe1 : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
73  probe2 : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
74  probe3 : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
75  probe4 : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
76  probe5 : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
77  probe6 : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
78  probe7 : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
79  probe8 : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
80  probe9 : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
81  probe10 : IN STD_LOGIC_VECTOR(0 DOWNTO 0)
82 );
83 END COMPONENT ;
84 
85 signal header_crc9_error : std_logic;
86 signal payload_crc20_error : std_logic;
87 signal length_error : std_logic;
88 signal L1A_sync_cdc_to : std_logic;
89 signal L1A_sync2 : std_logic;
90 
91 ATTRIBUTE async_reg : STRING;
92 ATTRIBUTE async_reg of L1A_sync_cdc_to : SIGNAL IS "true";
93 
94 begin
95 
96 
97 crc_checker : backplane_crc
98  generic map (
99  fex_check => 1,
100  crc20_G_Poly => x"8359f"
101  )
102  Port map(
103  clock => clock,
104  reset => reset,
105  s_tvalid => tvalid,
106  s_tlast => tlast,
107  s_tdata => tdata,
108  header_error => header_crc9_error,
109  payload_error => payload_crc20_error,
110  length_error => length_error
111  );
112 
113 
114 ila_crc_check : chan_crc_ila
115  port map (
116  clk => clock,
117  probe0 => tdata,
118  probe1(0) => tvalid,
119  probe2(0) => tlast,
120  probe3(0) => channel_up,
121  probe4(0) => header_crc9_error,
122  probe5(0) => payload_crc20_error,
123  probe6(0) => length_error,
124  probe7(0) => soft_error,
125  probe8(0) => hard_error,
126  probe9(0) => L1A_sync2,
127  probe10(0) => l1id_mis_stretch
128  );
129 
130 
131 process (clock) begin
132  if rising_edge(clock) then
133  L1A_sync_cdc_to <= L1A;
134  L1A_sync2 <= L1A_sync_cdc_to;
135  end if;
136 end process;
137 
138 
139 
140 
141 
142 end RTL;