3 --erased Comments by rrivera at fnal dot gov : Aug 25, 2015
5 --erased IMPORTANT!! IMPORTANT!!
6 --erased It's very important to note!!!
8 --erased The script that moves these files into a Firmware project will
9 --erased remove all "" comments..
10 --erased The only way (I think) to safely comment is to put "SCRIPT COMMENT OUT" in your comment line with single spacing
13 use ieee.std_logic_1164.
ALL;
14 use ieee.numeric_std.
ALL;
17 port ( b_data : in (63 downto 0);
26 user_rx_data_out : in (7 downto 0);
27 user_rx_valid_out : in ;
28 user_rx_src_addr : in (31 downto 0);
29 user_rx_src_mac : in (47 downto 0);
30 user_rx_src_port : in (15 downto 0);
32 tx_ctrl_dest_addr : in (31 downto 0);
33 tx_ctrl_dest_mac : in (47 downto 0);
34 tx_ctrl_dest_port : in (15 downto 0);
35 tx_data_dest_addr : in (31 downto 0);
36 tx_data_dest_mac : in (47 downto 0);
37 tx_data_dest_port : in (15 downto 0);
38 user_tx_dest_addr : out (31 downto 0);
39 user_tx_dest_mac : out (47 downto 0);
40 user_tx_dest_port : out (15 downto 0);
42 user_tx_enable_out : in ;
46 tx_data : in (63 downto 0);
48 user_tx_trigger : out ;
49 user_tx_data_in : out (7 downto 0);
50 user_tx_size_in : out (10 downto 0);
51 ram_addr : out (63 downto 0);
54 rx_data : out (63 downto 0));
59 signal clear_delay_count : ;
60 signal crc_err_flag, clear_crc_err_flag : ;
61 signal data_fifo_full : ;
62 signal rx_data_fifo_wren : ;
63 signal rx_data_fifo_wr_data : (63 downto 0);
64 signal delay_count : ;
65 signal rx_info_fifo_wren : ;
66 signal rx_info_fifo_wr_data : (15 downto 0);
67 signal rx_data_fifo_empty : ;
68 signal rx_data_fifo_read_enable : ;
69 signal rx_fifo_reset : ;
70 signal rx_fifo_reset_sig : ;
71 signal rx_info_fifo_empty : ;
72 signal rx_info_fifo_full : ;
73 signal rx_data_fifo_full : ;
74 signal rx_info_fifo_rden : ;
75 signal start_delay_count : ;
76 signal tx_data_fifo_din : (63 downto 0);
77 signal tx_data_fifo_empty : ;
78 signal tx_data_fifo_full : ;
79 signal tx_data_fifo_rden : ;
80 signal tx_data_fifo_read_enable : ;
81 signal tx_data_fifo_wr_en : ;
82 signal tx_info_fifo_rden : ;
83 signal rx_data_sig : (63 downto 0);
85 signal tx_data_reg : (63 downto 0);
86 signal rx_data_fifo_rd_data : (63 downto 0);
89 signal rx_src_addr_fifo_dout : (47 downto 0);
90 signal rx_src_mac_fifo_dout : (47 downto 0);
91 signal tx_ctrl_addr_fifo_dout : (31 downto 0);
92 signal tx_ctrl_port_fifo_dout : (15 downto 0);
93 signal tx_ctrl_mac_fifo_dout : (47 downto 0);
96 signal tx_ctrl_fifo_empty : ;
97 signal tx_ctrl_fifo_full : ;
98 signal tx_ctrl_fifo_rden : ;
99 signal tx_ctrl_fifo_read_enable : ;
101 signal tx_ctrl_fifo_wr_en : ;
102 signal tx_ctrl_fifo_reset_sig : ;
103 signal comm_dec_tx_fifo_reset : ;
104 signal tx_seq_ctl_sel : ;
105 signal tx_seq_ret_to_sender : ;
106 signal tx_data_info_fifo_empty : ;
107 signal tx_ctrl_info_fifo_empty : ;
108 signal tx_data_info_fifo_wr_en : ;
109 signal tx_ctrl_info_fifo_wr_en : ;
111 signal tx_data_info_fifo_din : (15 downto 0);
112 signal tx_data_info_fifo_dout : (15 downto 0);
113 signal tx_ctrl_info_fifo_din : (15 downto 0);
114 signal tx_ctrl_info_fifo_dout : (15 downto 0);
115 signal tx_ctrl_fifo_dout : (63 downto 0);
116 signal tx_data_fifo_dout : (63 downto 0);
117 signal rx_info_fifo_rd_data : (15 downto 0);
118 signal tx_info_fifo_dout : (15 downto 0);
119 signal tx_seq_data_fifo_dout : (63 downto 0);
120 signal tx_ctrl_info_fifo_read_enable : ;
121 signal tx_data_info_fifo_read_enable : ;
122 signal tx_data_info_fifo_full : ;
123 signal tx_ctrl_info_fifo_full : ;
131 din :
in (
63 downto 0);
134 dout :
out (
63 downto 0));
141 din :
in (
15 downto 0);
143 dout :
out (
15 downto 0);
153 din :
in (
47 downto 0);
155 dout :
out (
47 downto 0);
163 rx_data(63 downto 0) <= rx_data_sig(63 downto 0);
165 user_tx_dest_addr <= tx_data_dest_addr when tx_seq_ctl_sel = '1' else
166 tx_ctrl_addr_fifo_dout when tx_seq_ret_to_sender = '1' else
168 user_tx_dest_port <= tx_data_dest_port when tx_seq_ctl_sel = '1' else
169 tx_ctrl_port_fifo_dout when tx_seq_ret_to_sender = '1' else
171 user_tx_dest_mac <= tx_data_dest_mac when tx_seq_ctl_sel = '1' else
172 tx_ctrl_mac_fifo_dout when tx_seq_ret_to_sender = '1' else
311 tx_ctrl_fifo_reset_sig <= comm_dec_tx_fifo_reset or reset;
313 --erased assume there is a select signal from TX_CTRL
314 --erased tx_seq_ctl_sel = 0 for ctrl fifo and 1 for burst data fifo
315 tx_ctrl_fifo_read_enable <= tx_data_fifo_rden when tx_seq_ctl_sel = '0' else '0';
316 tx_data_fifo_read_enable <= tx_data_fifo_rden when tx_seq_ctl_sel = '1' else '0';
317 tx_ctrl_info_fifo_read_enable <= tx_info_fifo_rden when tx_seq_ctl_sel = '0' else '0';
318 tx_data_info_fifo_read_enable <= tx_info_fifo_rden when tx_seq_ctl_sel = '1' else '0';
319 tx_info_fifo_dout <= tx_data_info_fifo_dout when tx_seq_ctl_sel = '1' else tx_ctrl_info_fifo_dout;
320 tx_seq_data_fifo_dout <= tx_data_fifo_dout when tx_seq_ctl_sel = '1' else tx_ctrl_fifo_dout;
326 tx_data_fifo_din <= b_data;
327 rx_fifo_reset_sig <= rx_fifo_reset or reset;
332 port map (clk =>MASTER_CLK,
333 din
(63 downto 0)=>rx_data_fifo_wr_data
(63 downto 0),
334 rd_en =>rx_data_fifo_read_enable ,
335 srst =>rx_fifo_reset_sig,
336 wr_en =>rx_data_fifo_wren,
337 dout
(63 downto 0)=>rx_data_fifo_rd_data
(63 downto 0),
338 empty =>rx_data_fifo_empty,
339 full =>rx_data_fifo_full
);
342 port map (clk =>MASTER_CLK,
343 din
(15 downto 0)=>rx_info_fifo_wr_data
(15 downto 0),
344 rd_en =>rx_info_fifo_rden,
345 srst =>rx_fifo_reset_sig,
346 wr_en =>rx_info_fifo_wren,
347 dout
(15 downto 0)=>rx_info_fifo_rd_data
(15 downto 0),
348 empty =>rx_info_fifo_empty,
349 full =>rx_info_fifo_full
);
352 port map (clk =>MASTER_CLK,
353 din
(31 downto 0)=>user_rx_src_addr
(31 downto 0),
354 din
(47 downto 32)=>user_rx_src_port
(15 downto 0),
355 rd_en =>rx_info_fifo_rden,
356 srst =>rx_fifo_reset_sig,
357 wr_en =>rx_info_fifo_wren,
358 dout
(47 downto 0)=>rx_src_addr_fifo_dout
(47 downto 0),
363 port map (clk =>MASTER_CLK,
364 din
(47 downto 0)=>user_rx_src_mac
(47 downto 0),
365 rd_en =>rx_info_fifo_rden,
366 srst =>rx_fifo_reset_sig,
367 wr_en =>rx_info_fifo_wren,
368 dout
(47 downto 0)=>rx_src_mac_fifo_dout
(47 downto 0),
374 port map (clk =>MASTER_CLK,
375 din
(63 downto 0)=>tx_data_fifo_din
(63 downto 0),
376 rd_en =>tx_data_fifo_read_enable,
378 wr_en =>tx_data_fifo_wr_en ,
379 dout
(63 downto 0)=>tx_data_fifo_dout
(63 downto 0),
380 empty =>tx_data_fifo_empty ,
381 full =>tx_data_fifo_full
);
384 port map (clk =>MASTER_CLK,
385 din
(15 downto 0)=>tx_data_info_fifo_din
(15 downto 0),
386 rd_en=>tx_data_info_fifo_read_enable ,
388 wr_en=>tx_data_info_fifo_wr_en,
389 dout
(15 downto 0)=>tx_data_info_fifo_dout
(15 downto 0),
390 empty=>tx_data_info_fifo_empty,
391 full =>tx_data_info_fifo_full
);
394 port map (clk =>MASTER_CLK,
395 din
(63 downto 0)=>tx_data
(63 downto 0),
396 rd_en =>tx_ctrl_fifo_read_enable,
397 srst =>tx_ctrl_fifo_reset_sig,
398 wr_en =>tx_ctrl_fifo_wr_en ,
399 dout
(63 downto 0)=>tx_ctrl_fifo_dout
(63 downto 0),
400 empty =>tx_ctrl_fifo_empty ,
401 full =>tx_ctrl_fifo_full
);
404 port map (clk =>MASTER_CLK,
405 din
(15 downto 0)=>tx_ctrl_info_fifo_din
(15 downto 0),
406 rd_en=>tx_ctrl_info_fifo_read_enable ,
407 srst =>tx_ctrl_fifo_reset_sig ,
408 wr_en=>tx_ctrl_info_fifo_wr_en,
409 dout
(15 downto 0)=>tx_ctrl_info_fifo_dout
(15 downto 0),
410 empty=>tx_ctrl_info_fifo_empty,
411 full =>tx_ctrl_info_fifo_full
);
414 port map (clk =>MASTER_CLK,
415 din
(47 downto 0)=>rx_src_addr_fifo_dout
(47 downto 0),
416 rd_en=>tx_ctrl_info_fifo_read_enable ,
417 srst =>tx_ctrl_fifo_reset_sig ,
418 wr_en=>tx_ctrl_info_fifo_wr_en,
419 dout
(31 downto 0)=>tx_ctrl_addr_fifo_dout
(31 downto 0),
420 dout
(47 downto 32)=>tx_ctrl_port_fifo_dout
(15 downto 0),
425 port map (clk =>MASTER_CLK,
426 din
(47 downto 0)=>rx_src_mac_fifo_dout
(47 downto 0),
427 rd_en=>tx_ctrl_info_fifo_read_enable ,
428 srst =>tx_ctrl_fifo_reset_sig ,
429 wr_en=>tx_ctrl_info_fifo_wr_en,
430 dout
(47 downto 0)=>tx_ctrl_mac_fifo_dout
(47 downto 0),
436 b_data_we =>b_data_we,
437 b_end_packet =>b_end_packet,
441 tx_data_full =>tx_data_fifo_full ,
442 tx_info_full =>tx_data_info_fifo_full,
444 tx_data_we =>tx_data_fifo_wr_en ,
445 tx_info
(15 downto 0)=>tx_data_info_fifo_din
(15 downto 0),
446 tx_info_we =>tx_data_info_fifo_wr_en
);
449 GEC_RX_CTRL :
entity work.
rx_ctl
452 four_bit_mode =>four_bit_mode,
453 user_crc_err =>user_crc_err,
454 user_crc_chk =>user_crc_chk,
455 user_rx_data_out
(7 downto 0)=>user_rx_data_out
(7 downto 0),
456 user_rx_valid_out =>user_rx_valid_out ,
458 crc_err_flag =>crc_err_flag,
459 clear_crc_err_flag =>clear_crc_err_flag ,
460 data_fifo_wdata
(63 downto 0)=>rx_data_fifo_wr_data
(63 downto 0),
461 data_fifo_wren =>rx_data_fifo_wren ,
462 info_fifo_wren =>rx_info_fifo_wren ,
463 info_fifo_wr_data
(15 downto 0)=>rx_info_fifo_wr_data
(15 downto 0));
470 rx_data_fifo_rd_data
(63 downto 0)=>rx_data_fifo_rd_data
(63 downto 0),
471 ram_wdata
(63 downto 0)=>rx_data_sig
(63 downto 0),
472 rx_info_fifo_empty =>rx_info_fifo_empty ,
473 rx_info_fifo_full =>rx_info_fifo_full,
474 rx_data_fifo_full =>rx_data_fifo_full,
475 rx_info_fifo_rd_data
(15 downto 0)=>rx_info_fifo_rd_data
(15 downto 0),
476 tx_info_fifo_full =>tx_ctrl_info_fifo_full,
477 ram_addr
(63 downto 0)=>ram_addr
(63 downto 0),
480 user_ready =>user_ready,
481 user_rx_valid_out =>user_rx_valid_out,
482 crc_err_flag =>crc_err_flag,
483 clear_crc_err_flag =>clear_crc_err_flag ,
484 rx_data_fifo_rden =>rx_data_fifo_read_enable,
485 Rx_FIFO_Reset =>rx_fifo_reset,
486 rx_info_fifo_rden =>rx_info_fifo_rden ,
487 tx_data_fifo_wren =>tx_ctrl_fifo_wr_en ,
488 Tx_FIFO_Reset =>comm_dec_tx_fifo_reset,
490 tx_info_fifo_wren =>tx_ctrl_info_fifo_wr_en,
491 tx_info_fifo_wr_data
(15 downto 0)=>tx_ctrl_info_fifo_din
(15 downto 0));
497 four_bit_mode =>four_bit_mode,
499 dest_busy =>user_busy,
500 user_trigger =>user_tx_trigger,
501 user_tx_enable_out =>user_tx_enable_out ,
502 tx_data
(7 downto 0)=>user_tx_data_in
(7 downto 0),
503 user_tx_size_in
(10 downto 0)=>user_tx_size_in
(10 downto 0),
505 fifo_sel =>tx_seq_ctl_sel,
506 ret_to_sender =>tx_seq_ret_to_sender ,
508 data_fifo_empty =>tx_data_fifo_empty ,
509 data_fifo_rd_data
(63 downto 0)=>tx_seq_data_fifo_dout
(63 downto 0),
510 data_fifo_rden =>tx_data_fifo_rden ,
512 data_info_fifo_empty =>tx_data_info_fifo_empty,
513 ctrl_info_fifo_empty =>tx_ctrl_info_fifo_empty,
515 info_fifo_rd_data
(15 downto 0)=>tx_info_fifo_dout
(15 downto 0),
516 info_fifo_rden =>tx_info_fifo_rden
);