]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
add files for large slowcontrol transfers GbeLargeSctrl
authorJan Michel <michel@physik.uni-frankfurt.de>
Fri, 21 Apr 2023 10:51:25 +0000 (12:51 +0200)
committerJan Michel <michel@physik.uni-frankfurt.de>
Fri, 21 Apr 2023 10:51:25 +0000 (12:51 +0200)
gbe_trb/base/gbe_protocol_selector.vhd
gbe_trb/base/trb_net16_gbe_transmit_control2.vhd
gbe_trb/base/trb_net_gbe_protocols.vhd

index 6c22e2b4737ac4d9adc17ccfcae6c01273a498ce..63ad85cf25d507365f32e50d015db07d65b6c867 100644 (file)
@@ -382,7 +382,7 @@ begin
        end generate no_ping_gen;
 
        sctrl_gen : if INCLUDE_SLOWCTRL = '1' generate
-               SCTRL : trb_net16_gbe_response_constructor_SCTRL
+               SCTRL : trb_net16_gbe_response_constructor_SCTRL_L
                        generic map(STAT_ADDRESS_BASE    => 8,
                                        SLOWCTRL_BUFFER_SIZE => SLOWCTRL_BUFFER_SIZE
                        )
index ed92de7569918cc2b5f2e0508753a60f9ce416f5..dc54206e1fcf4eb09deff7720a19b4d83727c63b 100644 (file)
@@ -121,7 +121,7 @@ begin
                        if (local_end = x"0000") then
                                transmit_next_state <= SEND_ONE;
                        else
-                               if (actual_frame_bytes = TC_MAX_FRAME_IN - x"1") then
+                               if (actual_frame_bytes = TC_MAX_FRAME_IN - x"1" and local_end > x"0002") then  -- gk 15.03.2023 workaround for 2 leftover bytes, add them to the last frame
                                        transmit_next_state <= SEND_ONE;
                                else
                                        transmit_next_state <= TRANSMIT;
@@ -240,7 +240,11 @@ 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;
+                               if (local_end = TC_MAX_FRAME_IN + x"1") then  -- gk 15.03.2023 nasty workaround for 2 leftover bytes, add them to the last frame
+                                       ip_size <= TC_MAX_FRAME_IN + x"2";
+                               else
+                                       ip_size <= TC_MAX_FRAME_IN;
+                               end if;
                        else
                                ip_size <= local_end + x"1";
                        end if;
@@ -259,7 +263,11 @@ begin
        if rising_edge(CLK) then
                if (transmit_current_state = PREPARE_HEADERS) then
                        if (local_end >= TC_MAX_FRAME_IN) then
-                               more_fragments <= '1';
+                               if (local_end = TC_MAX_FRAME_IN + x"1") then -- gk 15.03.2023 nasty workaround for 2 leftover bytes, add them to the last frame
+                                       more_fragments <= '0';
+                               else
+                                       more_fragments <= '1';
+                               end if;
                        else
                                more_fragments <= '0';
                        end if;
index 226559b88daea66240e8fb308701f2744b690780..832f2640f74820d8cb57740474de265fd858568a 100644 (file)
@@ -527,6 +527,72 @@ package trb_net_gbe_protocols is
                );
        end component;
 
