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

Back to ROD documentation
channel_mux.vhd
1 ----------------------------------------------------------------------------------
2 -- Company:
3 -- Engineer:
4 --
5 -- Create Date: 08.02.2017 18:39:26
6 -- Design Name:
7 -- Module Name: channel_mux - 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 use IEEE.STD_LOGIC_UNSIGNED.ALL;
29 
30 -- Uncomment the following library declaration if instantiating
31 -- any Xilinx leaf cells in this code.
32 --library UNISIM;
33 --use UNISIM.VComponents.all;
34 
35 entity channel_mux is
36  generic (
37 
38  bp_width : integer := 64
39  );
40 
41  Port (
42  clock : in STD_LOGIC;
43  reset : in STD_LOGIC;
44  chan_pointer_reset : in STD_LOGIC;
45 
46  s_tdata_0 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
47  s_tvalid_0 : in STD_LOGIC;
48  s_tlast_0 : in STD_LOGIC;
49  s_tready_0 : out STD_LOGIC;
50  s_header_mark_0 : in STD_LOGIC;
51  s_trailer_mark_0 : in STD_LOGIC;
52  s_hdr_crc_tag_0 : in STD_LOGIC;
53  s_poll_chan_0 : out STD_LOGIC;
54  s_chan_enable_0 : in STD_LOGIC;
55 
56  s_tdata_1 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
57  s_tvalid_1 : in STD_LOGIC;
58  s_tlast_1 : in STD_LOGIC;
59  s_tready_1 : out STD_LOGIC;
60  s_header_mark_1 : in STD_LOGIC;
61  s_trailer_mark_1 : in STD_LOGIC;
62  s_hdr_crc_tag_1 : in STD_LOGIC;
63  s_poll_chan_1 : out STD_LOGIC;
64  s_chan_enable_1 : in STD_LOGIC;
65 
66 
67  s_tdata_2 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
68  s_tvalid_2 : in STD_LOGIC;
69  s_tlast_2 : in STD_LOGIC;
70  s_tready_2 : out STD_LOGIC;
71  s_header_mark_2 : in STD_LOGIC;
72  s_trailer_mark_2 : in STD_LOGIC;
73  s_hdr_crc_tag_2 : in STD_LOGIC;
74  s_poll_chan_2 : out STD_LOGIC;
75  s_chan_enable_2 : in STD_LOGIC;
76 
77  s_tdata_3 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
78  s_tvalid_3 : in STD_LOGIC;
79  s_tlast_3 : in STD_LOGIC;
80  s_tready_3 : out STD_LOGIC;
81  s_header_mark_3 : in STD_LOGIC;
82  s_trailer_mark_3 : in STD_LOGIC;
83  s_hdr_crc_tag_3 : in STD_LOGIC;
84  s_poll_chan_3 : out STD_LOGIC;
85  s_chan_enable_3 : in STD_LOGIC;
86 
87  s_tdata_4 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
88  s_tvalid_4 : in STD_LOGIC;
89  s_tlast_4 : in STD_LOGIC;
90  s_tready_4 : out STD_LOGIC;
91  s_header_mark_4 : in STD_LOGIC;
92  s_trailer_mark_4 : in STD_LOGIC;
93  s_hdr_crc_tag_4 : in STD_LOGIC;
94  s_poll_chan_4 : out STD_LOGIC;
95  s_chan_enable_4 : in STD_LOGIC;
96 
97  s_tdata_5 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
98  s_tvalid_5 : in STD_LOGIC;
99  s_tlast_5 : in STD_LOGIC;
100  s_tready_5 : out STD_LOGIC;
101  s_header_mark_5 : in STD_LOGIC;
102  s_trailer_mark_5 : in STD_LOGIC;
103  s_hdr_crc_tag_5 : in STD_LOGIC;
104  s_poll_chan_5 : out STD_LOGIC;
105  s_chan_enable_5 : in STD_LOGIC;
106 
107  s_tdata_6 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
108  s_tvalid_6 : in STD_LOGIC;
109  s_tlast_6 : in STD_LOGIC;
110  s_tready_6 : out STD_LOGIC;
111  s_header_mark_6 : in STD_LOGIC;
112  s_trailer_mark_6 : in STD_LOGIC;
113  s_hdr_crc_tag_6 : in STD_LOGIC;
114  s_poll_chan_6 : out STD_LOGIC;
115  s_chan_enable_6 : in STD_LOGIC;
116 
117  s_tdata_7 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
118  s_tvalid_7 : in STD_LOGIC;
119  s_tlast_7 : in STD_LOGIC;
120  s_tready_7 : out STD_LOGIC;
121  s_header_mark_7 : in STD_LOGIC;
122  s_trailer_mark_7 : in STD_LOGIC;
123  s_hdr_crc_tag_7 : in STD_LOGIC;
124  s_poll_chan_7 : out STD_LOGIC;
125  s_chan_enable_7 : in STD_LOGIC;
126 
127  s_tdata_8 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
128  s_tvalid_8 : in STD_LOGIC;
129  s_tlast_8 : in STD_LOGIC;
130  s_tready_8 : out STD_LOGIC;
131  s_header_mark_8 : in STD_LOGIC;
132  s_trailer_mark_8 : in STD_LOGIC;
133  s_hdr_crc_tag_8 : in STD_LOGIC;
134  s_poll_chan_8 : out STD_LOGIC;
135  s_chan_enable_8 : in STD_LOGIC;
136 
137  s_tdata_9 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
138  s_tvalid_9 : in STD_LOGIC;
139  s_tlast_9 : in STD_LOGIC;
140  s_tready_9 : out STD_LOGIC;
141  s_header_mark_9 : in STD_LOGIC;
142  s_trailer_mark_9 : in STD_LOGIC;
143  s_hdr_crc_tag_9 : in STD_LOGIC;
144  s_poll_chan_9 : out STD_LOGIC;
145  s_chan_enable_9 : in STD_LOGIC;
146 
147  s_tdata_10 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
148  s_tvalid_10 : in STD_LOGIC;
149  s_tlast_10 : in STD_LOGIC;
150  s_tready_10 : out STD_LOGIC;
151  s_header_mark_10 : in STD_LOGIC;
152  s_trailer_mark_10 : in STD_LOGIC;
153  s_hdr_crc_tag_10 : in STD_LOGIC;
154  s_poll_chan_10 : out STD_LOGIC;
155  s_chan_enable_10 : in STD_LOGIC;
156 
157  s_tdata_11 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
158  s_tvalid_11 : in STD_LOGIC;
159  s_tlast_11 : in STD_LOGIC;
160  s_tready_11 : out STD_LOGIC;
161  s_header_mark_11 : in STD_LOGIC;
162  s_trailer_mark_11 : in STD_LOGIC;
163  s_hdr_crc_tag_11 : in STD_LOGIC;
164  s_poll_chan_11 : out STD_LOGIC;
165  s_chan_enable_11 : in STD_LOGIC;
166 
167  s_tdata_12 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
168  s_tvalid_12 : in STD_LOGIC;
169  s_tlast_12 : in STD_LOGIC;
170  s_tready_12 : out STD_LOGIC;
171  s_header_mark_12 : in STD_LOGIC;
172  s_trailer_mark_12 : in STD_LOGIC;
173  s_hdr_crc_tag_12 : in STD_LOGIC;
174  s_poll_chan_12 : out STD_LOGIC;
175  s_chan_enable_12 : in STD_LOGIC;
176 
177 
178  s_tdata_13 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
179  s_tvalid_13 : in STD_LOGIC;
180  s_tlast_13 : in STD_LOGIC;
181  s_tready_13 : out STD_LOGIC;
182  s_header_mark_13 : in STD_LOGIC;
183  s_trailer_mark_13 : in STD_LOGIC;
184  s_hdr_crc_tag_13 : in STD_LOGIC;
185  s_poll_chan_13 : out STD_LOGIC;
186  s_chan_enable_13 : in STD_LOGIC;
187 
188  s_tdata_14 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
189  s_tvalid_14 : in STD_LOGIC;
190  s_tlast_14 : in STD_LOGIC;
191  s_tready_14 : out STD_LOGIC;
192  s_header_mark_14 : in STD_LOGIC;
193  s_trailer_mark_14 : in STD_LOGIC;
194  s_hdr_crc_tag_14 : in STD_LOGIC;
195  s_poll_chan_14 : out STD_LOGIC;
196  s_chan_enable_14 : in STD_LOGIC;
197 
198  s_tdata_15 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
199  s_tvalid_15 : in STD_LOGIC;
200  s_tlast_15 : in STD_LOGIC;
201  s_tready_15 : out STD_LOGIC;
202  s_header_mark_15 : in STD_LOGIC;
203  s_trailer_mark_15 : in STD_LOGIC;
204  s_hdr_crc_tag_15 : in STD_LOGIC;
205  s_poll_chan_15 : out STD_LOGIC;
206  s_chan_enable_15 : in STD_LOGIC;
207 
208 
209  s_tdata_16 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
210  s_tvalid_16 : in STD_LOGIC;
211  s_tlast_16 : in STD_LOGIC;
212  s_tready_16 : out STD_LOGIC;
213  s_header_mark_16 : in STD_LOGIC;
214  s_trailer_mark_16 : in STD_LOGIC;
215  s_hdr_crc_tag_16 : in STD_LOGIC;
216  s_poll_chan_16 : out STD_LOGIC;
217  s_chan_enable_16 : in STD_LOGIC;
218 
219  s_tdata_17 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
220  s_tvalid_17 : in STD_LOGIC;
221  s_tlast_17 : in STD_LOGIC;
222  s_tready_17 : out STD_LOGIC;
223  s_header_mark_17 : in STD_LOGIC;
224  s_trailer_mark_17 : in STD_LOGIC;
225  s_hdr_crc_tag_17 : in STD_LOGIC;
226  s_poll_chan_17 : out STD_LOGIC;
227  s_chan_enable_17 : in STD_LOGIC;
228 
229 
230  s_tdata_18 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
231  s_tvalid_18 : in STD_LOGIC;
232  s_tlast_18 : in STD_LOGIC;
233  s_tready_18 : out STD_LOGIC;
234  s_header_mark_18 : in STD_LOGIC;
235  s_trailer_mark_18 : in STD_LOGIC;
236  s_hdr_crc_tag_18 : in STD_LOGIC;
237  s_poll_chan_18 : out STD_LOGIC;
238  s_chan_enable_18 : in STD_LOGIC;
239 
240 
241  s_tdata_19 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
242  s_tvalid_19 : in STD_LOGIC;
243  s_tlast_19 : in STD_LOGIC;
244  s_tready_19 : out STD_LOGIC;
245  s_header_mark_19 : in STD_LOGIC;
246  s_trailer_mark_19 : in STD_LOGIC;
247  s_hdr_crc_tag_19 : in STD_LOGIC;
248  s_poll_chan_19 : out STD_LOGIC;
249  s_chan_enable_19 : in STD_LOGIC;
250 
251 
252  s_tdata_20 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
253  s_tvalid_20 : in STD_LOGIC;
254  s_tlast_20 : in STD_LOGIC;
255  s_tready_20 : out STD_LOGIC;
256  s_header_mark_20 : in STD_LOGIC;
257  s_trailer_mark_20 : in STD_LOGIC;
258  s_hdr_crc_tag_20 : in STD_LOGIC;
259  s_poll_chan_20 : out STD_LOGIC;
260  s_chan_enable_20 : in STD_LOGIC;
261 
262 
263 
264  s_tdata_21 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
265  s_tvalid_21 : in STD_LOGIC;
266  s_tlast_21 : in STD_LOGIC;
267  s_tready_21 : out STD_LOGIC;
268  s_header_mark_21 : in STD_LOGIC;
269  s_trailer_mark_21 : in STD_LOGIC;
270  s_hdr_crc_tag_21 : in STD_LOGIC;
271  s_poll_chan_21 : out STD_LOGIC;
272  s_chan_enable_21 : in STD_LOGIC;
273 
274 
275  s_tdata_22 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
276  s_tvalid_22 : in STD_LOGIC;
277  s_tlast_22 : in STD_LOGIC;
278  s_tready_22 : out STD_LOGIC;
279  s_header_mark_22 : in STD_LOGIC;
280  s_trailer_mark_22 : in STD_LOGIC;
281  s_hdr_crc_tag_22 : in STD_LOGIC;
282  s_poll_chan_22 : out STD_LOGIC;
283  s_chan_enable_22 : in STD_LOGIC;
284 
285  s_tdata_23 : in STD_LOGIC_VECTOR ((bp_width-1) downto 0);
286  s_tvalid_23 : in STD_LOGIC;
287  s_tlast_23 : in STD_LOGIC;
288  s_tready_23 : out STD_LOGIC;
289  s_header_mark_23 : in STD_LOGIC;
290  s_trailer_mark_23 : in STD_LOGIC;
291  s_hdr_crc_tag_23 : in STD_LOGIC;
292  s_poll_chan_23 : out STD_LOGIC;
293  s_chan_enable_23 : in STD_LOGIC;
294 
295 
296 
297 
298 -- scanner : in STD_LOGIC_VECTOR (4 downto 0);
299 
300 
301 --mux axis interface to the event builder(s)
302 -- the same outputs connect to all event builders.
303 -- tready (input) needs seperating
304  m_tdata : out STD_LOGIC_VECTOR ((bp_width-1) downto 0);
305  m_tvalid : out STD_LOGIC;
306  m_tlast : out STD_LOGIC;
307  m_tready : in STD_LOGIC;
308  m_header_mark : out STD_LOGIC;
309  m_trailer_mark : out STD_LOGIC;
310  m_hdr_crc_tag : out STD_LOGIC;
311  m_chan_enable : out STD_LOGIC;
312 
313 
314 --polling interface from the event builder(s)
315  m_poll_chan_0 : in STD_LOGIC;
316 
317  nxt_chan_0 : in STD_LOGIC;
318  nxt_chan_1 : in STD_LOGIC;
319  nxt_chan_2 : in STD_LOGIC;
320  nxt_chan_3 : in STD_LOGIC;
321 
322  current_chan : out STD_LOGIC_VECTOR (4 downto 0);
323 
324  first_chan : in STD_LOGIC_VECTOR (4 downto 0);
325  last_chan : in STD_LOGIC_VECTOR (4 downto 0)
326 
327  );
328 end channel_mux;
329 
330 architecture RTL of channel_mux is
331 
332 component onehot_dec is
333 
334  generic(
335  n : integer := 5;
336  m : integer := 32
337  );
338  Port (
339  bin_in : in STD_LOGIC_VECTOR (n-1 downto 0);
340  oh_out : out STD_LOGIC_VECTOR (m-1 downto 0));
341 
342 end component;
343 
344 
345 
346 
347 
348 
349 signal nxt_chan : std_logic;
350 --signal pointer : bit_vector(3 downto 0) := "0000";
351 --signal pointer : std_logic_vector(15 downto 0) := "0000";
352 signal pointer : std_logic_vector(31 downto 0);
353 
354 --signal pointer_v : std_logic_vector(3 downto 0) := "0000";
355 signal tvalid : std_logic;
356 signal chan_count : std_logic_vector(4 downto 0) := "00000";
357 
358 
359 
360 --pipeline stage
361  --big issue may be tready which will arrive late back at the fifo
362 signal m_tdata_pipe : STD_LOGIC_VECTOR ((bp_width-1) downto 0);
363 signal m_tvalid_pipe : STD_LOGIC;
364 signal m_tlast_pipe : STD_LOGIC;
365  --m_tready : in STD_LOGIC;
366 signal m_header_mark_pipe : STD_LOGIC;
367 signal m_trailer_mark_pipe : STD_LOGIC;
368 signal m_hdr_crc_tag_pipe : STD_LOGIC;
369 
370 signal m_tdata_pipe_reg : STD_LOGIC_VECTOR ((bp_width-1) downto 0);
371 signal m_tvalid_pipe_reg : STD_LOGIC;
372 signal m_tlast_pipe_reg : STD_LOGIC;
373  --m_tready : in STD_LOGIC;
374 signal m_header_mark_pipe_reg : STD_LOGIC;
375 signal m_trailer_mark_pipe_reg : STD_LOGIC;
376 signal m_hdr_crc_tag_pipe_reg : STD_LOGIC;
377 
378 
379 
380 
381 begin
382 
383 
384  nxt_chan <= nxt_chan_0 or nxt_chan_1 or nxt_chan_2 or nxt_chan_3;
385 
386 --pointer needs to be changed to a counter plus binary decoder.
387 -- this is so that the channel number can be broadcast back to the event queues.
388 
389 process (clock) begin
390  if rising_edge (clock) then
391  if ((reset = '1') or (chan_pointer_reset = '1')) then
392  chan_count <= first_chan;
393  elsif (nxt_chan = '1') then
394  if (chan_count = last_chan) then
395  chan_count <= first_chan;
396  else
397  chan_count <= chan_count + '1';
398  end if;
399  else
400  chan_count <= chan_count;
401  end if;
402  end if;
403  end process;
404 
405 current_chan <= chan_count;
406 
407 chan_dec: onehot_dec
408  port map (
409  bin_in => chan_count(4 downto 0),
410  oh_out => pointer
411  );
412 
413 
414  with pointer select
415  m_tdata_pipe <= s_tdata_0 when "00000000000000000000000000000001",
416  s_tdata_1 when "00000000000000000000000000000010",
417  s_tdata_2 when "00000000000000000000000000000100",
418  s_tdata_3 when "00000000000000000000000000001000",
419  s_tdata_4 when "00000000000000000000000000010000",
420  s_tdata_5 when "00000000000000000000000000100000",
421  s_tdata_6 when "00000000000000000000000001000000",
422  s_tdata_7 when "00000000000000000000000010000000",
423  s_tdata_8 when "00000000000000000000000100000000",
424  s_tdata_9 when "00000000000000000000001000000000",
425  s_tdata_10 when "00000000000000000000010000000000",
426  s_tdata_11 when "00000000000000000000100000000000",
427  s_tdata_12 when "00000000000000000001000000000000",
428  s_tdata_13 when "00000000000000000010000000000000",
429  s_tdata_14 when "00000000000000000100000000000000",
430  s_tdata_15 when "00000000000000001000000000000000",
431  s_tdata_16 when "00000000000000010000000000000000",
432  s_tdata_17 when "00000000000000100000000000000000",
433  s_tdata_18 when "00000000000001000000000000000000",
434  s_tdata_19 when "00000000000010000000000000000000",
435  s_tdata_20 when "00000000000100000000000000000000",
436  s_tdata_21 when "00000000001000000000000000000000",
437  s_tdata_22 when "00000000010000000000000000000000",
438  s_tdata_23 when "00000000100000000000000000000000",
439  (others => '-') when others;
440 
441 
442  with pointer select
443  m_tvalid_pipe <= s_tvalid_0 when "00000000000000000000000000000001",
444  s_tvalid_1 when "00000000000000000000000000000010",
445  s_tvalid_2 when "00000000000000000000000000000100",
446  s_tvalid_3 when "00000000000000000000000000001000",
447  s_tvalid_4 when "00000000000000000000000000010000",
448  s_tvalid_5 when "00000000000000000000000000100000",
449  s_tvalid_6 when "00000000000000000000000001000000",
450  s_tvalid_7 when "00000000000000000000000010000000",
451  s_tvalid_8 when "00000000000000000000000100000000",
452  s_tvalid_9 when "00000000000000000000001000000000",
453  s_tvalid_10 when "00000000000000000000010000000000",
454  s_tvalid_11 when "00000000000000000000100000000000",
455  s_tvalid_12 when "00000000000000000001000000000000",
456  s_tvalid_13 when "00000000000000000010000000000000",
457  s_tvalid_14 when "00000000000000000100000000000000",
458  s_tvalid_15 when "00000000000000001000000000000000",
459  s_tvalid_16 when "00000000000000010000000000000000",
460  s_tvalid_17 when "00000000000000100000000000000000",
461  s_tvalid_18 when "00000000000001000000000000000000",
462  s_tvalid_19 when "00000000000010000000000000000000",
463  s_tvalid_20 when "00000000000100000000000000000000",
464  s_tvalid_21 when "00000000001000000000000000000000",
465  s_tvalid_22 when "00000000010000000000000000000000",
466  s_tvalid_23 when "00000000100000000000000000000000",
467 
468 
469 -- (others => '0') when others;
470  '0' when others;
471 
472  with pointer select
473  m_tlast_pipe <= s_tlast_0 when "00000000000000000000000000000001",
474  s_tlast_1 when "00000000000000000000000000000010",
475  s_tlast_2 when "00000000000000000000000000000100",
476  s_tlast_3 when "00000000000000000000000000001000",
477  s_tlast_4 when "00000000000000000000000000010000",
478  s_tlast_5 when "00000000000000000000000000100000",
479  s_tlast_6 when "00000000000000000000000001000000",
480  s_tlast_7 when "00000000000000000000000010000000",
481  s_tlast_8 when "00000000000000000000000100000000",
482  s_tlast_9 when "00000000000000000000001000000000",
483  s_tlast_10 when "00000000000000000000010000000000",
484  s_tlast_11 when "00000000000000000000100000000000",
485  s_tlast_12 when "00000000000000000001000000000000",
486  s_tlast_13 when "00000000000000000010000000000000",
487  s_tlast_14 when "00000000000000000100000000000000",
488  s_tlast_15 when "00000000000000001000000000000000",
489  s_tlast_16 when "00000000000000010000000000000000",
490  s_tlast_17 when "00000000000000100000000000000000",
491  s_tlast_18 when "00000000000001000000000000000000",
492  s_tlast_19 when "00000000000010000000000000000000",
493  s_tlast_20 when "00000000000100000000000000000000",
494  s_tlast_21 when "00000000001000000000000000000000",
495  s_tlast_22 when "00000000010000000000000000000000",
496  s_tlast_23 when "00000000100000000000000000000000",
497 
498  '0' when others;
499 
500 -- with pointer select
501 -- s_tready <= m_tready_0 when X"00",
502 -- m_tready_1 when X"01",
503 -- (others => '-') when others;
504 
505 
506  with pointer select
507  m_header_mark_pipe <= s_header_mark_0 when "00000000000000000000000000000001",
508  s_header_mark_1 when "00000000000000000000000000000010",
509  s_header_mark_2 when "00000000000000000000000000000100",
510  s_header_mark_3 when "00000000000000000000000000001000",
511  s_header_mark_4 when "00000000000000000000000000010000",
512  s_header_mark_5 when "00000000000000000000000000100000",
513  s_header_mark_6 when "00000000000000000000000001000000",
514  s_header_mark_7 when "00000000000000000000000010000000",
515  s_header_mark_8 when "00000000000000000000000100000000",
516  s_header_mark_9 when "00000000000000000000001000000000",
517  s_header_mark_10 when "00000000000000000000010000000000",
518  s_header_mark_11 when "00000000000000000000100000000000",
519  s_header_mark_12 when "00000000000000000001000000000000",
520  s_header_mark_13 when "00000000000000000010000000000000",
521  s_header_mark_14 when "00000000000000000100000000000000",
522  s_header_mark_15 when "00000000000000001000000000000000",
523  s_header_mark_16 when "00000000000000010000000000000000",
524  s_header_mark_17 when "00000000000000100000000000000000",
525  s_header_mark_18 when "00000000000001000000000000000000",
526  s_header_mark_19 when "00000000000010000000000000000000",
527  s_header_mark_20 when "00000000000100000000000000000000",
528  s_header_mark_21 when "00000000001000000000000000000000",
529  s_header_mark_22 when "00000000010000000000000000000000",
530  s_header_mark_23 when "00000000100000000000000000000000",
531  '0' when others;
532 
533 
534  with pointer select
535  m_trailer_mark_pipe <= s_trailer_mark_0 when "00000000000000000000000000000001",
536  s_trailer_mark_1 when "00000000000000000000000000000010",
537  s_trailer_mark_2 when "00000000000000000000000000000100",
538  s_trailer_mark_3 when "00000000000000000000000000001000",
539  s_trailer_mark_4 when "00000000000000000000000000010000",
540  s_trailer_mark_5 when "00000000000000000000000000100000",
541  s_trailer_mark_6 when "00000000000000000000000001000000",
542  s_trailer_mark_7 when "00000000000000000000000010000000",
543  s_trailer_mark_8 when "00000000000000000000000100000000",
544  s_trailer_mark_9 when "00000000000000000000001000000000",
545  s_trailer_mark_10 when "00000000000000000000010000000000",
546  s_trailer_mark_11 when "00000000000000000000100000000000",
547  s_trailer_mark_12 when "00000000000000000001000000000000",
548  s_trailer_mark_13 when "00000000000000000010000000000000",
549  s_trailer_mark_14 when "00000000000000000100000000000000",
550  s_trailer_mark_15 when "00000000000000001000000000000000",
551  s_trailer_mark_16 when "00000000000000010000000000000000",
552  s_trailer_mark_17 when "00000000000000100000000000000000",
553  s_trailer_mark_18 when "00000000000001000000000000000000",
554  s_trailer_mark_19 when "00000000000010000000000000000000",
555  s_trailer_mark_20 when "00000000000100000000000000000000",
556  s_trailer_mark_21 when "00000000001000000000000000000000",
557  s_trailer_mark_22 when "00000000010000000000000000000000",
558  s_trailer_mark_23 when "00000000100000000000000000000000",
559  '0' when others;
560 
561  with pointer select
562  m_hdr_crc_tag_pipe <= s_hdr_crc_tag_0 when "00000000000000000000000000000001",
563  s_hdr_crc_tag_1 when "00000000000000000000000000000010",
564  s_hdr_crc_tag_2 when "00000000000000000000000000000100",
565  s_hdr_crc_tag_3 when "00000000000000000000000000001000",
566  s_hdr_crc_tag_4 when "00000000000000000000000000010000",
567  s_hdr_crc_tag_5 when "00000000000000000000000000100000",
568  s_hdr_crc_tag_6 when "00000000000000000000000001000000",
569  s_hdr_crc_tag_7 when "00000000000000000000000010000000",
570  s_hdr_crc_tag_8 when "00000000000000000000000100000000",
571  s_hdr_crc_tag_9 when "00000000000000000000001000000000",
572  s_hdr_crc_tag_10 when "00000000000000000000010000000000",
573  s_hdr_crc_tag_11 when "00000000000000000000100000000000",
574  s_hdr_crc_tag_12 when "00000000000000000001000000000000",
575  s_hdr_crc_tag_13 when "00000000000000000010000000000000",
576  s_hdr_crc_tag_14 when "00000000000000000100000000000000",
577  s_hdr_crc_tag_15 when "00000000000000001000000000000000",
578  s_hdr_crc_tag_16 when "00000000000000010000000000000000",
579  s_hdr_crc_tag_17 when "00000000000000100000000000000000",
580  s_hdr_crc_tag_18 when "00000000000001000000000000000000",
581  s_hdr_crc_tag_19 when "00000000000010000000000000000000",
582  s_hdr_crc_tag_20 when "00000000000100000000000000000000",
583  s_hdr_crc_tag_21 when "00000000001000000000000000000000",
584  s_hdr_crc_tag_22 when "00000000010000000000000000000000",
585  s_hdr_crc_tag_23 when "00000000100000000000000000000000",
586  '0' when others;
587 
588 
589 
590 
591 
592  with pointer select
593  m_chan_enable <= s_chan_enable_0 when "00000000000000000000000000000001",
594  s_chan_enable_1 when "00000000000000000000000000000010",
595  s_chan_enable_2 when "00000000000000000000000000000100",
596  s_chan_enable_3 when "00000000000000000000000000001000",
597  s_chan_enable_4 when "00000000000000000000000000010000",
598  s_chan_enable_5 when "00000000000000000000000000100000",
599  s_chan_enable_6 when "00000000000000000000000001000000",
600  s_chan_enable_7 when "00000000000000000000000010000000",
601  s_chan_enable_8 when "00000000000000000000000100000000",
602  s_chan_enable_9 when "00000000000000000000001000000000",
603  s_chan_enable_10 when "00000000000000000000010000000000",
604  s_chan_enable_11 when "00000000000000000000100000000000",
605  s_chan_enable_12 when "00000000000000000001000000000000",
606  s_chan_enable_13 when "00000000000000000010000000000000",
607  s_chan_enable_14 when "00000000000000000100000000000000",
608  s_chan_enable_15 when "00000000000000001000000000000000",
609  s_chan_enable_16 when "00000000000000010000000000000000",
610  s_chan_enable_17 when "00000000000000100000000000000000",
611  s_chan_enable_18 when "00000000000001000000000000000000",
612  s_chan_enable_19 when "00000000000010000000000000000000",
613  s_chan_enable_20 when "00000000000100000000000000000000",
614  s_chan_enable_21 when "00000000001000000000000000000000",
615  s_chan_enable_22 when "00000000010000000000000000000000",
616  s_chan_enable_23 when "00000000100000000000000000000000",
617  '0' when others;
618 
619 
620  s_tready_0 <= m_tready and (pointer(0));
621  s_tready_1 <= m_tready and (pointer(1));
622  s_tready_2 <= m_tready and pointer(2);
623  s_tready_3 <= m_tready and pointer(3);
624  s_tready_4 <= m_tready and pointer(4);
625  s_tready_5 <= m_tready and pointer(5);
626  s_tready_6 <= m_tready and pointer(6);
627  s_tready_7 <= m_tready and pointer(7);
628  s_tready_8 <= m_tready and pointer(8);
629  s_tready_9 <= m_tready and pointer(9);
630  s_tready_10 <= m_tready and pointer(10);
631  s_tready_11 <= m_tready and pointer(11);
632  s_tready_12 <= m_tready and pointer(12);
633  s_tready_13 <= m_tready and pointer(13);
634  s_tready_14 <= m_tready and pointer(14);
635  s_tready_15 <= m_tready and pointer(15);
636  s_tready_16 <= m_tready and pointer(16);
637  s_tready_17 <= m_tready and pointer(17);
638  s_tready_18 <= m_tready and pointer(18);
639  s_tready_19 <= m_tready and pointer(19);
640  s_tready_20 <= m_tready and pointer(20);
641  s_tready_21 <= m_tready and pointer(21);
642  s_tready_22 <= m_tready and pointer(22);
643  s_tready_23 <= m_tready and pointer(23);
644 
645 
646  s_poll_chan_0 <= m_poll_chan_0 and (pointer(0));
647  s_poll_chan_1 <= m_poll_chan_0 and (pointer(1));
648  s_poll_chan_2 <= m_poll_chan_0 and pointer(2);
649  s_poll_chan_3 <= m_poll_chan_0 and pointer(3);
650  s_poll_chan_4 <= m_poll_chan_0 and pointer(4);
651  s_poll_chan_5 <= m_poll_chan_0 and pointer(5);
652  s_poll_chan_6 <= m_poll_chan_0 and pointer(6);
653  s_poll_chan_7 <= m_poll_chan_0 and pointer(7);
654  s_poll_chan_8 <= m_poll_chan_0 and pointer(8);
655  s_poll_chan_9 <= m_poll_chan_0 and pointer(9);
656  s_poll_chan_10 <= m_poll_chan_0 and pointer(10);
657  s_poll_chan_11 <= m_poll_chan_0 and pointer(11);
658  s_poll_chan_12 <= m_poll_chan_0 and pointer(12);
659  s_poll_chan_13 <= m_poll_chan_0 and pointer(13);
660  s_poll_chan_14 <= m_poll_chan_0 and pointer(14);
661  s_poll_chan_15 <= m_poll_chan_0 and pointer(15);
662  s_poll_chan_16 <= m_poll_chan_0 and pointer(16);
663  s_poll_chan_17 <= m_poll_chan_0 and pointer(17);
664  s_poll_chan_18 <= m_poll_chan_0 and pointer(18);
665  s_poll_chan_19 <= m_poll_chan_0 and pointer(19);
666  s_poll_chan_20 <= m_poll_chan_0 and pointer(20);
667  s_poll_chan_21 <= m_poll_chan_0 and pointer(21);
668  s_poll_chan_22 <= m_poll_chan_0 and pointer(22);
669  s_poll_chan_23 <= m_poll_chan_0 and pointer(23);
670 
671 
672  -- m_tvalid <= tvalid;
673 
674  process (clock) begin
675  if rising_edge (clock) then
676  if (reset = '1') then
677  m_tdata_pipe_reg <= (others => '0');
678  m_tvalid_pipe_reg <= '0';
679  m_tlast_pipe_reg <= '0';
680  m_header_mark_pipe_reg <= '0';
681  m_trailer_mark_pipe_reg <= '0';
682  m_hdr_crc_tag_pipe_reg <= '0';
683 
684  else
685  m_tdata_pipe_reg <= m_tdata_pipe;
686  m_tvalid_pipe_reg <= m_tvalid_pipe;
687  m_tlast_pipe_reg <= m_tlast_pipe;
688  m_header_mark_pipe_reg <= m_header_mark_pipe;
689  m_trailer_mark_pipe_reg <= m_trailer_mark_pipe;
690  m_hdr_crc_tag_pipe_reg <= m_hdr_crc_tag_pipe;
691  end if;
692  end if;
693  end process;
694 
695 m_tdata <= m_tdata_pipe_reg;
696 m_tvalid <= m_tvalid_pipe_reg;
697 m_tlast <= m_tlast_pipe_reg;
698 m_header_mark <= m_header_mark_pipe_reg;
699 m_trailer_mark <= m_trailer_mark_pipe_reg;
700 --temp hack to remove pipe stage on the crc error tag --check timing analysis to verify
701 m_hdr_crc_tag <= m_hdr_crc_tag_pipe_reg;
702 --m_hdr_crc_tag <= m_hdr_crc_tag_pipe;
703 
704 end RTL;