]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
cleanup ongoing
authorMichael Boehmer <mboehmer@ph.tum.de>
Sun, 13 Nov 2022 22:22:01 +0000 (23:22 +0100)
committerMichael Boehmer <mboehmer@ph.tum.de>
Sun, 13 Nov 2022 22:22:01 +0000 (23:22 +0100)
gbe_trb/base/gbe_frame_constr.vhd
gbe_trb/base/gbe_logic_wrapper.vhd
gbe_trb/base/gbe_protocol_selector.vhd
gbe_trb/base/gbe_receive_control.vhd
gbe_trb/base/gbe_transmit_control.vhd
gbe_trb/base/gbe_wrapper_fifo.vhd

index 497cdd1eae8ec0699be54158f53f361d8f37e001..50fe1208fafd3e94f05e528ba27d292715e2df0c 100644 (file)
@@ -1,10 +1,9 @@
 library IEEE;\r
-use IEEE.std_logic_1164.ALL;\r
-use IEEE.numeric_std.ALL;\r
-use IEEE.std_logic_UNSIGNED.ALL;\r
-\r
+  use IEEE.std_logic_1164.all;\r
+  use IEEE.numeric_std.all;\r
+  \r
 library work;\r
-use work.trb_net_std.all;\r
+--  use work.trb_net_std.all;\r
 \r
 entity gbe_frame_constr is\r
   port(\r
@@ -53,8 +52,8 @@ architecture gbe_frame_constr_arch of gbe_frame_constr is
                           TOS_S, IP_LENGTH, IDENT, FLAGS, TTL_S, PROTO, HEADER_CS,\r
                           SRC_IP_ADDR, DEST_IP_ADDR, SRC_PORT, DEST_PORT, UDP_LENGTH,\r
                           UDP_CS, SAVE_DATA, CLEANUP, DELAY);\r
-  signal constructCurrentState, constructNextState : constructStates;\r
-  attribute syn_encoding of constructCurrentState: signal is "onehot";\r
+  signal CONSTRUCT_CS, CONSTRUCT_NS : constructStates;\r
+  attribute syn_encoding of CONSTRUCT_CS: signal is "onehot";\r
 \r
   signal headers_int_counter  : integer range 0 to 6;\r
   signal fpf_data             : std_logic_vector(7 downto 0);\r
@@ -62,20 +61,20 @@ architecture gbe_frame_constr_arch of gbe_frame_constr is
   signal fpf_rd_en            : std_logic;\r
   signal fpf_rd_en_q          : std_logic;\r
   signal fpf_q                : std_logic_vector(8 downto 0);\r
-  signal ip_size              : std_logic_vector(15 downto 0);\r
-  signal ip_checksum          : std_logic_vector(31 downto 0);\r
-  signal udp_size             : std_logic_vector(15 downto 0);\r
-  signal udp_checksum         : std_logic_vector(15 downto 0);\r
+  signal ip_size              : unsigned(15 downto 0);\r
+  signal ip_checksum          : unsigned(31 downto 0);\r
+  signal udp_size             : unsigned(15 downto 0);\r
+  signal udp_checksum         : unsigned(15 downto 0);\r
   signal put_udp_headers      : std_logic;\r
   signal ready                : std_logic;\r
   signal headers_ready        : std_logic;\r
 \r
   signal cur_max              : integer range 0 to 10;\r
 \r
-  signal ip_cs_temp_right     : std_logic_vector(15 downto 0);\r
+  signal ip_cs_temp_right     : unsigned(15 downto 0);\r
 \r
-  signal delay_ctr            : std_logic_vector(31 downto 0);\r
-  signal frame_delay_reg      : std_logic_vector(31 downto 0);\r
+--  signal delay_ctr            : std_logic_vector(31 downto 0);\r
+--  signal frame_delay_reg      : std_logic_vector(31 downto 0);\r
   signal fpf_data_q           : std_logic_vector(7 downto 0);\r
   signal fpf_wr_en_q          : std_logic;\r
   signal fpf_eod_q            : std_logic;\r
@@ -92,13 +91,13 @@ begin
   PROC_READY: process( CLK )\r
   begin\r
   if( rising_edge(CLK) )then\r
-    if( constructCurrentState = IDLE ) then\r
+    if( CONSTRUCT_CS = IDLE ) then\r
       ready <= '1';\r
     else\r
       ready <= '0';\r
     end if;\r
 \r
-    if( constructCurrentState = SAVE_DATA ) then\r
+    if( CONSTRUCT_CS = SAVE_DATA ) then\r
       headers_ready <= '1';\r
     else\r
       headers_ready <= '0';\r
@@ -111,11 +110,11 @@ begin
   begin\r
     if( rising_edge(CLK) ) then\r
       if( (put_udp_headers = '1') and (DEST_UDP_PORT_IN /= x"0000") ) then\r
-        ip_size  <= IP_F_SIZE_IN + x"14" + x"8";\r
-        udp_size <= UDP_P_SIZE_IN + x"8";\r
+        ip_size  <= unsigned(IP_F_SIZE_IN) + x"14" + x"8";\r
+        udp_size <= unsigned(UDP_P_SIZE_IN) + x"8";\r
       else\r
-        ip_size  <= IP_F_SIZE_IN + x"14";\r
-        udp_size <= UDP_P_SIZE_IN;\r
+        ip_size  <= unsigned(IP_F_SIZE_IN) + x"14";\r
+        udp_size <= unsigned(UDP_P_SIZE_IN);\r
       end if;\r
     end if;\r
   end process PROC_SIZE;\r
@@ -123,36 +122,36 @@ begin
   PROC_IP_CS : process( CLK )\r
   begin\r
     if( rising_edge(CLK) ) then\r
-      if( constructCurrentState = IDLE ) then\r
+      if( CONSTRUCT_CS = IDLE ) then\r
         ip_checksum <= x"00000000";\r
       else\r
-        case constructCurrentState is\r
+        case CONSTRUCT_CS is\r
           when DEST_MAC_ADDR =>\r
             case headers_int_counter is\r
               when 0 =>\r
-                ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + SRC_IP_ADDRESS_IN(7 downto 0);\r
+                ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + unsigned(SRC_IP_ADDRESS_IN(7 downto 0));\r
               when 1 =>\r
-                ip_checksum <= ip_checksum +  SRC_IP_ADDRESS_IN(15 downto 8);\r
+                ip_checksum <= ip_checksum + unsigned(SRC_IP_ADDRESS_IN(15 downto 8));\r
               when 2 =>\r
