]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
bugfixes for forwarder. seems to work now.
authorMichael Boehmer <mboehmer@ph.tum.de>
Tue, 19 Jul 2022 06:57:39 +0000 (08:57 +0200)
committerMichael Boehmer <mboehmer@ph.tum.de>
Tue, 19 Jul 2022 06:57:39 +0000 (08:57 +0200)
gbe_trb/base/gbe_logic_wrapper.vhd
gbe_trb/base/gbe_wrapper_fifo.vhd
gbe_trb/base/trb_net16_gbe_main_control.vhd
gbe_trb/base/trb_net16_gbe_protocol_selector.vhd
gbe_trb/protocols/trb_net16_gbe_response_constructor_Forward.vhd

index b864b20d82d9c45153be5de0487fd6796f65c097..988af77a27a64ef0ac4995e6aedb1265a5aefe7c 100644 (file)
@@ -389,6 +389,9 @@ begin
       TSM_RX_STAT_VEC_IN            => (others => '0'), --mac_rx_stat_vec,
       TSM_RX_STAT_EN_IN             => '0', --mac_rx_stat_en,
 
+      DEBUG_OUT(31 downto 0)        => DEBUG_OUT, 
+      DEBUG_OUT(63 downto 32)       => open, 
+      
       MAC_READY_CONF_IN             => MAC_READY_CONF_IN,
       MAC_RECONF_OUT                => MAC_RECONF_OUT,
       MONITOR_SELECT_REC_OUT        => dbg_select_rec,
@@ -558,9 +561,9 @@ begin
       MONITOR_DROPPED_OUT     => monitor_dropped
     );
 
-  DEBUG_OUT(0) <= fr_rd_en;
-  DEBUG_OUT(1) <= fr_frame_valid;
-  DEBUG_OUT(2) <= fr_get_frame;
+--  DEBUG_OUT(0) <= fr_rd_en;
+--  DEBUG_OUT(1) <= fr_frame_valid;
+--  DEBUG_OUT(2) <= fr_get_frame;
     
   MONITOR_RX_FRAMES_OUT  <= monitor_rx_frames;
   MONITOR_RX_BYTES_OUT   <= monitor_rx_bytes;
index 4e74f0a6e55ec099306c3596eef450ed5d585ca5..7ec7ce64e449503f4c0e5b9d1d8ac3eb3fdf64fd 100644 (file)
@@ -237,7 +237,7 @@ begin
 
   -- debug(127 downto 64) are local
   -- debug(63 downto 0) are media interface
-  DEBUG_OUT <= monitor_gen_dbg(95 downto 64);
+--  DEBUG_OUT <= monitor_gen_dbg(95 downto 64);
 
   mac_0 <= MC_UNIQUE_ID_IN(15 downto 8) & MC_UNIQUE_ID_IN(23 downto 16) & MC_UNIQUE_ID_IN(31 downto 24) & x"0" & MC_UNIQUE_ID_IN(35 downto 32) & x"7ada";
 
@@ -353,7 +353,7 @@ begin
     MONITOR_DROPPED_OUT      => monitor_dropped,
     MONITOR_GEN_DBG_OUT      => monitor_gen_dbg,
     MAKE_RESET_OUT           => make_reset0,
-    DEBUG_OUT                => open --DEBUG_OUT
+    DEBUG_OUT                => DEBUG_OUT --open
   );
 
   BUS_IP_TX.ack  <= busip0.ack  when rising_edge(CLK_125_IN);
index f18acb0e368ddfbdb8fdaecbe3ac0c5d59cbd7e8..3f3c6abfb25cca3e3d79619771867eb6cbc661c3 100644 (file)
@@ -818,16 +818,18 @@ begin
   -- END OF TRI SPEED MAC CONTROLLER
   --***************
 
-  process(CLK)
-  begin
-    if rising_edge(CLK) then
-      DEBUG_OUT(3 downto 0)   <= redirect_state;
-      DEBUG_OUT(7 downto 4)   <= flow_state;
-      DEBUG_OUT(11 downto 8)  <= link_state;
-      DEBUG_OUT(31 downto 12) <= (others => '0');
-
-      DEBUG_OUT(63 downto 32) <= selector_debug(31 downto 0);
-    end if;
-  end process;
+--  process(CLK)
+--  begin
+--    if rising_edge(CLK) then
+--      DEBUG_OUT(3 downto 0)   <= redirect_state;
+--      DEBUG_OUT(7 downto 4)   <= flow_state;
+--      DEBUG_OUT(11 downto 8)  <= link_state;
+--      DEBUG_OUT(31 downto 12) <= (others => '0');
+--
+--      DEBUG_OUT(63 downto 32) <= selector_debug(31 downto 0);
+--    end if;
+--  end process;
+
+  DEBUG_OUT <= selector_debug;
 
 end trb_net16_gbe_main_control;