+       component trb_net16_gbe_response_constructor_SCTRL_L is
+               generic(STAT_ADDRESS_BASE    : integer              := 0;
+                           SLOWCTRL_BUFFER_SIZE : integer range 1 to 4 := 1
+               );
+               port(
+                       CLK                           : in  std_logic; -- system clock
+                       RESET                         : in  std_logic;
+
+                       -- INTERFACE    
+                       MY_MAC_IN                     : in  std_logic_vector(47 downto 0);
+                       MY_IP_IN                      : in  std_logic_vector(31 downto 0);
+                       PS_DATA_IN                    : in  std_logic_vector(8 downto 0);
+                       PS_WR_EN_IN                   : in  std_logic;
+                       PS_ACTIVATE_IN                : in  std_logic;
+                       PS_RESPONSE_READY_OUT         : out std_logic;
+                       PS_BUSY_OUT                   : out std_logic;
+                       PS_SELECTED_IN                : in  std_logic;
+                       PS_SRC_MAC_ADDRESS_IN         : in  std_logic_vector(47 downto 0);
+                       PS_DEST_MAC_ADDRESS_IN        : in  std_logic_vector(47 downto 0);
+                       PS_SRC_IP_ADDRESS_IN          : in  std_logic_vector(31 downto 0);
+                       PS_DEST_IP_ADDRESS_IN         : in  std_logic_vector(31 downto 0);
+                       PS_SRC_UDP_PORT_IN            : in  std_logic_vector(15 downto 0);
+                       PS_DEST_UDP_PORT_IN           : in  std_logic_vector(15 downto 0);
+                       TC_RD_EN_IN                   : in  std_logic;
+                       TC_DATA_OUT                   : out std_logic_vector(8 downto 0);
+                       TC_FRAME_SIZE_OUT             : out std_logic_vector(15 downto 0);
+                       TC_FRAME_TYPE_OUT             : out std_logic_vector(15 downto 0);
+                       TC_IP_PROTOCOL_OUT            : out std_logic_vector(7 downto 0);
+                       TC_IDENT_OUT                  : out std_logic_vector(15 downto 0);
+                       TC_DEST_MAC_OUT               : out std_logic_vector(47 downto 0);
+                       TC_DEST_IP_OUT                : out std_logic_vector(31 downto 0);
+                       TC_DEST_UDP_OUT               : out std_logic_vector(15 downto 0);
+                       TC_SRC_MAC_OUT                : out std_logic_vector(47 downto 0);
+                       TC_SRC_IP_OUT                 : out std_logic_vector(31 downto 0);
+                       TC_SRC_UDP_OUT                : out std_logic_vector(15 downto 0);
+                       STAT_DATA_OUT                 : out std_logic_vector(31 downto 0);
+                       STAT_ADDR_OUT                 : out std_logic_vector(7 downto 0);
+                       STAT_DATA_RDY_OUT             : out std_logic;
+                       STAT_DATA_ACK_IN              : in  std_logic;
+                       DEBUG_OUT                     : out std_logic_vector(63 downto 0);
+                       -- END OF INTERFACE
+
+                       -- protocol specific ports
+                       GSC_CLK_IN                    : in  std_logic;
+                       GSC_INIT_DATAREADY_OUT        : out std_logic;
+                       GSC_INIT_DATA_OUT             : out std_logic_vector(15 downto 0);
+                       GSC_INIT_PACKET_NUM_OUT       : out std_logic_vector(2 downto 0);
+                       GSC_INIT_READ_IN              : in  std_logic;
+                       GSC_REPLY_DATAREADY_IN        : in  std_logic;
+                       GSC_REPLY_DATA_IN             : in  std_logic_vector(15 downto 0);
+                       GSC_REPLY_PACKET_NUM_IN       : in  std_logic_vector(2 downto 0);
+                       GSC_REPLY_READ_OUT            : out std_logic;
+                       GSC_BUSY_IN                   : in  std_logic;
+                       MAKE_RESET_OUT                : out std_logic;
+                       CFG_ADDITIONAL_HDR_IN         : in  std_logic;
+                       CFG_MAX_REPLY_SIZE_IN         : in  std_logic_vector(31 downto 0);
+                       -- end of protocol specific ports
+
+                       MONITOR_SELECT_REC_OUT        : out std_logic_vector(31 downto 0);
+                       MONITOR_SELECT_REC_BYTES_OUT  : out std_logic_vector(31 downto 0);
+                       MONITOR_SELECT_SENT_BYTES_OUT : out std_logic_vector(31 downto 0);
+                       MONITOR_SELECT_SENT_OUT       : out std_logic_vector(31 downto 0);
+                       DATA_HIST_OUT                 : out hist_array
+               );
+       end component;
+       
        component trb_net16_gbe_response_constructor_Stat is
                generic(STAT_ADDRESS_BASE : integer := 0
                );