-                ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + SRC_IP_ADDRESS_IN(23 downto 16);\r
+                ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + unsigned(SRC_IP_ADDRESS_IN(23 downto 16));\r
               when 3 =>\r
-                ip_checksum <= ip_checksum +  SRC_IP_ADDRESS_IN(31 downto 24);\r
+                ip_checksum <= ip_checksum + unsigned(SRC_IP_ADDRESS_IN(31 downto 24));\r
               when 4 =>\r
-                ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + DEST_IP_ADDRESS_IN(7 downto 0);\r
+                ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + unsigned(DEST_IP_ADDRESS_IN(7 downto 0));\r
               when 5 =>\r
-                ip_checksum <= ip_checksum +  DEST_IP_ADDRESS_IN(15 downto 8);\r
+                ip_checksum <= ip_checksum + unsigned(DEST_IP_ADDRESS_IN(15 downto 8));\r
               when others => null;\r
             end case;\r
           when SRC_MAC_ADDR =>\r
             case headers_int_counter is\r
               when 0 =>\r
-                ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + DEST_IP_ADDRESS_IN(23 downto 16);\r
+                ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + unsigned(DEST_IP_ADDRESS_IN(23 downto 16));\r
               when 1 =>\r
-                ip_checksum <= ip_checksum +  DEST_IP_ADDRESS_IN(31 downto 24);\r
+                ip_checksum <= ip_checksum + unsigned(DEST_IP_ADDRESS_IN(31 downto 24));\r
               when 2 =>\r
-                ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + IHL_VERSION_IN;\r
+                ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + unsigned(IHL_VERSION_IN);\r
               when 3 =>\r
-                ip_checksum <= ip_checksum + TOS_IN;\r
+                ip_checksum <= ip_checksum + unsigned(TOS_IN);\r
               when 4 =>\r
                 ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + ip_size(15 downto 8);\r
               when 5 =>\r
@@ -161,23 +160,23 @@ begin
             end case;\r
           when VERSION =>\r
             if( headers_int_counter = 0 ) then\r
-              ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + IDENTIFICATION_IN(7 downto 0);\r
+              ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + unsigned(IDENTIFICATION_IN(7 downto 0));\r
             end if;\r
           when TOS_S =>\r
             if( headers_int_counter = 0 ) then\r
-              ip_checksum <= ip_checksum + IDENTIFICATION_IN(15 downto 8);\r
+              ip_checksum <= ip_checksum + unsigned(IDENTIFICATION_IN(15 downto 8));\r
             end if;\r
           when IP_LENGTH =>\r
             if( headers_int_counter = 0 ) then\r
-              ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + FLAGS_OFFSET_IN(15 downto 8);\r
+              ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + unsigned(FLAGS_OFFSET_IN(15 downto 8));\r
             elsif headers_int_counter = 1 then\r
-              ip_checksum <= ip_checksum + FLAGS_OFFSET_IN(7 downto 0);\r
+              ip_checksum <= ip_checksum + unsigned(FLAGS_OFFSET_IN(7 downto 0));\r
             end if;\r
           when IDENT =>\r
             if headers_int_counter = 0 then\r
-              ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + TTL_IN;\r
+              ip_checksum(31 downto 8) <= ip_checksum(31 downto 8) + unsigned(TTL_IN);\r
             elsif headers_int_counter = 1 then\r
-              ip_checksum <= ip_checksum + PROTOCOL_IN;\r
+              ip_checksum <= ip_checksum + unsigned(PROTOCOL_IN);\r
             end if;\r
           -- gk 29.03.10 corrected the bug with bad checksums when sum larger than 16b\r
           when FLAGS =>\r
@@ -200,106 +199,109 @@ begin
     end if;\r
   end process PROC_IP_CS;\r
 \r
-\r
   PROC_CONSTRUCT: process( CLK, RESET )\r
   begin\r
     if   ( RESET = '1' ) then\r
-      constructCurrentState <= IDLE;\r
+      CONSTRUCT_CS <= IDLE;\r
     elsif( rising_edge(CLK) ) then\r
-      constructCurrentState <= constructNextState;\r
+      CONSTRUCT_CS <= CONSTRUCT_NS;\r
     end if;\r
   end process PROC_CONSTRUCT;\r
 \r
   --find next state of construct machine\r