index bd15e301f7d771e9a5f0d82117f4b4928262258e..ac5aebe5a52896b2327486905517294b27097fec 100644 (file)
@@ -612,17 +612,18 @@ begin
         FWD_READY_OUT          => FWD_READY_OUT,
         FWD_FULL_OUT           => FWD_FULL_OUT,
   
-
-
-        DEBUG_OUT              => open
+        DEBUG_OUT              => DEBUG_OUT(31 downto 0) --open
       -- END OF INTERFACE
       );
 
   end generate fwd_gen;
 
+  DEBUG_OUT(63 downto 32) <= (others => '0');
+  
   no_fwd_gen : if INCLUDE_FWD = '0' generate
     resp_ready(5) <= '0';
     busy(5) <= '0';
+    DEBUG_OUT(31 downto 0) <= (others => '0');
   end generate no_fwd_gen;
 
   PS_BUSY_OUT <= busy;
@@ -746,16 +747,16 @@ begin
     end if;
   end process SELECTOR_PROC;
 
-  process(CLK)
-  begin
-    if rising_edge(CLK) then
-      DEBUG_OUT(3 downto 0)   <= select_state;
-      DEBUG_OUT(11 downto 4)  <= std_logic_vector(to_unsigned(index, 8));
-      DEBUG_OUT(19 downto 12) <= "00" & resp_ready; -- 4:0
-      DEBUG_OUT(27 downto 20) <= "00" & busy; -- 4:0
-      DEBUG_OUT(63 downto 28) <= (others => '0');
-    end if;
-  end process;
+--  process(CLK)
+--  begin
+--    if rising_edge(CLK) then
+--      DEBUG_OUT(3 downto 0)   <= select_state;
+--      DEBUG_OUT(11 downto 4)  <= std_logic_vector(to_unsigned(index, 8));
+--      DEBUG_OUT(19 downto 12) <= "00" & resp_ready; -- 4:0
+--      DEBUG_OUT(27 downto 20) <= "00" & busy; -- 4:0
+--      DEBUG_OUT(63 downto 28) <= (others => '0');
+--    end if;
+--  end process;
 
 end trb_net16_gbe_protocol_selector;
 
index bc69729d238543bf60298b9a0facf8baad2c37e7..dbc79b94c1895faf6ccc9b7da90d7c171b8c39b1 100644 (file)
@@ -14,6 +14,9 @@ use work.trb_net_gbe_components.all;
 -- Response Constructor which forwards received frame back creating a loopback 
 --
 
+-- WARNING: data latency was wrong by one cycle (first byte not sent, last byte duplicated), and
+--          size was calculated wrong (one off). Works now FOR ME. To be tested carefully!
+
 entity trb_net16_gbe_response_constructor_Forward is
   port (
     CLK                     : in  std_logic;  -- system clock
@@ -185,11 +188,13 @@ port map(
 
 ff_rd_en <= '1' when (TC_RD_EN_IN = '1' and PS_SELECTED_IN = '1') else '0';
 
-TC_DATA_OUT <= ff_q;
+--TC_DATA_OUT <= ff_q; -- BUG?!?
+TC_DATA_OUT <= ff_q when rising_edge(CLK);
 
 PS_RESPONSE_READY_OUT <= '1' when (dissect_current_state = LOAD) else '0';
 
-TC_FRAME_SIZE_OUT <= resp_bytes_ctr + x"1";
+--TC_FRAME_SIZE_OUT <= resp_bytes_ctr + x"1"; -- BUG?!?
+TC_FRAME_SIZE_OUT <= resp_bytes_ctr;
 
 TC_FRAME_TYPE_OUT <= x"0008";
 TC_DEST_MAC_OUT   <= FWD_DST_MAC_IN;
@@ -249,10 +254,13 @@ SENT_FRAMES_OUT     <= sent_frames;
 -- **** debug
 DEBUG_OUT(3 downto 0)   <= state;
 DEBUG_OUT(4)            <= ff_empty;
-DEBUG_OUT(7 downto 5)   <= "000";
-DEBUG_OUT(8)            <= ff_full;
-DEBUG_OUT(11 downto 9)  <= "000";
-DEBUG_OUT(31 downto 12) <= (others => '0');
+DEBUG_OUT(5)            <= ff_full;
+DEBUG_OUT(6)            <= ff_wr_en;
+DEBUG_OUT(7)            <= ff_rd_en;
+DEBUG_OUT(15 downto 8)  <= ff_q(7 downto 0);
+DEBUG_OUT(16)           <= ff_q(8);
+DEBUG_OUT(17)           <= local_eop;
+DEBUG_OUT(31 downto 18) <= (others => '0');
 -- ****
 
 end trb_net16_gbe_response_constructor_Forward;