1 -------------------------------------------------------------------------------
3 -- Title : DIG Gigabit Ethernet Controller
4 -- Design : ethernet_controller
5 -- Author : Ryan Rivera
8 -------------------------------------------------------------------------------
10 -- File : d:\Projects\otsdaq\OtS Ethernet MAC firmware\ActiveHDL_proj\ethernet_controller\compile\ethernet_controller.vhd
11 -- Generated : Mon Feb 29 11:09:28 2016
12 -- From : d:/Projects/otsdaq/OtS Ethernet MAC firmware/ActiveHDL_proj/ethernet_controller/src/ethernet_controller.bde
13 -- By : Bde2Vhdl ver. 2.6
15 -------------------------------------------------------------------------------
19 -------------------------------------------------------------------------------
20 -- Design unit header --
22 use IEEE.std_logic_1164.
all;
33 GMII_RXD : in (7 downto 0);
34 dest_addr : in (31 downto 0);
35 dest_mac : in (47 downto 0);
36 dest_port : in (15 downto 0);
37 self_addr : in (31 downto 0);
38 self_mac : in (47 downto 0);
39 self_port : in (15 downto 0);
40 user_tx_data_in : in (7 downto 0);
41 user_tx_size_in : in (10 downto 0);
53 four_bit_mode_out : out ;
54 src_capture_for_ctrl : out ;
55 src_capture_for_data : out ;
56 user_rx_valid_out : out ;
57 GMII_TXD : out (7 downto 0);
58 crc_chk_din : out (7 downto 0);
59 src_addr : out (31 downto 0);
60 src_mac : out (47 downto 0);
61 src_port : out (15 downto 0);
62 udp_data_count : out (10 downto 0);
63 udp_dest_port : out (15 downto 0);
64 user_rx_data_out : out (7 downto 0)
66 end ethernet_controller;
70 ---- Component declarations -----
76 data_in :
in (
7 downto 0);
77 protocol_ping_strobe :
out ;
78 set_ctrl_dest_strobe :
out ;
79 set_data_dest_strobe :
out
85 req_chk_sum :
in (
15 downto 0);
88 resp_chk_sum :
out (
15 downto 0)
94 din :
in (
7 downto 0);
97 dout :
out (
7 downto 0)
103 dest_in :
in (
31 downto 0);
105 length_in :
in (
10 downto 0);
107 src_in :
in (
31 downto 0);
109 cs :
out (
15 downto 0)
114 icmp_dest_addr :
in (
31 downto 0);
115 icmp_length :
in (
10 downto 0);
118 user_dest_addr :
in (
31 downto 0);
119 user_length :
in (
10 downto 0);
120 ip_dest_addr :
out (
31 downto 0);
121 ip_tx_length :
out (
10 downto 0)
126 addrs :
in (
31 downto 0);
130 mac :
in (
47 downto 0);
132 tip :
in (
31 downto 0);
133 tmac :
in (
47 downto 0);
140 dataout :
out (
7 downto 0);
147 addrs :
in (
31 downto 0);
149 checksum :
in (
15 downto 0);
151 data_length :
in (
10 downto 0);
152 dest_ip :
in (
31 downto 0);
153 dest_mac :
in (
47 downto 0);
154 dest_port :
in (
15 downto 0);
156 icmp_checksum :
in (
15 downto 0);
157 icmp_data :
in (
7 downto 0);
158 icmp_ip :
in (
31 downto 0);
159 icmp_mac :
in (
47 downto 0);
161 mac :
in (
47 downto 0);
166 checksum_trig :
out := '
0';
171 dataout :
out (
7 downto 0);
173 length_count_out :
out (
10 downto 0);
176 tx_icmp_packet :
out ;
182 arp_data_out :
in (
7 downto 0);
186 udp_data_out :
in (
7 downto 0);
191 txd :
out (
7 downto 0)
197 data_in :
in (
7 downto 0);
201 self_addrs :
in (
31 downto 0);
202 arp_req_ip :
out (
31 downto 0);
203 arp_req_mac :
out (
47 downto 0);
204 arp_search_ip :
out (
31 downto 0);
205 capture_source_addrs :
out ;
210 data_out :
out (
7 downto 0);
211 dest_mac :
out (
47 downto 0);
212 four_bit_mode_out :
out ;
213 icmp_checksum :
out (
15 downto 0);
214 ip_data_count :
out (
10 downto 0);
220 src_mac :
out (
47 downto 0);
221 udp_data_count :
out (
10 downto 0);
222 udp_data_valid :
out ;
223 udp_dest_port_out :
out (
15 downto 0);
224 udp_src_ip :
out (
31 downto 0);
225 udp_src_port :
out (
15 downto 0)
232 rx_data :
in (
7 downto 0);
234 out_data :
out (
7 downto 0);
254 gen_data :
in (
7 downto 0);
256 user_data :
in (
7 downto 0);
257 udp_data_out :
out (
7 downto 0)
261 ---- Signal declarations used on the diagram ----
263 signal arp_announce_strobe : ;
265 signal arp_crc_gen_en_sig : ;
266 signal arp_crc_gen_init_sig : ;
267 signal arp_crc_gen_rd_sig : ;
268 signal arp_trigger : ;
272 signal capture_addrs : ;
273 signal checksum_trig : ;
275 signal crc_chk_en_sig : ;
276 signal crc_chk_init_sig : ;
277 signal crc_chk_rd_sig : ;
278 signal crc_gen_en_sig : ;
279 signal crc_gen_init_sig : ;
280 signal crc_gen_rd_sig : ;
281 signal create_clken : ;
282 signal decipher_clken : ;
283 signal dec_chk_rd_sig : ;
284 signal en_tx_data_sig : ;
285 signal four_bit_mode : ;
286 signal is_arp_packet_sig : ;
287 signal is_icmp_packet_sig : ;
288 signal is_ip_packet_sig : ;
289 signal oei_protocol_ping_strobe : ;
293 signal set_ctrl_dest_strobe : ;
294 signal set_data_dest_strobe : ;
295 signal trigger_sig : ;
298 signal tx_icmp_packet : ;
299 signal udp_crc_gen_en_sig : ;
300 signal udp_crc_gen_init_sig : ;
301 signal udp_crc_gen_rd_sig : ;
302 signal udp_data_valid : ;
305 signal arp_data_out : (7 downto 0);
306 signal arp_req_ip : (31 downto 0);
307 signal arp_req_mac : (47 downto 0);
308 signal checksum : (15 downto 0);
309 signal data_out : (7 downto 0);
310 signal decipher_dout : (7 downto 0);
311 signal frame_src_mac : (47 downto 0);
312 signal icmp_checksum : (15 downto 0);
313 signal icmp_req_checksum : (15 downto 0);
314 signal ip_data_count_sig : (10 downto 0);
315 signal ip_dest_addr : (31 downto 0);
316 signal ping_data_delayed : (7 downto 0);
317 signal rxd : (7 downto 0);
318 signal udp_data_count_sig : (10 downto 0);
319 signal udp_data_out : (7 downto 0);
320 signal udp_gen_data : (7 downto 0);
321 signal udp_src_ip : (31 downto 0);
322 signal udp_src_port : (15 downto 0);
323 signal udp_tx_length : (10 downto 0);
324 signal user_tx_size_in_latched : (10 downto 0);
328 ---- Component instantiations ----
332 capture => capture_addrs,
334 data_in => decipher_dout,
335 protocol_ping_strobe => oei_protocol_ping_strobe,
336 set_ctrl_dest_strobe => set_ctrl_dest_strobe,
337 set_data_dest_strobe => set_data_dest_strobe
343 arp_announce => arp_announce_strobe ,
344 arp_busy => arp_busy,
346 crc_gen_en => arp_crc_gen_en_sig ,
347 crc_gen_init => arp_crc_gen_init_sig ,
348 crc_gen_rd => arp_crc_gen_rd_sig ,
349 dataout => arp_data_out ,
350 four_bit_mode => four_bit_mode,
355 trigger => arp_trigger,
363 a1 => arp_crc_gen_en_sig,
364 a2 => udp_crc_gen_en_sig,
365 ao => crc_gen_en_sig,
366 b1 => arp_crc_gen_init_sig,
367 b2 => udp_crc_gen_init_sig,
368 bo => crc_gen_init_sig ,
369 c1 => arp_crc_gen_rd_sig,
370 c2 => udp_crc_gen_rd_sig,
378 dest_in => ip_dest_addr ,
379 icmp_mode => tx_icmp_packet ,
380 length_in => user_tx_size_in_latched,
383 trigger => checksum_trig
389 arp_busy => arp_busy,
391 checksum => checksum,
392 checksum_trig => checksum_trig,
394 clken_out => create_clken,
395 crc_gen_en => udp_crc_gen_en_sig ,
396 crc_gen_init => udp_crc_gen_init_sig ,
397 crc_gen_rd => udp_crc_gen_rd_sig ,
398 data_length => udp_tx_length,
399 dataout => udp_gen_data ,
400 dest_ip => dest_addr,
401 dest_mac => dest_mac,
402 dest_port => dest_port,
403 en_tx_data => en_tx_data_sig,
404 four_bit_mode => four_bit_mode,
405 icmp_checksum => icmp_checksum,
406 icmp_data => ping_data_delayed ,
407 icmp_ip => udp_src_ip,
408 icmp_mac => frame_src_mac ,
409 icmp_ping => is_icmp_packet_sig ,
410 length_count_out => user_tx_size_in_latched ,
412 ping => oei_protocol_ping_strobe ,
414 trigger => trigger_sig,
417 tx_icmp_packet => tx_icmp_packet,
418 udp_data_sel => sel_udp
423 arp_data_out => arp_data_out,
424 arp_tx_en => arp_tx_en,
425 arp_tx_er => arp_tx_er,
430 udp_data_out => udp_data_out,
431 udp_tx_en => udp_tx_en,
432 udp_tx_er => udp_tx_er
437 arp_req_ip => arp_req_ip,
438 arp_req_mac => arp_req_mac,
439 capture_source_addrs => capture_addrs ,
441 clken_out => decipher_clken ,
442 crc_chk_en => crc_chk_en_sig,
443 crc_chk_init => crc_chk_init_sig,
444 crc_chk_rd => dec_chk_rd_sig,
446 data_out => decipher_dout ,
449 four_bit_mode_out => four_bit_mode ,
450 icmp_checksum => icmp_req_checksum,
451 ip_data_count => ip_data_count_sig,
452 is_arp => is_arp_packet_sig ,
453 is_icmp_ping => is_icmp_packet_sig,
454 is_ip => is_ip_packet_sig ,
456 self_addrs => self_addr,
457 src_mac => frame_src_mac,
458 udp_data_count => udp_data_count_sig,
459 udp_data_valid => udp_data_valid,
460 udp_dest_port_out => udp_dest_port ,
461 udp_src_ip => udp_src_ip,
462 udp_src_port => udp_src_port
468 enable => udp_data_valid ,
469 out_data => user_rx_data_out ,
470 out_data_valid => user_rx_valid_out,
471 rx_data => decipher_dout,
472 us_clken => decipher_clken
478 req_chk_sum => icmp_req_checksum,
480 resp_chk_sum => icmp_checksum,
481 trigger => trigger_sig
487 din => decipher_dout,
488 dout => ping_data_delayed ,
489 ds_clken => create_clken,
490 us_clken => decipher_clken
493 trigger_sig <= trigger or oei_protocol_ping_strobe or is_icmp_packet_sig;
495 crc_chk_rd_sig <= is_ip_packet_sig and dec_chk_rd_sig;
497 arp_trigger <= arp_announce_strobe or is_arp_packet_sig;
502 gen_data => udp_gen_data,
503 sel_user => en_tx_data_sig,
504 udp_data_out => udp_data_out,
505 user_data => user_tx_data_in
510 icmp_dest_addr => udp_src_ip,
511 icmp_length => ip_data_count_sig,
512 icmp_mode => tx_icmp_packet ,
513 ip_dest_addr => ip_dest_addr,
514 ip_tx_length => udp_tx_length,
515 ping_mode => capture_addrs,
516 user_dest_addr => dest_addr,
517 user_length => user_tx_size_in
521 ---- Terminal assignment ----
528 arp_announce_strobe <= arp_announce;
530 -- Output\buffer terminals
532 GMII_TXD <= data_out;
536 crc_chk_din <= decipher_dout;
537 crc_chk_en <= crc_chk_en_sig;
538 crc_chk_init <= crc_chk_init_sig;
539 crc_chk_rd <= crc_chk_rd_sig;
540 crc_gen_en <= crc_gen_en_sig;
541 crc_gen_init <= crc_gen_init_sig;
542 crc_gen_rd <= crc_gen_rd_sig;
543 en_tx_data <= en_tx_data_sig;
544 four_bit_mode_out <= four_bit_mode;
545 src_addr <= udp_src_ip;
546 src_capture_for_ctrl <= set_ctrl_dest_strobe;
547 src_capture_for_data <= set_data_dest_strobe;
548 src_mac <= frame_src_mac;
549 src_port <= udp_src_port;
550 udp_data_count <= udp_data_count_sig;