-  PROC_CONSTRUCT_TRANSITIONS: process( constructCurrentState, delay_ctr, FRAME_DELAY_IN, START_OF_DATA_IN,\r
+--  PROC_CONSTRUCT_TRANSITIONS: process( CONSTRUCT_CS, delay_ctr, FRAME_DELAY_IN, START_OF_DATA_IN,\r
+--                                      END_OF_DATA_IN, headers_int_counter, put_udp_headers, CUR_MAX,\r
+--                                      FRAME_TYPE_IN, DEST_UDP_PORT_IN)\r
+  PROC_CONSTRUCT_TRANSITIONS: process( CONSTRUCT_CS, START_OF_DATA_IN,\r
                                       END_OF_DATA_IN, headers_int_counter, put_udp_headers, CUR_MAX,\r
                                       FRAME_TYPE_IN, DEST_UDP_PORT_IN)\r
   begin\r
-    constructNextState <= constructCurrentState;\r
+    CONSTRUCT_NS <= CONSTRUCT_CS;\r
     if( headers_int_counter = cur_max ) then    --can be checked everytime - if not in use, counter and cur_max are 0\r
-      case constructCurrentState is\r
+      case CONSTRUCT_CS is\r
         when IDLE =>\r
           if( START_OF_DATA_IN = '1' ) then\r
-            constructNextState <= DEST_MAC_ADDR;\r
+            CONSTRUCT_NS <= DEST_MAC_ADDR;\r
           end if;\r
         when DEST_MAC_ADDR =>\r
-          constructNextState <= SRC_MAC_ADDR;\r
+          CONSTRUCT_NS <= SRC_MAC_ADDR;\r
         when SRC_MAC_ADDR =>\r
-          constructNextState <= FRAME_TYPE_S;\r
+          CONSTRUCT_NS <= FRAME_TYPE_S;\r
         when FRAME_TYPE_S =>\r
           if( FRAME_TYPE_IN = x"0008" ) then\r
-            constructNextState <= VERSION;\r
+            CONSTRUCT_NS <= VERSION;\r
           else  -- otherwise transmit data as pure ethernet frame\r
-            constructNextState <= SAVE_DATA;\r
+            CONSTRUCT_NS <= SAVE_DATA;\r
           end if;\r
         when VERSION =>\r
-          constructNextState <= TOS_S;\r
+          CONSTRUCT_NS <= TOS_S;\r
         when TOS_S =>\r
-          constructNextState <= IP_LENGTH;\r
+          CONSTRUCT_NS <= IP_LENGTH;\r
         when IP_LENGTH =>\r
-          constructNextState <= IDENT;\r
+          CONSTRUCT_NS <= IDENT;\r
         when IDENT =>\r
-          constructNextState <= FLAGS;\r
+          CONSTRUCT_NS <= FLAGS;\r
         when FLAGS =>\r
-          constructNextState <= TTL_S;\r
+          CONSTRUCT_NS <= TTL_S;\r
         when TTL_S =>\r
-          constructNextState <= PROTO;\r
+          CONSTRUCT_NS <= PROTO;\r
         when PROTO =>\r
-          constructNextState <= HEADER_CS;\r
+          CONSTRUCT_NS <= HEADER_CS;\r
         when HEADER_CS =>\r
-          constructNextState <= SRC_IP_ADDR;\r
+          CONSTRUCT_NS <= SRC_IP_ADDR;\r
         when SRC_IP_ADDR =>\r
-          constructNextState <= DEST_IP_ADDR;\r
+          CONSTRUCT_NS <= DEST_IP_ADDR;\r
         when DEST_IP_ADDR =>\r
           if( (put_udp_headers = '1') and (DEST_UDP_PORT_IN /= x"0000") ) then\r
-            constructNextState <= SRC_PORT;\r
+            CONSTRUCT_NS <= SRC_PORT;\r
           else\r
-            constructNextState <= SAVE_DATA;\r
+            CONSTRUCT_NS <= SAVE_DATA;\r
           end if;\r
         when SRC_PORT =>\r
-          constructNextState <= DEST_PORT;\r
+          CONSTRUCT_NS <= DEST_PORT;\r
         when DEST_PORT =>\r
-          constructNextState <= UDP_LENGTH;\r
+          CONSTRUCT_NS <= UDP_LENGTH;\r
         when UDP_LENGTH =>\r
-          constructNextState <= UDP_CS;\r
+          CONSTRUCT_NS <= UDP_CS;\r
         when UDP_CS =>\r
-          constructNextState <= SAVE_DATA;\r
+          CONSTRUCT_NS <= SAVE_DATA;\r
         when SAVE_DATA =>\r
           if( END_OF_DATA_IN = '1' ) then\r
-            constructNextState <= CLEANUP;\r
+            CONSTRUCT_NS <= CLEANUP;\r
           end if;\r
         when CLEANUP =>\r
-          constructNextState <= DELAY;\r
+          CONSTRUCT_NS <= DELAY;\r
         when DELAY =>\r
-          if (delay_ctr = FRAME_DELAY_IN) then\r
-            constructNextState <= IDLE;\r
-          else\r
-            constructNextState <= DELAY;\r
-          end if;\r
+          CONSTRUCT_NS <= IDLE;\r
+--          if (delay_ctr = FRAME_DELAY_IN) then\r
+--            CONSTRUCT_NS <= IDLE;\r
+--          else\r
+--            CONSTRUCT_NS <= DELAY;\r
+--          end if;\r
 \r
         when others =>\r
-          constructNextState <= IDLE;\r
+          CONSTRUCT_NS <= IDLE;\r
       end case;\r
     end if;\r
   end process PROC_CONSTRUCT_TRANSITIONS;\r
 \r
-  PROC_DELAY_CTR: process( CLK )\r
-  begin\r
-    if( rising_edge(CLK) ) then\r
-      if   ( (constructCurrentState = IDLE) or (constructCurrentState = CLEANUP) ) then\r
-        delay_ctr <= (others => '0');\r
-      elsif( constructCurrentState = DELAY ) then\r
-        delay_ctr <= delay_ctr + x"1";\r
-      end if;\r
-\r
-      frame_delay_reg <= FRAME_DELAY_IN;\r
-    end if;\r
-  end process PROC_DELAY_CTR;\r
-\r
-  PROC_BSM_CONSTR: process( constructCurrentState )\r
+--  PROC_DELAY_CTR: process( CLK )\r
+--  begin\r
+--    if( rising_edge(CLK) ) then\r
+--      if   ( (CONSTRUCT_CS = IDLE) or (CONSTRUCT_CS = CLEANUP) ) then\r
+--        delay_ctr <= (others => '0');\r
+--      elsif( CONSTRUCT_CS = DELAY ) then\r
+--        delay_ctr <= delay_ctr + x"1";\r
+--      end if;\r
+--\r
+--      frame_delay_reg <= FRAME_DELAY_IN;\r
+--    end if;\r
+--  end process PROC_DELAY_CTR;\r
+\r
+  PROC_BSM_CONSTR: process( CONSTRUCT_CS )\r
   begin\r
   --find maximum time in each state & set state bits\r
-    case constructCurrentState is\r
+    case CONSTRUCT_CS is\r
       when IDLE          => cur_max <= 0;\r
       when DEST_MAC_ADDR => cur_max <= 5;\r
       when SRC_MAC_ADDR  => cur_max <= 5;\r
@@ -328,7 +330,7 @@ begin
   PROC_HEADERS_INT: process( CLK )\r
   begin\r
     if( rising_edge(CLK) ) then\r
-      if( constructCurrentState = IDLE ) then\r
+      if( CONSTRUCT_CS = IDLE ) then\r
         headers_int_counter <= 0;\r
       else\r
         if( headers_int_counter = cur_max ) then\r
@@ -351,25 +353,25 @@ begin
     end if;\r
   end process PROC_PUT_UDP_HEADERS;\r
 \r
-  PROC_FPF_WREN: process( constructCurrentState, WR_EN_IN, LINK_OK_IN )\r
+  PROC_FPF_WREN: process( CONSTRUCT_CS, WR_EN_IN, LINK_OK_IN )\r
   begin\r
     if   ( LINK_OK_IN = '0' ) then\r
       fpf_wr_en <= '0';\r
-    elsif( (constructCurrentState /= IDLE) and (constructCurrentState /= CLEANUP) and (constructCurrentState /= SAVE_DATA)  and (constructCurrentState /= DELAY) ) then\r
+    elsif( (CONSTRUCT_CS /= IDLE) and (CONSTRUCT_CS /= CLEANUP) and (CONSTRUCT_CS /= SAVE_DATA)  and (CONSTRUCT_CS /= DELAY) ) then\r
       fpf_wr_en <= '1';\r
-    elsif( (constructCurrentState = SAVE_DATA) and (WR_EN_IN = '1') ) then\r
+    elsif( (CONSTRUCT_CS = SAVE_DATA) and (WR_EN_IN = '1') ) then\r
       fpf_wr_en <= '1';\r
     else\r
       fpf_wr_en <= '0';\r
     end if;\r
   end process PROC_FPF_WREN;\r
 \r
-  PROC_FPF_DATA: process( constructCurrentState, DEST_MAC_ADDRESS_IN, SRC_MAC_ADDRESS_IN, FRAME_TYPE_IN, IHL_VERSION_IN,\r
+  PROC_FPF_DATA: process( CONSTRUCT_CS, DEST_MAC_ADDRESS_IN, SRC_MAC_ADDRESS_IN, FRAME_TYPE_IN, IHL_VERSION_IN,\r
                           TOS_IN, ip_size, IDENTIFICATION_IN, FLAGS_OFFSET_IN, TTL_IN, PROTOCOL_IN,\r
                           ip_checksum, SRC_IP_ADDRESS_IN, DEST_IP_ADDRESS_IN,\r
                           SRC_UDP_PORT_IN, DEST_UDP_PORT_IN, udp_size, udp_checksum, headers_int_counter, DATA_IN )\r
   begin\r
-    case constructCurrentState is\r
+    case CONSTRUCT_CS is\r
       when IDLE           =>  fpf_data <= DEST_MAC_ADDRESS_IN(headers_int_counter * 8 + 7 downto headers_int_counter * 8);\r
       when DEST_MAC_ADDR  =>  fpf_data <= DEST_MAC_ADDRESS_IN(headers_int_counter * 8 + 7 downto headers_int_counter * 8);\r
       when SRC_MAC_ADDR   =>  fpf_data <= SRC_MAC_ADDRESS_IN(headers_int_counter * 8 + 7 downto headers_int_counter * 8);\r
@@ -381,7 +383,7 @@ begin
       when FLAGS          =>  fpf_data <= FLAGS_OFFSET_IN(15 - headers_int_counter * 8 downto 8 - headers_int_counter * 8);\r
       when TTL_S          =>  fpf_data <= TTL_IN;\r
       when PROTO          =>  fpf_data <= PROTOCOL_IN;\r
-      when HEADER_CS      =>  fpf_data <= x"ff" - ip_checksum(15 - headers_int_counter * 8 downto 8 - headers_int_counter * 8);\r
+      when HEADER_CS      =>  fpf_data <= std_logic_vector(x"ff" - ip_checksum(15 - headers_int_counter * 8 downto 8 - headers_int_counter * 8));\r
       when SRC_IP_ADDR    =>  fpf_data <= SRC_IP_ADDRESS_IN(headers_int_counter * 8 + 7 downto headers_int_counter * 8);\r
       when DEST_IP_ADDR   =>  fpf_data <= DEST_IP_ADDRESS_IN(headers_int_counter * 8 + 7 downto headers_int_counter * 8);\r
       when SRC_PORT       =>  fpf_data <= SRC_UDP_PORT_IN(headers_int_counter * 8 + 7 downto headers_int_counter * 8);\r
index f2eae3aac64b6a2d973b58213d62537feae34729..26bed21f56a5ccaef70ef5c09cb6bdc3e973042a 100644 (file)
@@ -7,13 +7,13 @@ library work;
 \r
 entity gbe_logic_wrapper is\r
   generic(\r
-    INCLUDE_SLOWCTRL          : std_logic             := '0';\r
-    INCLUDE_DHCP              : std_logic             := '0';\r
-    INCLUDE_ARP               : std_logic             := '0';\r
-    INCLUDE_PING              : std_logic             := '0';\r
-    INCLUDE_FWD               : std_logic             := '0';\r
-    INCLUDE_DISCOVERY         : std_logic             := '0';\r
-    SLOWCTRL_BUFFER_SIZE      : integer range 1 to 4  := 1\r
+    INCLUDE_SLOWCTRL          : std_logic            := '0';\r
+    INCLUDE_DHCP              : std_logic            := '0';\r
+    INCLUDE_ARP               : std_logic            := '0';\r
+    INCLUDE_PING              : std_logic            := '0';\r
+    INCLUDE_FWD               : std_logic            := '0';\r
+    INCLUDE_DISCOVERY         : std_logic            := '0';\r
+    SLOWCTRL_BUFFER_SIZE      : integer range 1 to 4 := 1\r
   );\r
   port(\r
     CLK_125_IN               : in  std_logic;\r
@@ -190,9 +190,6 @@ architecture gbe_logic_wrapper_arch of gbe_logic_wrapper is
 ---------------------------------------------------------------------------------------------------\r
 ---------------------------------------------------------------------------------------------------\r
 \r
-  DHCP_DONE_OUT <= dhcp_done;\r
-       MY_IP_OUT     <= my_ip;\r
-\r
   THE_GBE_MAIN_CONTROL: entity work.gbe_main_control\r
     generic map(\r
       INCLUDE_SLOWCTRL     => INCLUDE_SLOWCTRL,\r
@@ -274,7 +271,9 @@ architecture gbe_logic_wrapper_arch of gbe_logic_wrapper is
     );\r
 \r
   MAKE_RESET_OUT <= make_reset;\r
-  \r
+  DHCP_DONE_OUT  <= dhcp_done;\r
+       MY_IP_OUT      <= my_ip;\r
+       \r
   THE_TRANSMIT_CONTROL: entity work.gbe_transmit_control\r
     port map(\r
       CLK                      => CLK_125_IN,\r
@@ -341,7 +340,7 @@ architecture gbe_logic_wrapper_arch of gbe_logic_wrapper is
       TOS_IN                  => x"10",\r
       IDENTIFICATION_IN       => fc_ident,\r
       FLAGS_OFFSET_IN         => fc_flags_offset,\r
-      TTL_IN                  => x"ff",\r
+      TTL_IN                  => x"40",\r
       PROTOCOL_IN             => fc_protocol,\r
       FRAME_DELAY_IN          => frame_pause,\r
       FT_TX_DATA_OUT          => FT_TX_DATA_OUT,\r
index 7534b36a7b6a2762d7e14d573fce2f390c1c7746..c49cf88317dbad76bc7e4113e7eec18e94ba513d 100644 (file)
@@ -3,7 +3,7 @@ library ieee;
   use ieee.numeric_std.all;\r
 \r
 library work;\r
-  use work.gbe_protocols.all;\r
+--  use work.gbe_protocols.all;\r
 \r
 entity gbe_protocol_selector is\r
   generic(\r
@@ -223,7 +223,6 @@ begin
         DEBUG_OUT              => debug_dhcp\r
       );\r
       \r
---    PROC_SELECT_IP: process( DHCP_DISABLE_IN, my_dhcp_ip, MY_STATIC_IP_IN )\r
     PROC_SELECT_IP: process( CLK )\r
     begin\r
       if( rising_edge(CLK) ) then\r
@@ -469,14 +468,14 @@ begin
     end if;\r
   end process PROC_SELECT_MACHINE;\r
 \r
-  PROC_SELECT_TRANSITIONS: process(select_current_state, MC_BUSY_IN, resp_ready, index, zeros, busy)\r
+  PROC_SELECT_TRANSITIONS: process( select_current_state, MC_BUSY_IN, resp_ready, index, zeros, busy )\r
   begin\r
     select_state <= x"0";\r
 \r
     case (select_current_state) is\r
       when IDLE =>\r
         select_state <= x"1";\r
-        if (MC_BUSY_IN = '0') then\r
+        if( MC_BUSY_IN = '0' ) then\r
           select_next_state <= LOOP_OVER;\r
         else\r
           select_next_state <= IDLE;\r
@@ -484,10 +483,10 @@ begin
 \r
       when LOOP_OVER =>\r
         select_state <= x"2";\r
-        if (resp_ready /= zeros) then\r
-          if (resp_ready(index) = '1') then\r
+        if( resp_ready /= zeros ) then\r
+          if( resp_ready(index) = '1' ) then\r
             select_next_state <= SELECT_ONE;\r
-          elsif (index = 8) then\r
+          elsif( index = 8 ) then\r
             select_next_state <= CLEANUP;\r
           else\r
             select_next_state <= LOOP_OVER;\r
@@ -498,7 +497,7 @@ begin
 \r
       when SELECT_ONE =>\r
         select_state <= x"3";\r
-        if (MC_BUSY_IN = '1') then\r
+        if( MC_BUSY_IN = '1' ) then\r
           select_next_state <= PROCESS_REQUEST;\r
         else\r
           select_next_state <= SELECT_ONE;\r
@@ -506,7 +505,7 @@ begin
 \r
       when PROCESS_REQUEST =>\r
         select_state <= x"4";\r
-        if (busy(index) = '0') then\r
+        if( busy(index) = '0' ) then\r
           select_next_state <= CLEANUP;\r
         else\r
           select_next_state <= PROCESS_REQUEST;\r
@@ -516,7 +515,9 @@ begin
         select_state      <= x"5";\r
         select_next_state <= IDLE;\r
 \r
-      when others => select_next_state <= IDLE;\r
+      when others =>\r
+        select_state      <= x"f";\r
+        select_next_state <= IDLE;\r
 \r
     end case;\r
   end process PROC_SELECT_TRANSITIONS;\r
index 5fbb6fddf0a6268191159e035168f894fb827357..a1b368a51e7e458829ff2c323f0d9c2a69af3445 100644 (file)
@@ -1,11 +1,10 @@
-LIBRARY IEEE;\r
-USE IEEE.std_logic_1164.ALL;\r
-USE IEEE.numeric_std.ALL;\r
-USE IEEE.std_logic_UNSIGNED.ALL;\r
+library IEEE;\r
+  use IEEE.std_logic_1164.all;\r
+  use IEEE.numeric_std.all;\r
 \r
 library work;\r
-use work.trb_net_std.all;\r
-use work.gbe_protocols.all;\r
+--  use work.trb_net_std.all;\r
+--  use work.gbe_protocols.all;\r
 \r
 -- BUG: use (not FIFO_EMPTY) from gbe_frame_receiver to indicate\r
 --      frames in queue.\r
index 20394b8d8075e7ed12ddb66cd77eb2dadbb13e95..4bddddcaffdb724d7e40c9a08a6d8963dd2c906f 100644 (file)
@@ -1,11 +1,10 @@
-LIBRARY IEEE;
-USE IEEE.std_logic_1164.ALL;
-USE IEEE.numeric_std.ALL;
-USE IEEE.std_logic_UNSIGNED.ALL;
+library IEEE;
+  use IEEE.std_logic_1164.all;
+  use IEEE.numeric_std.all;
 
 library work;
-use work.trb_net_std.all;
-use work.gbe_protocols.all;
+--  use work.trb_net_std.all;
+--  use work.gbe_protocols.all;
 
 entity gbe_transmit_control is
 port (
@@ -56,246 +55,249 @@ end gbe_transmit_control;
 
 architecture gbe_transmit_control_arch of gbe_transmit_control is
 
-attribute syn_encoding : string;
+  attribute syn_encoding : string;
 
-type transmit_states is (IDLE, PREPARE_HEADERS, WAIT_FOR_H, TRANSMIT, SEND_ONE, SEND_TWO, CLOSE, WAIT_FOR_TRANS, DIVIDE, CLEANUP);
-signal transmit_current_state, transmit_next_state : transmit_states;
-attribute syn_encoding of transmit_current_state : signal is "onehot";
+  type transmit_states is (IDLE, PREPARE_HEADERS, WAIT_FOR_H, TRANSMIT, SEND_ONE, SEND_TWO, CLOSE, WAIT_FOR_TRANS, DIVIDE, CLEANUP);
+  signal TRANSMIT_CS, TRANSMIT_NS : transmit_states;
+  attribute syn_encoding of TRANSMIT_CS : signal is "onehot";
 
-signal tc_rd, tc_rd_q, tc_rd_qq : std_logic;
-signal local_end : std_logic_vector(15 downto 0);
+  signal tc_rd                : std_logic;
+  signal tc_rd_q              : std_logic;
+  signal tc_rd_qq             : std_logic;
+  signal local_end            : unsigned(15 downto 0);
 
-signal actual_frame_bytes, full_packet_size, ip_size, packet_loaded_bytes : std_logic_vector(15 downto 0);
-signal go_to_divide, more_fragments : std_logic;
-signal first_frame : std_logic;
-signal mon_packets_sent_ctr : std_logic_vector(31 downto 0);
-signal state : std_logic_vector(3 downto 0);
+  signal actual_frame_bytes   : unsigned(15 downto 0);
+  signal full_packet_size     : unsigned(15 downto 0);
+  signal ip_size              : unsigned(15 downto 0);
+  signal packet_loaded_bytes  : unsigned(15 downto 0);
+  signal go_to_divide         : std_logic;
+  signal more_fragments       : std_logic;
+  signal first_frame          : std_logic;
+  signal mon_packets_sent_ctr : unsigned(31 downto 0);
+  signal state                : std_logic_vector(3 downto 0);
 
 begin
 
-TRANSMIT_MACHINE_PROC : process( CLK, RESET )
-begin
-  if   ( RESET = '1' ) then
-    transmit_current_state <= IDLE;
-  elsif( rising_edge(CLK) ) then
-    transmit_current_state <= transmit_next_state;
-  end if;
-end process TRANSMIT_MACHINE_PROC;
-
-TRANSMIT_MACHINE : process(transmit_current_state, FC_H_READY_IN, TC_DATAREADY_IN, FC_READY_IN, local_end, TC_MAX_FRAME_IN, actual_frame_bytes, go_to_divide)
-begin
-  state <= x"0";
-  case transmit_current_state is
-
-  when IDLE =>
-      state <= x"1";
-      if (TC_DATAREADY_IN = '1') then
-        transmit_next_state <= PREPARE_HEADERS;
-      else
-        transmit_next_state <= IDLE;
-      end if;
-
-    when PREPARE_HEADERS =>
-      state <= x"2";
-      transmit_next_state<= WAIT_FOR_H;
+  PROC_TRANSMIT_MACHINE: process( CLK, RESET )
+  begin
+    if   ( RESET = '1' ) then
+      TRANSMIT_CS <= IDLE;
+    elsif( rising_edge(CLK) ) then
+      TRANSMIT_CS <= TRANSMIT_NS;
+    end if;
+  end process PROC_TRANSMIT_MACHINE;
 
-    when WAIT_FOR_H =>
-      state <= x"3";
-      if (FC_H_READY_IN = '1') then
-        transmit_next_state <= TRANSMIT;
-      else
-        transmit_next_state <= WAIT_FOR_H;
-      end if;
+  PROC_TRANSMIT_TRANSITIONS: process( TRANSMIT_CS, FC_H_READY_IN, TC_DATAREADY_IN, FC_READY_IN, local_end, TC_MAX_FRAME_IN, actual_frame_bytes, go_to_divide )
+  begin
+    state <= x"0";
+    case TRANSMIT_CS is
 
-    when TRANSMIT =>
-      state <= x"4";
-      if (local_end = x"0000") then
-        transmit_next_state <= SEND_ONE;
-      else
-        if (actual_frame_bytes = TC_MAX_FRAME_IN - x"1") then
-          transmit_next_state <= SEND_ONE;
+    when IDLE =>
+        state <= x"1";
+        if( TC_DATAREADY_IN = '1' ) then
+          TRANSMIT_NS <= PREPARE_HEADERS;
         else
-          transmit_next_state <= TRANSMIT;
+          TRANSMIT_NS <= IDLE;
         end if;
-      end if;
 
-    when SEND_ONE =>
-      state <= x"5";
-      transmit_next_state <= SEND_TWO;
+      when PREPARE_HEADERS =>
+        state <= x"2";
+        TRANSMIT_NS<= WAIT_FOR_H;
 
-    when SEND_TWO =>
-      state <= x"6";
-      transmit_next_state <= CLOSE;
-
-    when CLOSE =>
-      state <= x"7";
-      transmit_next_state <= WAIT_FOR_TRANS;
+      when WAIT_FOR_H =>
+        state <= x"3";
+        if( FC_H_READY_IN = '1' ) then
+          TRANSMIT_NS <= TRANSMIT;
+        else
+          TRANSMIT_NS <= WAIT_FOR_H;
+        end if;
 
-    when WAIT_FOR_TRANS =>
-      state <= x"8";
-      if (FC_READY_IN = '1') then
-        if (go_to_divide = '1') then
-          transmit_next_state <= DIVIDE;
+      when TRANSMIT =>
+        state <= x"4";
+        if( local_end = x"0000" ) then
+          TRANSMIT_NS <= SEND_ONE;
         else
-          transmit_next_state <= CLEANUP;
+          if( actual_frame_bytes = unsigned(TC_MAX_FRAME_IN) - 1 ) then
+            TRANSMIT_NS <= SEND_ONE;
+          else
+            TRANSMIT_NS <= TRANSMIT;
+          end if;
         end if;
-      else
-        transmit_next_state <= WAIT_FOR_TRANS;
-      end if;
 
-    when DIVIDE =>
-      state <= x"9";
-      transmit_next_state <= PREPARE_HEADERS;
+      when SEND_ONE =>
+        state <= x"5";
+        TRANSMIT_NS <= SEND_TWO;
+
+      when SEND_TWO =>
+        state <= x"6";
+        TRANSMIT_NS <= CLOSE;
+
+      when CLOSE =>
+        state <= x"7";
+        TRANSMIT_NS <= WAIT_FOR_TRANS;
+
+      when WAIT_FOR_TRANS =>
+        state <= x"8";
+        if( FC_READY_IN = '1' ) then
+          if( go_to_divide = '1' ) then
+            TRANSMIT_NS <= DIVIDE;
+          else
+            TRANSMIT_NS <= CLEANUP;
+          end if;
+        else
+          TRANSMIT_NS <= WAIT_FOR_TRANS;
+        end if;
 
-    when CLEANUP =>
-      state <= x"a";
-      transmit_next_state <= IDLE;
+      when DIVIDE =>
+        state <= x"9";
+        TRANSMIT_NS <= PREPARE_HEADERS;
 
-  end case;
-end process TRANSMIT_MACHINE;
+      when CLEANUP =>
+        state <= x"a";
+        TRANSMIT_NS <= IDLE;
 
-tc_rd               <= '1' when transmit_current_state = TRANSMIT else '0';
+    end case;
+  end process PROC_TRANSMIT_TRANSITIONS;
 
-TC_RD_EN_OUT        <= tc_rd;
+  tc_rd               <= '1' when TRANSMIT_CS = TRANSMIT else '0';
+  TC_RD_EN_OUT        <= tc_rd;
 
-SYNC_PROC : process( CLK )
-begin
-  if( rising_edge(CLK) ) then
-    tc_rd_q <= tc_rd;
-    tc_rd_qq <= tc_rd_q;
-    FC_WR_EN_OUT <= tc_rd_qq;
-  end if;
-end process SYNC_PROC;
-
-ACTUAL_FRAME_BYTES_PROC : process( CLK )
-begin
-  if( rising_edge(CLK) ) then
-    if   ( transmit_current_state = IDLE or transmit_current_state = DIVIDE ) then
-      actual_frame_bytes <= (others => '0');
-    elsif( transmit_current_state = TRANSMIT ) then
-      actual_frame_bytes <= actual_frame_bytes + x"1";
+  PROC_SYNC: process( CLK )
+  begin
+    if( rising_edge(CLK) ) then
+      tc_rd_q      <= tc_rd;
+      tc_rd_qq     <= tc_rd_q;
+      FC_WR_EN_OUT <= tc_rd_qq;
     end if;
-  end if;
-end process ACTUAL_FRAME_BYTES_PROC;
-
-GO_TO_DIVIDE_PROC : process( CLK )
-begin
-  if( rising_edge(CLK) ) then
-    if   ( transmit_current_state = IDLE or transmit_current_state = DIVIDE ) then
-      go_to_divide <= '0';
-    elsif( transmit_current_state = TRANSMIT and actual_frame_bytes = TC_MAX_FRAME_IN - x"1" ) then
-      go_to_divide <= '1';
-    elsif( transmit_current_state = SEND_ONE and full_packet_size = packet_loaded_bytes ) then
-      go_to_divide <= '0';
+  end process PROC_SYNC;
+
+  PROC_ACTUAL_FRAME_BYTES: process( CLK )
+  begin
+    if( rising_edge(CLK) ) then
+      if   ( (TRANSMIT_CS = IDLE) or (TRANSMIT_CS = DIVIDE) ) then
+        actual_frame_bytes <= (others => '0');
+      elsif( TRANSMIT_CS = TRANSMIT ) then
+        actual_frame_bytes <= actual_frame_bytes + 1;
+      end if;
     end if;
-  end if;
-end process GO_TO_DIVIDE_PROC;
-
-LOCAL_END_PROC : process( CLK )
-begin
-  if( rising_edge(CLK) ) then
-    if   ( transmit_current_state = IDLE and TC_DATAREADY_IN = '1' ) then
-      local_end <= TC_FRAME_SIZE_IN - x"1";
-      full_packet_size <= TC_FRAME_SIZE_IN;
-    elsif( transmit_current_state = TRANSMIT ) then
-      local_end <= local_end - x"1";
-      full_packet_size <= full_packet_size;
+  end process PROC_ACTUAL_FRAME_BYTES;
+
+  PROC_GO_TO_DIVIDE: process( CLK )
+  begin
+    if( rising_edge(CLK) ) then
+      if   ( (TRANSMIT_CS = IDLE) or (TRANSMIT_CS = DIVIDE) ) then
+        go_to_divide <= '0';
+      elsif( (TRANSMIT_CS = TRANSMIT) and (actual_frame_bytes = unsigned(TC_MAX_FRAME_IN) - 1) ) then
+        go_to_divide <= '1';
+      elsif( (TRANSMIT_CS = SEND_ONE) and (full_packet_size = packet_loaded_bytes) ) then
+        go_to_divide <= '0';
+      end if;
     end if;
-  end if;
-end process LOCAL_END_PROC;
-
-FC_DATA_OUT         <= TC_DATA_IN;
-FC_SOD_OUT      <= '1' when transmit_current_state = WAIT_FOR_H else '0';
-FC_EOD_OUT      <= '1' when transmit_current_state = CLOSE else '0';
-
-process( CLK )
-begin
-  if( rising_edge(CLK) ) then
-    if( transmit_current_state = PREPARE_HEADERS ) then
-      if( local_end >= TC_MAX_FRAME_IN ) then
-        ip_size <= TC_MAX_FRAME_IN;
-      else
-        ip_size <= local_end + x"1";
+  end process PROC_GO_TO_DIVIDE;
+
+  PROC_LOCAL_END: process( CLK )
+  begin
+    if( rising_edge(CLK) ) then
+      if   ( (TRANSMIT_CS = IDLE) and (TC_DATAREADY_IN = '1') ) then
+        local_end <= unsigned(TC_FRAME_SIZE_IN) - 1;
+        full_packet_size <= TC_FRAME_SIZE_IN;
+      elsif( TRANSMIT_CS = TRANSMIT ) then
+        local_end <= local_end - 1;
+        full_packet_size <= full_packet_size;
       end if;
-    else
-      ip_size <= ip_size;
     end if;
-  end if;
-end process;
-FC_IP_SIZE_OUT     <= ip_size;
-FC_UDP_SIZE_OUT    <= full_packet_size;
-
-FC_FLAGS_OFFSET_OUT(15 downto 14) <= "00";
-FC_FLAGS_OFFSET_OUT(13) <= more_fragments;
-
-MORE_FRAGMENTS_PROC: process( CLK )
-begin
-  if( rising_edge(CLK) ) then
-    if( transmit_current_state = PREPARE_HEADERS ) then
-      if( local_end >= TC_MAX_FRAME_IN ) then
-        more_fragments <= '1';
+  end process PROC_LOCAL_END;
+
+  FC_DATA_OUT         <= TC_DATA_IN;
+  FC_SOD_OUT      <= '1' when TRANSMIT_CS = WAIT_FOR_H else '0';
+  FC_EOD_OUT      <= '1' when TRANSMIT_CS = CLOSE else '0';
+
+  PROC_IP_SIZE: process( CLK )
+  begin
+    if( rising_edge(CLK) ) then
+      if( TRANSMIT_CS = PREPARE_HEADERS ) then
+        if( local_end >= unsigned(TC_MAX_FRAME_IN) ) then
+          ip_size <= TC_MAX_FRAME_IN;
+        else
+          ip_size <= local_end + 1;
+        end if;
       else
-        more_fragments <= '0';
+        ip_size <= ip_size;
+      end if;
+    end if;
+  end process PROC_IP_SIZE;
+  
+  FC_IP_SIZE_OUT     <= ip_size;
+  FC_UDP_SIZE_OUT    <= full_packet_size;
+
+  FC_FLAGS_OFFSET_OUT(15 downto 14) <= "00";
+  FC_FLAGS_OFFSET_OUT(13)           <= more_fragments;
+
+  PROC_MORE_FRAGMENTS: process( CLK )
+  begin
+    if( rising_edge(CLK) ) then
+      if( TRANSMIT_CS = PREPARE_HEADERS ) then
+        if( local_end >= unsigned(TC_MAX_FRAME_IN) ) then
+          more_fragments <= '1';
+        else
+          more_fragments <= '0';
+        end if;
       end if;
     end if;
-  end if;
-end process MORE_FRAGMENTS_PROC;
+  end process PROC_MORE_FRAGMENTS;
 
-FC_FLAGS_OFFSET_OUT(12 downto 0) <= ('0' & x"000") when first_frame = '1' else (packet_loaded_bytes(15 downto 3) + x"1");
+  FC_FLAGS_OFFSET_OUT(12 downto 0) <= ('0' & x"000") when (first_frame = '1') else std_logic_vector((packet_loaded_bytes(15 downto 3) + 1));
 
-PACKET_LOADED_BYTES_PROC: process( CLK )
-begin
-  if( rising_edge(CLK) ) then
-    if   ( transmit_current_state = IDLE ) then
-      packet_loaded_bytes <= x"0000";
-    elsif( transmit_current_state = TRANSMIT ) then
-      packet_loaded_bytes <= packet_loaded_bytes + x"1";
+  PROC_PACKET_LOADED_BYTES: process( CLK )
+  begin
+    if( rising_edge(CLK) ) then
+      if   ( TRANSMIT_CS = IDLE ) then
+        packet_loaded_bytes <= x"0000";
+      elsif( TRANSMIT_CS = TRANSMIT ) then
+        packet_loaded_bytes <= packet_loaded_bytes + x"1";
+      end if;
     end if;
-  end if;
-end process PACKET_LOADED_BYTES_PROC;
-
-FIRST_FRAME_PROC: process( CLK )
-begin
-  if( rising_edge(CLK) ) then
-    if   ( transmit_current_state = IDLE ) then
-      first_frame <= '1';
-    elsif( transmit_current_state = DIVIDE ) then
-      first_frame <= '0';
+  end process PROC_PACKET_LOADED_BYTES;
+
+  PROC_FIRST_FRAME: process( CLK )
+  begin
+    if( rising_edge(CLK) ) then
+      if   ( TRANSMIT_CS = IDLE ) then
+        first_frame <= '1';
+      elsif( TRANSMIT_CS = DIVIDE ) then
+        first_frame <= '0';
+      end if;
     end if;
-  end if;
-end process FIRST_FRAME_PROC;
-
-
-TC_TRANSMISSION_DONE_OUT <= '1' when transmit_current_state = CLEANUP else '0';
-
-FC_FRAME_TYPE_OUT    <= TC_FRAME_TYPE_IN;
-FC_IP_PROTOCOL_OUT   <= TC_IP_PROTOCOL_IN;
-DEST_MAC_ADDRESS_OUT <= TC_DEST_MAC_IN;
-DEST_IP_ADDRESS_OUT  <= TC_DEST_IP_IN;
-DEST_UDP_PORT_OUT    <= TC_DEST_UDP_IN;
-SRC_MAC_ADDRESS_OUT  <= TC_SRC_MAC_IN;
-SRC_IP_ADDRESS_OUT   <= TC_SRC_IP_IN;
-SRC_UDP_PORT_OUT     <= TC_SRC_UDP_IN;
-FC_IDENT_OUT         <= TC_IDENT_IN;
-
--- monitoring
-
-process( CLK, RESET )
-begin
-  if   ( RESET = '1' ) then
-    mon_packets_sent_ctr <= (others => '0');
-  elsif( rising_edge(CLK) ) then
-    if( transmit_current_state = CLEANUP ) then
-      mon_packets_sent_ctr <= mon_packets_sent_ctr + x"1";
+  end process PROC_FIRST_FRAME;
+
+  TC_TRANSMISSION_DONE_OUT <= '1' when (TRANSMIT_CS = CLEANUP) else '0';
+
+  FC_FRAME_TYPE_OUT    <= TC_FRAME_TYPE_IN;
+  FC_IP_PROTOCOL_OUT   <= TC_IP_PROTOCOL_IN;
+  DEST_MAC_ADDRESS_OUT <= TC_DEST_MAC_IN;
+  DEST_IP_ADDRESS_OUT  <= TC_DEST_IP_IN;
+  DEST_UDP_PORT_OUT    <= TC_DEST_UDP_IN;
+  SRC_MAC_ADDRESS_OUT  <= TC_SRC_MAC_IN;
+  SRC_IP_ADDRESS_OUT   <= TC_SRC_IP_IN;
+  SRC_UDP_PORT_OUT     <= TC_SRC_UDP_IN;
+  FC_IDENT_OUT         <= TC_IDENT_IN;
+
+  -- monitoring
+
+  PROC_PACKETS_SENT: process( CLK, RESET )
+  begin
+    if   ( RESET = '1' ) then
+      mon_packets_sent_ctr <= (others => '0');
+    elsif( rising_edge(CLK) ) then
+      if( TRANSMIT_CS = CLEANUP ) then
+        mon_packets_sent_ctr <= mon_packets_sent_ctr + x"1";
+      end if;
     end if;
-  end if;
-end process;
+  end process PROC_PACKETS_SENT;
 
-MONITOR_TX_PACKETS_OUT <= mon_packets_sent_ctr;
+  MONITOR_TX_PACKETS_OUT <= mon_packets_sent_ctr;
 
-DEBUG_OUT(3 downto 0) <= state;
-DEBUG_OUT(4) <= FC_READY_IN;
+  DEBUG_OUT(3 downto 0) <= state;
+  DEBUG_OUT(4) <= FC_READY_IN;
 
 end gbe_transmit_control_arch;
-
-
index ae56c10aa04f519590348320e49cbca844ac96ba..1337a106dc0cc326e2d34086e6c75270198027a9 100644 (file)
@@ -3,7 +3,7 @@ library ieee;
   use ieee.numeric_std.all;
 
 library work;
-  use work.gbe_protocols.all;
+--  use work.gbe_protocols.all;
 
 entity gbe_wrapper_fifo is
   generic(
@@ -95,7 +95,7 @@ architecture gbe_wrapper_fifo_arch of gbe_wrapper_fifo is
   signal monitor_dropped            : std_logic_vector(31 downto 0);
 
   signal make_reset                 : std_logic := '0';
-  signal monitor_gen_dbg            : std_logic_vector(c_MAX_PROTOCOLS * 64 - 1 downto 0);
+  signal monitor_gen_dbg            : std_logic_vector(8 * 64 - 1 downto 0);
 
   signal issue_reboot               : std_logic;
   signal my_ip                      : std_logic_vector(127 downto 0);