]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
updated trigger type
authorYour Name <you@example.com>
Tue, 23 May 2017 16:28:13 +0000 (18:28 +0200)
committerYour Name <you@example.com>
Tue, 23 May 2017 16:28:13 +0000 (18:28 +0200)
gbe_trb/base/gbe_logic_wrapper.vhd
gbe_trb/base/gbe_wrapper.vhd
gbe_trb/base/trb_net16_gbe_ipu_interface.vhd
gbe_trb/base/trb_net16_gbe_mac_control.vhd

index 54acc54c2ee3592cd110c143101b33bad47c28bd..82cb4448d8f49c77d22b34866823a999b684e5c8 100644 (file)
@@ -246,6 +246,7 @@ architecture RTL of gbe_logic_wrapper is
        signal dbg_ft              : std_logic_vector(63 downto 0);
        signal dbg_q               : std_logic_vector(15 downto 0);
        signal make_reset          : std_logic;
+       signal frame_pause : std_logic_vector(31 downto 0);
 
 begin
        reset_sync : process(GSR_N, CLK_SYS_IN)
@@ -382,8 +383,8 @@ begin
                                CFG_MAX_SINGLE_SUB_IN         => CFG_MAX_SINGLE_SUB_IN,
                                CFG_ADDITIONAL_HDR_IN         => CFG_ADDITIONAL_HDR_IN,
                                CFG_MAX_REPLY_SIZE_IN         => CFG_MAX_REPLY_SIZE_IN,
-                               CFG_AUTO_THROTTLE_IN          => CFG_AUTO_THROTTLE_IN,
-                               CFG_THROTTLE_PAUSE_IN         => CFG_THROTTLE_PAUSE_IN,
+                               CFG_AUTO_THROTTLE_IN          => '0', --CFG_AUTO_THROTTLE_IN,
+                               CFG_THROTTLE_PAUSE_IN         => (others => '0'), --CFG_THROTTLE_PAUSE_IN,
                                TSM_HADDR_OUT                 => open, --mac_haddr,
                                TSM_HDATA_OUT                 => open, --mac_hdataout,
                                TSM_HCS_N_OUT                 => open, --mac_hcs,
@@ -712,7 +713,7 @@ begin
                        FLAGS_OFFSET_IN        => fc_flags_offset,
                        TTL_IN                 => fc_ttl,
                        PROTOCOL_IN            => fc_protocol,
-                       FRAME_DELAY_IN         => (others => '0'),
+                       FRAME_DELAY_IN         => frame_pause, --(others => '0'),
                        RD_CLK                 => CLK_125_IN,
                        FT_DATA_OUT            => ft_data,
                        FT_TX_EMPTY_OUT        => ft_tx_empty,
@@ -723,6 +724,8 @@ begin
                        MONITOR_TX_BYTES_OUT   => monitor_tx_bytes,
                        MONITOR_TX_FRAMES_OUT  => monitor_tx_frames
                );
+               
+       frame_pause <= x"0000" & CFG_THROTTLE_PAUSE_IN;
 
        MAC_TX_DATA_OUT <= ft_data(7 downto 0);
 
index 453b3ddfc10512ec466b06d51953e1028ae6af75..a36d12a82ba838dd502e20acfa1d0d1a59b2be4f 100644 (file)
@@ -1588,6 +1588,64 @@ begin
                mac_rx_write(0) <='0';
                mac_rx_eof(0) <= '0';
 
+
+               wait for 10 us;
+
+-- ETHERNET PAUSE FRAME
+
+
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_write(0) <= '1';
+       -- dest mac
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"01";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"80";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"c2";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"00";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"00";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"01";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+       -- src mac
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"00";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"aa";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"bb";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"cc";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"dd";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"ee";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+       -- frame type
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"88";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"08";
+               wait until rising_edge(clk_125_rx_from_pcs(0)); 
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"00";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"01";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"ff";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"ff";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+
+               for empty_b_ctr in 0 to 40 loop
+                 mac_rx_data(1 * 8 - 1 downto 0 * 8)           <= x"00";
+                 wait until rising_edge(clk_125_rx_from_pcs(0));
+               end loop;
+               mac_rx_eof(0) <= '1';
+               mac_rx_data(1 * 8 - 1 downto 0 * 8)             <= x"00";
+               wait until rising_edge(clk_125_rx_from_pcs(0));
+               mac_rx_write(0) <='0';
+               mac_rx_eof(0) <= '0';
+
                        wait;
 
                end process testbench_proc;
index 7a3fdae52e7c470d5b3c99da54f500f9172396df..dd63b55cdb30f1bc40b7756c922e7e2e638f550b 100644 (file)
@@ -808,7 +808,8 @@ begin
                if rising_edge(CLK_GBE) then
                        if (load_current_state = IDLE) then
                                trigger_type <= x"0";
-                       elsif (load_current_state = REMOVE and sf_rd_en = '1' and loaded_bytes_ctr = x"0005") then
+                       --elsif (load_current_state = REMOVE and sf_rd_en = '1' and loaded_bytes_ctr = x"0005") then
+                       elsif (load_current_state = REMOVE and sf_rd_en = '1' and loaded_bytes_ctr = x"0003") then
                                trigger_type <= pc_data(7 downto 4);
                        else
                                trigger_type <= trigger_type;
index 5a9a60783ee4db1d814189811ef5d01485714ed4..5b818282e51c8347d890324dd90ac7b6554cbb9e 100644 (file)
@@ -80,7 +80,7 @@ reg_tx_rx_ctrl1(7)           <= '1'; -- receive broadcast
 reg_tx_rx_ctrl1(6)           <= '1'; -- drop control
 reg_tx_rx_ctrl1(5)           <= '0'; -- half_duplex en 
 reg_tx_rx_ctrl1(4)           <= '1'; -- receive multicast
-reg_tx_rx_ctrl1(3)           <= '1'; -- receive pause
+reg_tx_rx_ctrl1(3)           <= '0'; -- receive pause
 reg_tx_rx_ctrl1(2)           <= '0'; -- transmit disable FCS
 reg_tx_rx_ctrl1(1)           <= '1'; -- receive discard FCS and padding
 reg_tx_rx_ctrl1(0)           <= MC_PROMISC_IN; -- promiscuous mode