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

Back to ROD documentation
ttc_chan_regs.vhd
1 ----------------------------------------------------------------------------------
2 -- Company:
3 -- Engineer:
4 --
5 -- Create Date: 09.10.2019 18:51:12
6 -- Design Name:
7 -- Module Name: ttc_chan_regs - 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 use IEEE.NUMERIC_STD.ALL;
25 use IEEE.STD_LOGIC_UNSIGNED.ALL;
26 use work.ipbus.all;
27 use work.ipbus_decode_L1CaloHubRodTTCRegisters.all;
28 
29 
30 -- Uncomment the following library declaration if using
31 -- arithmetic functions with Signed or Unsigned values
32 --use IEEE.NUMERIC_STD.ALL;
33 
34 -- Uncomment the following library declaration if instantiating
35 -- any Xilinx leaf cells in this code.
36 --library UNISIM;
37 --use UNISIM.VComponents.all;
38 
39 entity ttc_chan_regs is
40  Port (
41  ipb_clk : in std_logic;
42  ipb_rst : in std_logic;
43  ipb_in : in ipb_wbus;
44  ipb_out : out ipb_rbus;
45 
46  pp_clock : in std_logic;
47  clk_125 : in std_logic;
48 -- time_count : in STD_LOGIC_VECTOR (31 downto 0); --synchronous to the pp_clock
49  ttc_chan_stat : in STD_LOGIC_VECTOR (31 downto 0);
50  ttc_fifo_level : in STD_LOGIC_VECTOR (15 downto 0); --synchronous to the pp_clock
51  L1ID_error : in std_logic;
52  CTTC_CRC_error : in std_logic;
53  cttc_user_clk : in std_logic;
54  seq : in STD_LOGIC_VECTOR(1 DOWNTO 0);
55  L1A : in std_logic;
56  ttc_reset : out std_logic;
57  hub_link_reset : out std_logic;
58  ttc_ignore : out std_logic;
59  TTC_CRC_ignore : out std_logic;
60  TTC_fifo_rst : out std_logic;
61  header_sequence : out STD_LOGIC_VECTOR (11 downto 0);
62  header_type : out STD_LOGIC_VECTOR (3 downto 0);
63  det_spec_evnt_sel : out STD_LOGIC_VECTOR (3 downto 0);
64  ttc_reg : in STD_LOGIC_VECTOR(63 DOWNTO 0);
65  event_sel : out STD_LOGIC_VECTOR (2 downto 0);
66  event_count : in STD_LOGIC_VECTOR(31 DOWNTO 0);
67  orbit_count : in STD_LOGIC_VECTOR(15 DOWNTO 0);
68  flx_backpressure : in std_logic_vector(11 downto 0);
69  event_count_reset : out std_logic;
70  orbit_count_reset : out std_logic;
71  bcn_adjustment : out std_logic_vector(11 downto 0);
72 
73  l1id_continuity_control : out std_logic_vector(31 downto 0);
74  l1id_continuity_status : in STD_LOGIC_vector (31 downto 0);
75  l1id_local_miss : in STD_LOGIC_vector (31 downto 0);
76  l1id_ttc_miss : in STD_LOGIC_vector (31 downto 0);
77  l1id_error_count : in STD_LOGIC_vector (31 downto 0);
78  timeout_threshold : out std_logic_vector(31 downto 0);
79  repeat_counter : in STD_LOGIC_vector(31 downto 0)
80 
81  );
82 end ttc_chan_regs;
83 
84 architecture RTL of ttc_chan_regs is
85 
86 COMPONENT ttc_regs_ila
87 
88 PORT (
89  clk : IN STD_LOGIC;
90  probe0 : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
91  probe1 : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
92  probe2 : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
93  probe3 : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
94  probe4 : IN STD_LOGIC_VECTOR(15 DOWNTO 0)
95 );
96 END COMPONENT ;
97 
98 
99 signal ipbw: ipb_wbus_array(N_SLAVES - 1 downto 0);
100 signal ipbr: ipb_rbus_array(N_SLAVES - 1 downto 0);
101 
102 signal ttc_rst_stb : std_logic;
103 signal ttc_reset_reg : std_logic_vector (31 downto 0);
104 signal ttc_rst_rst : std_logic;
105 signal ccc_rst_stb : std_logic;
106 signal ccc_rst_rst : std_logic;
107 
108 signal ttc_fifo_control : std_logic_vector (31 downto 0);
109 signal TTC_fifo_status : std_logic_vector (31 downto 0);
110 signal TTC_fifo_fill_level : std_logic_vector (31 downto 0);
111 signal TTC_fifo_busy_Count : std_logic_vector (31 downto 0);
112 signal ttc_fifo_busy_threshold : STD_LOGIC_VECTOR (31 downto 0);
113 signal CTTC_link_status : STD_LOGIC_VECTOR (31 downto 0);
114 
115 signal BCN : STD_LOGIC_VECTOR (31 downto 0);
116 signal L1ID : STD_LOGIC_VECTOR (23 downto 0);
117 signal ECRID : STD_LOGIC_VECTOR (7 downto 0);
118 signal rxdisperr : std_logic;
119 signal rxnotintable : std_logic;
120 signal rxresetdone : std_logic;
121 signal cpllfbclklost : std_logic;
122 signal cplllock : std_logic;
123 signal rxfsmresetdone : std_logic;
124 signal cpllrefclklost : std_logic;
125 signal disp_err_count : STD_LOGIC_VECTOR (7 downto 0);
126 signal table_err_count : STD_LOGIC_VECTOR (7 downto 0);
127 signal crc_error_count : STD_LOGIC_VECTOR (7 downto 0);
128 
129 signal ttc_watermark_reset : std_logic;
130 signal ttc_watermark : std_logic_vector (15 downto 0);
131 signal ttc_control : std_logic_vector (31 downto 0);
132 signal pkt_hdr_info : std_logic_vector (31 downto 0);
133 
134 signal run_event_count_reset : std_logic;
135 signal event_count_reset_i : std_logic;
136 signal orbit_count_reset_i : std_logic;
137 signal run_event_count : std_logic_vector (35 downto 0);
138 signal bcn_adjust_i : std_logic_vector(31 downto 0);
139 signal cpll_lock_delay_1 : std_logic;
140 signal cpll_lock_delay_2 : std_logic;
141 signal cpll_lock_lost : std_logic;
142 
143 begin
144 
145  fabric: entity work.ipbus_fabric_sel
146  generic map(
147  NSLV => N_SLAVES,
148  SEL_WIDTH => IPBUS_SEL_WIDTH)
149  port map(
150  ipb_in => ipb_in,
151  ipb_out => ipb_out,
152  sel => ipbus_sel_L1CaloHubRodTTCRegisters(ipb_in.ipb_addr),
153  ipb_to_slaves => ipbw,
154  ipb_from_slaves => ipbr
155  );
156 
157 
158  BCN(11 downto 0) <= ttc_reg(11 downto 0);
159  BCN(31 downto 12) <= (others => '0');
160  L1ID <= ttc_reg(35 downto 12);
161 ECRID <= ttc_reg(43 downto 36);
162 
163 
164 cpllrefclklost <= ttc_chan_stat(6);
165 rxdisperr <= ttc_chan_stat(5);
166 rxnotintable <= ttc_chan_stat(4);
167 rxresetdone <= ttc_chan_stat(3);
168 cpllfbclklost <= ttc_chan_stat(2);
169 cplllock <= ttc_chan_stat(1);
170 rxfsmresetdone <= ttc_chan_stat(0);
171 
172 
173 process (clk_125) begin --sample with clk125 because it's independent of potentially failing ro_user_clk
174  if rising_edge (clk_125) then
175  cpll_lock_delay_1 <= cplllock;
176  cpll_lock_delay_2 <= cpll_lock_delay_1;
177  end if;
178 end process;
179 
180 process (clk_125) begin --sample with clk125 because it's independent of potentially failing ro_user_clk
181  if rising_edge (clk_125) then
182  if (ttc_reset_reg(2) = '1') then
183  cpll_lock_lost <= '0';
184  elsif (cpll_lock_delay_1 = '0') and (cpll_lock_delay_2 = '1') then --this is falling edge of cplllock
185  cpll_lock_lost <= '1';
186  else
187  cpll_lock_lost <= cpll_lock_lost;
188  end if;
189  end if;
190  end process;
191 
192 TTC_fifo_control_reg: entity work.ipbus_reg_v
193  port map(
194  clk => ipb_clk,
195  reset => ipb_rst,
196  ipbus_in => ipbw(N_SLV_TTC_fifo_control),
197  ipbus_out => ipbr(N_SLV_TTC_fifo_control),
198  q(0) => ttc_fifo_control
199  );
200 -- 0: busy enable
201 -- 1: xoff enable
202 -- these bits need to be enable future busy and xoff outputs
203 
204 
205 TTC_reset_register: entity work.ipbus_reg_v
206  port map(
207  clk => ipb_clk,
208  reset => ttc_rst_rst,
209  ipbus_in => ipbw(N_SLV_TTC_reset),
210  ipbus_out => ipbr(N_SLV_TTC_reset),
211  stb(0) => ttc_rst_stb,
212  q(0) => ttc_reset_reg
213  );
214 ttc_rst_rst <= ttc_rst_stb or ipb_rst;
215 
216 ttc_fifo_rst <= ttc_reset_reg(0);
217 
218 TTC_fifo_status_reg: entity work.ipbus_syncreg_v
219  generic map (
220  N_CTRL => 0,
221  N_STAT => 1
222  )
223  port map (
224  clk => ipb_clk,
225  rst => ipb_rst,
226  ipb_in => ipbw(N_SLV_TTC_fifo_status),
227  ipb_out => ipbr(N_SLV_TTC_fifo_status),
228  slv_clk => pp_clock,
229  d(0) => TTC_fifo_status,
230  qmask => (others => (others => '1')),
231  stb => open,
232  rstb => open
233  );
234 
235 TTC_fifo_status(0) <= '1' WHEN (ttc_fifo_level > x"fff") ELSE '0';
236 TTC_fifo_status(1) <= '1' WHEN (ttc_fifo_level > ttc_fifo_busy_threshold) ELSE '0';
237 --TTC_fifo_status(2) <= '1' WHEN (ttc_fifo_level > ttc_fifo_xoff_threshold) ELSE '0';
238 
239 
240 
241 TTC_fifo_fill_level_reg : entity work.ipbus_syncreg_v
242  generic map (
243  N_CTRL => 0,
244  N_STAT => 1
245  )
246  port map (
247  clk => ipb_clk,
248  rst => ipb_rst,
249  ipb_in => ipbw(N_SLV_TTC_fifo_fill_level),
250  ipb_out => ipbr(N_SLV_TTC_fifo_fill_level),
251  slv_clk => pp_clock,
252  d(0) => TTC_fifo_fill_level,
253  qmask => (others => (others => '1')),
254  stb => open,
255  rstb => open
256  );
257 
258 TTC_fifo_fill_level(15 downto 0) <= ttc_fifo_level;
259 TTC_fifo_fill_level(31 downto 16) <= ttc_watermark;
260 
261 ttc_fifo_watermark : entity work.watermark
262  generic map (
263  watermark_width => 16
264  )
265  port map (
266  clock => pp_clock,
267  level => ttc_fifo_level,
268  reset => ttc_watermark_reset,
269  watermark => ttc_watermark
270  );
271 
272 ttc_watermark_reset <= (ipb_rst or ttc_reset_reg(1));
273 
274 
275 
276 
277 
278 
279 TTC_fifo_busy_Count_reg : entity work.ipbus_syncreg_v
280  generic map (
281  N_CTRL => 0,
282  N_STAT => 1
283  )
284  port map (
285  clk => ipb_clk,
286  rst => ipb_rst,
287  ipb_in => ipbw(N_SLV_TTC_fifo_busy_count),
288  ipb_out => ipbr(N_SLV_TTC_fifo_busy_count),
289  slv_clk => pp_clock,
290  d(0) => TTC_fifo_busy_count,
291  qmask => (others => (others => '1')),
292  stb => open,
293  rstb => open
294  );
295 
296  ttc_fifo_busy_counter: entity work.threshold_counter
297  port map (
298  clock => pp_clock,
299  reset => ttc_reset_reg(2),
300  threshold => ttc_fifo_busy_threshold(15 downto 0),
301  level => ttc_fifo_level,
302  above_count => TTC_fifo_busy_Count
303  );
304 
305 
306 felix_backpressure_reg : entity work.ipbus_syncreg_v
307  generic map (
308  N_CTRL => 0,
309  N_STAT => 1
310  )
311  port map (
312  clk => ipb_clk,
313  rst => ipb_rst,
314  ipb_in => ipbw(N_SLV_FELIX_BACKPRESSURE),
315  ipb_out => ipbr(N_SLV_FELIX_BACKPRESSURE),
316  slv_clk => pp_clock,
317  d(0) => (x"00000" & flx_backpressure),
318  qmask => (others => (others => '1')),
319  stb => open,
320  rstb => open
321  );
322 
323 
324 
325 
326 TTC_fifo_busy_threshold_reg: entity work.ipbus_reg_v
327  port map(
328  clk => ipb_clk,
329  reset => ipb_rst,
330  ipbus_in => ipbw(N_SLV_TTC_FIFO_BUSY_THRESHOLD),
331  ipbus_out => ipbr(N_SLV_TTC_FIFO_BUSY_THRESHOLD),
332  q(0) => TTC_FIFO_BUSY_THRESHOLD
333  );
334 
335 L1ID_Value_reg : entity work.ipbus_syncreg_v
336  generic map (
337  N_CTRL => 0,
338  N_STAT => 1
339  )
340  port map (
341  clk => ipb_clk,
342  rst => ipb_rst,
343  ipb_in => ipbw(N_SLV_TTC_L1ID),
344  ipb_out => ipbr(N_SLV_TTC_L1ID),
345  slv_clk => cttc_user_clk,
346  d(0) => ttc_reg(43 downto 12), --(L1ID & ECRID),
347  qmask => (others => (others => '1')),
348  stb => open,
349  rstb => open
350  );
351 
352 BCN_reg : entity work.ipbus_syncreg_v
353  generic map (
354  N_CTRL => 0,
355  N_STAT => 1
356  )
357  port map (
358  clk => ipb_clk,
359  rst => ipb_rst,
360  ipb_in => ipbw(N_SLV_TTC_BCN),
361  ipb_out => ipbr(N_SLV_TTC_BCN),
362  slv_clk => cttc_user_clk,
363  d(0) => BCN,
364  qmask => (others => (others => '1')),
365  stb => open,
366  rstb => open
367  );
368 
369 bcn_adjust_reg : entity work.ipbus_reg_v
370  port map(
371  clk => ipb_clk,
372  reset => ipb_rst,
373  ipbus_in => ipbw(N_SLV_BCN_ADJUST),
374  ipbus_out => ipbr(N_SLV_BCN_ADJUST),
375  q(0) => bcn_adjust_i
376  );
377 
378 BCN_adjustment <= bcn_adjust_i(11 downto 0);
379 
380 CTTC_link_stat_reg : entity work.ipbus_syncreg_v
381  generic map (
382  N_CTRL => 0,
383  N_STAT => 1
384  )
385  port map (
386  clk => ipb_clk,
387  rst => ipb_rst,
388  ipb_in => ipbw(N_SLV_CTTC_link_stat),
389  ipb_out => ipbr(N_SLV_CTTC_link_stat),
390  slv_clk => cttc_user_clk,
391  d(0) => CTTC_link_status,
392  qmask => (others => (others => '1')),
393  stb => open,
394  rstb => open
395  );
396 
397 
398 TTC_control_reg: entity work.ipbus_reg_v
399  port map(
400  clk => ipb_clk,
401  reset => ipb_rst,
402  ipbus_in => ipbw(N_SLV_TTC_control),
403  ipbus_out => ipbr(N_SLV_TTC_control),
404  q(0) => ttc_control
405  );
406 
407 TTC_ignore <= ttc_control(0);
408 TTC_CRC_ignore <= ttc_control(1);
409 event_sel(2 downto 0) <= ttc_control(6 downto 4);
410 
411 packet_header_info: entity work.ipbus_reg_v
412  port map(
413  clk => ipb_clk,
414  reset => ipb_rst,
415  ipbus_in => ipbw(N_SLV_Packet_Header_Info),
416  ipbus_out => ipbr(N_SLV_Packet_Header_Info),
417  q(0) => pkt_hdr_info
418  );
419 
420 header_sequence <= pkt_hdr_info(15 downto 4);
421 header_type <= pkt_hdr_info(3 downto 0);
422 det_spec_evnt_sel<= pkt_hdr_info(19 downto 16);
423 
424 
425 
426 
427 
428 
429 total_event_count_reg : entity work.ipbus_syncreg_v
430  generic map (
431  N_CTRL => 0,
432  N_STAT => 1
433  )
434  port map (
435  clk => ipb_clk,
436  rst => run_event_count_reset,
437  ipb_in => ipbw(N_SLV_total_event_count),
438  ipb_out => ipbr(N_SLV_total_event_count),
439  slv_clk => cttc_user_clk,
440  d(0) => run_event_count(31 downto 0),
441  qmask => (others => (others => '1')),
442  stb => open,
443  rstb => open
444  );
445 
446 total_event_count_msb : entity work.ipbus_syncreg_v
447  generic map (
448  N_CTRL => 0,
449  N_STAT => 1
450  )
451  port map (
452  clk => ipb_clk,
453  rst => run_event_count_reset,
454  ipb_in => ipbw(N_SLV_total_event_count_msb),
455  ipb_out => ipbr(N_SLV_total_event_count_msb),
456  slv_clk => cttc_user_clk,
457  d(0) => x"0000000" & run_event_count (35 downto 32),
458  qmask => (others => (others => '1')),
459  stb => open,
460  rstb => open
461  );
462 
463 event_count_reg : entity work.ipbus_syncreg_v
464  generic map (
465  N_CTRL => 0,
466  N_STAT => 1
467  )
468  port map (
469  clk => ipb_clk,
470  rst => event_count_reset,
471  ipb_in => ipbw(N_SLV_event_count),
472  ipb_out => ipbr(N_SLV_event_count),
473  slv_clk => cttc_user_clk,
474  d(0) => event_count(31 downto 0),
475 -- d(0) => event_count,
476  qmask => (others => (others => '1')),
477  stb => open,
478  rstb => open
479  );
480 
481 
482 
483 
484 
485 orbit_reg : entity work.ipbus_syncreg_v
486  generic map (
487  N_CTRL => 0,
488  N_STAT => 1
489  )
490  port map (
491  clk => ipb_clk,
492  rst => orbit_count_reset,
493  ipb_in => ipbw(N_SLV_orbit),
494  ipb_out => ipbr(N_SLV_orbit),
495  slv_clk => cttc_user_clk,
496  d(0) => x"0000" & orbit_count ,
497  qmask => (others => (others => '1')),
498  stb => open,
499  rstb => open
500  );
501 
502 
503 event_count_reset <= ttc_reset_reg(8) or ipb_rst;
504 run_event_count_reset <= ttc_reset_reg(9) or ipb_rst;
505 orbit_count_reset <= ttc_reset_reg(10) or ipb_rst;
506 
507 -- run total event counter - not reset by ECR: provides event count for entire run
508 
509 --process (cttc_user_clk) begin
510 process (cttc_user_clk, run_event_count_reset) begin
511  if (run_event_count_reset = '1') then
512  run_event_count <= X"000000000";
513  elsif rising_edge (cttc_user_clk) then
514  if (L1A = '1') and (seq = "01") then
515  run_event_count <= (run_event_count + 1);
516  else
517  run_event_count <= run_event_count;
518  end if;
519  end if;
520 end process;
521 
522 
523 --event_count_ila : ttc_regs_ila
524 --PORT MAP (
525 -- clk => cttc_user_clk,
526 -- probe0 => seq,
527 -- probe1(0) => L1A,
528 -- probe2(0) => event_count_reset,
529 -- probe3(0) => '0',
530 -- probe4 => X"0" & event_count(11 downto 0)
531 --);
532 
533 
534 
535 
536 
537 -- disperity_err_counter:
538 
539 disperity_err_counter: entity work.error_counter
540  generic map (
541  cwidth => 8
542  )
543  port map (
544  clock => cttc_user_clk,
545  counter_reset => ttc_reset_reg(2),
546  system_reset => ipb_rst,
547  error => rxdisperr,
548  error_count => disp_err_count
549  );
550 
551  table_err_counter: entity work.error_counter
552  generic map (
553  cwidth => 8
554  )
555  port map (
556  clock => cttc_user_clk,
557  counter_reset => ttc_reset_reg(2),
558  system_reset => ipb_rst,
559  error => rxnotintable,
560  error_count => table_err_count
561  );
562 
563 
564 
565 CTTC_link_status <= crc_error_count & disp_err_count & table_err_count & "00" & cpll_lock_lost & cpllrefclklost & cplllock & cpllfbclklost & rxresetdone & rxfsmresetdone;
566 
567 ttc_reset <= ttc_reset_reg(4);
568 hub_link_reset <= ttc_reset_reg(5);
569 
570  crc_err_counter: entity work.error_counter
571  generic map (
572  cwidth => 8
573  )
574  port map (
575  clock => cttc_user_clk,
576  counter_reset => ttc_reset_reg(2),
577  system_reset => ipb_rst,
578  error => CTTC_CRC_error,
579  error_count => crc_error_count
580 
581  );
582 --crc_error_count <= x"00"; --place holder
583 
584 L1id_Continuity_Capture_Control: entity work.ipbus_reg_v
585  port map(
586  clk => ipb_clk,
587  reset => ccc_rst_rst,
588  ipbus_in => ipbw(N_SLV_L1id_Continuity_Capture_Control),
589  ipbus_out => ipbr(N_SLV_L1id_Continuity_Capture_Control),
590  stb(0) => ccc_rst_stb,
591  q(0) => l1id_continuity_control
592  );
593 ccc_rst_rst <= ccc_rst_stb or ipb_rst;
594 
595 
596 L1id_Capture_Status_reg: entity work.ipbus_syncreg_v
597  generic map (
598  N_CTRL => 0,
599  N_STAT => 1
600  )
601  port map (
602  clk => ipb_clk,
603  rst => ipb_rst,
604  ipb_in => ipbw(N_SLV_L1ID_CAPTURE_STATUS),
605  ipb_out => ipbr(N_SLV_L1ID_CAPTURE_STATUS),
606  slv_clk => cttc_user_clk,
607  d(0) => l1id_continuity_status,
608  qmask => (others => (others => '1')),
609  stb => open,
610  rstb => open
611  );
612 
613 Local_Counter_Miss_reg: entity work.ipbus_syncreg_v
614  generic map (
615  N_CTRL => 0,
616  N_STAT => 1
617  )
618  port map (
619  clk => ipb_clk,
620  rst => ipb_rst,
621  ipb_in => ipbw(N_SLV_LOCAL_COUNTER_MISS),
622  ipb_out => ipbr(N_SLV_LOCAL_COUNTER_MISS),
623  slv_clk => cttc_user_clk,
624  d(0) => l1id_local_miss,
625  qmask => (others => (others => '1')),
626  stb => open,
627  rstb => open
628  );
629 
630 TTC_Miss_reg: entity work.ipbus_syncreg_v
631  generic map (
632  N_CTRL => 0,
633  N_STAT => 1
634  )
635  port map (
636  clk => ipb_clk,
637  rst => ipb_rst,
638  ipb_in => ipbw(N_SLV_TTC_MISS),
639  ipb_out => ipbr(N_SLV_TTC_MISS),
640  slv_clk => cttc_user_clk,
641  d(0) => l1id_ttc_miss,
642  qmask => (others => (others => '1')),
643  stb => open,
644  rstb => open
645  );
646 
647 Mismatch_err_reg: entity work.ipbus_syncreg_v
648  generic map (
649  N_CTRL => 0,
650  N_STAT => 1
651  )
652  port map (
653  clk => ipb_clk,
654  rst => ipb_rst,
655  ipb_in => ipbw(N_SLV_MISMATCH_ERROR_COUNT),
656  ipb_out => ipbr(N_SLV_MISMATCH_ERROR_COUNT),
657  slv_clk => cttc_user_clk,
658  d(0) => l1id_error_count,
659  qmask => (others => (others => '1')),
660  stb => open,
661  rstb => open
662  );
663 
664 Timeout_threshold_reg: entity work.ipbus_reg_v
665  port map(
666  clk => ipb_clk,
667  reset => ipb_rst,
668  ipbus_in => ipbw(N_SLV_TIMEOUT_THRESHOLD),
669  ipbus_out => ipbr(N_SLV_TIMEOUT_THRESHOLD),
670  q(0) => timeout_threshold
671  );
672 
673 Duplicate_L1ID_Count_reg: entity work.ipbus_syncreg_v
674  generic map (
675  N_CTRL => 0,
676  N_STAT => 1
677  )
678  port map (
679  clk => ipb_clk,
680  rst => ipb_rst,
681  ipb_in => ipbw(N_SLV_DUPLICATE_L1ID_COUNT),
682  ipb_out => ipbr(N_SLV_DUPLICATE_L1ID_COUNT),
683  slv_clk => cttc_user_clk,
684  d(0) => repeat_counter,
685  qmask => (others => (others => '1')),
686  stb => open,
687  rstb => open
688  );
689 
690 end RTL;