]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
Clean-up of endpoint ports and adding a new register to disable individual readout...
authorJan Michel <j.michel@gsi.de>
Wed, 16 Dec 2015 09:56:55 +0000 (10:56 +0100)
committerJan Michel <j.michel@gsi.de>
Wed, 16 Dec 2015 09:56:55 +0000 (10:56 +0100)
special/handler_data.vhd
special/handler_trigger_and_data.vhd
trb_net16_endpoint_hades_full_handler.vhd
trb_net16_endpoint_hades_full_handler_record.vhd
trb_net_components.vhd

index 67872e9644cb23e621a35dc78d69bcd605422499..63b838bb830a26da31592f60e2d3b32a9f58a937 100644 (file)
@@ -50,6 +50,7 @@ entity handler_data is
 
     TMG_TRG_ERROR_IN             : in  std_logic;
     MAX_EVENT_SIZE_IN            : in  std_logic_vector(15 downto 0) := x"FFFF";
+    BUFFER_DISABLE_IN            : in  std_logic_vector(15 downto 0) := x"0000";
     --Status
     STAT_DATA_BUFFER_LEVEL       : out std_logic_vector(DATA_INTERFACE_NUMBER*32-1 downto 0);
     STAT_HEADER_BUFFER_LEVEL     : out std_logic_vector(31 downto 0);
@@ -198,7 +199,7 @@ begin
 ---------------------------------------------------------------------------
   gen_fifos : for i in 0 to DATA_INTERFACE_NUMBER-1 generate
 
-    data_buffer_write(i)         <= FEE_DATA_WRITE_IN(i) and not fee_write_overflow(i) when current_buffer_state(i) = BUSY else '0';
+    data_buffer_write(i)         <= FEE_DATA_WRITE_IN(i) and not fee_write_overflow(i) and not BUFFER_DISABLE_IN(i) when current_buffer_state(i) = BUSY else '0';
 
     THE_DAT_FIFO : fifo_var_oreg
       generic map(
@@ -307,7 +308,7 @@ begin
 
               when BUSY =>
                 buffer_state_bits(i)       <= "010";
-                if FEE_DATA_WRITE_IN(i) = '1' and fee_write_overflow(i) = '0' then
+                if FEE_DATA_WRITE_IN(i) = '1' and fee_write_overflow(i) = '0' and BUFFER_DISABLE_IN(i) = '0' then
                   data_counter(i)          <= data_counter(i) + to_unsigned(1,1);
                 end if;
                 if FEE_DATA_FINISHED_IN(i) = '1' then
index 31c09347cffc66ca2a436f167b8be655439ea443..a794a2e5336fd8c38c7939c8b6f6463876ea02c2 100644 (file)
@@ -60,6 +60,7 @@ entity handler_trigger_and_data is
 
     TMG_TRG_ERROR_IN             : in  std_logic;
     MAX_EVENT_SIZE_IN            : in  std_logic_vector(15 downto 0) := x"FFFF";
+    BUFFER_DISABLE_IN            : in  std_logic_vector(15 downto 0) := x"0000";
     --Status Registers
     STAT_DATA_BUFFER_LEVEL       : out std_logic_vector(DATA_INTERFACE_NUMBER*32-1 downto 0);
     STAT_HEADER_BUFFER_LEVEL     : out std_logic_vector(31 downto 0);
@@ -194,6 +195,7 @@ begin
       IPU_HDR_DATA_EMPTY_OUT       => ipu_header_empty,
       TMG_TRG_ERROR_IN             => TMG_TRG_ERROR_IN,
       MAX_EVENT_SIZE_IN            => MAX_EVENT_SIZE_IN,
+      BUFFER_DISABLE_IN            => BUFFER_DISABLE_IN,
 --       Status
       STAT_DATA_BUFFER_LEVEL       => buf_STAT_DATA_BUFFER_LEVEL,
       STAT_HEADER_BUFFER_LEVEL     => buf_STAT_HEADER_BUFFER_LEVEL,
index 0c962a7a24b2a96ed099da16ac72c6cc65e1005a..7d2eae75e333cf754f725f0a7d635292fdfc19bf 100644 (file)
@@ -217,7 +217,7 @@ architecture trb_net16_endpoint_hades_full_handler_arch of trb_net16_endpoint_ha
   signal info_wr_ack     : std_logic;
   signal info_valid      : std_logic;
   signal info_invalid    : std_logic;
-  signal info_registers  : std_logic_vector_array_32(0 to 3);  
+  signal info_registers  : std_logic_vector_array_32(0 to 4);  
 
   signal stat_handler_addr       : std_logic_vector(15 downto 0);
   signal stat_handler_data_in    : std_logic_vector(31 downto 0);
@@ -250,6 +250,7 @@ architecture trb_net16_endpoint_hades_full_handler_arch of trb_net16_endpoint_ha
   signal stat_buffer_rd_nack       : std_logic;
   signal stat_buffer_address       : std_logic_vector(15 downto 0);
   signal max_event_size            : std_logic_vector(15 downto 0);
+  signal buffer_disable            : std_logic_vector(15 downto 0);
   signal new_max_size              : std_logic_vector(15 downto 0);
 
 begin
@@ -470,7 +471,7 @@ stat_buffer_unknown <= stat_buffer_wr_nack or stat_buffer_rd_nack when rising_ed
 
 THE_HANDLER_INFO_REGS : bus_register_handler
   generic map(
-    BUS_LENGTH => 4
+    BUS_LENGTH => 5
     )
   port map(
     RESET            => RESET,
@@ -495,17 +496,24 @@ info_registers(3) <=   std_logic_vector(to_unsigned(TRG_RELEASE_AFTER_DATA,1))
                      & "0000000"
                      & std_logic_vector(to_unsigned(HEADER_BUFFER_FULL_THRESH,16)) 
                      & std_logic_vector(to_unsigned(HEADER_BUFFER_DEPTH,8));
+info_registers(4) <= x"0000" & buffer_disable;
 
   proc_maxeventsize : process begin
     wait until rising_edge(CLK);
     if RESET = '1' then
       max_event_size <= std_logic_vector(to_unsigned((2**DATA_BUFFER_DEPTH-DATA_BUFFER_FULL_THRESH-1),16));
+      buffer_disable <= (others => '0');
     elsif info_write = '1' and info_addr(2 downto 0) = "001" then
       max_event_size  <= info_data_in(15 downto 0);
       info_wr_ack  <= '1';
       info_wr_nack <= '0';
+    elsif info_write = '1' and info_addr(2 downto 0) = "100" then
+      buffer_disable  <= info_data_in(15 downto 0);
+      info_wr_ack  <= '1';
+      info_wr_nack <= '0';
     else
       info_wr_nack   <= info_write;
+      info_wr_ack    <= '0';
     end if;
   end process;                     
 
@@ -583,6 +591,7 @@ stat_handler_registers(2) <= stat_handler_i(95 downto 64);
 
       TMG_TRG_ERROR_IN           => tmg_trg_error_i,
       MAX_EVENT_SIZE_IN          => max_event_size,
+      BUFFER_DISABLE_IN          => buffer_disable,
       --Status Registers
       STAT_DATA_BUFFER_LEVEL     => stat_data_buffer_level,
       STAT_HEADER_BUFFER_LEVEL   => stat_header_buffer_level,
@@ -694,4 +703,4 @@ stat_handler_registers(2) <= stat_handler_i(95 downto 64);
       end if;
     end process;
 
-end architecture;
\ No newline at end of file
+end architecture;
index 98f9d21afff2d8638cfcb60e58373a80751419b8..0302689682d337d8e6d0d3830d910cf85f9c19a9 100644 (file)
@@ -134,7 +134,6 @@ architecture trb_net16_endpoint_hades_full_handler_record_arch of trb_net16_endp
   signal stat_handler_i          : std_logic_vector (127 downto 0);
   signal stat_data_buffer_level  : std_logic_vector (DATA_INTERFACE_NUMBER*32-1 downto 0);
   signal stat_header_buffer_level: std_logic_vector (31 downto 0);
-  signal iobuf_data_count        : std_logic_vector (32*4-1 downto 0);
   
   signal info_rd_nack    : std_logic;
   signal info_wr_nack    : std_logic;
@@ -280,7 +279,6 @@ begin
       MED_STAT_OP                => open,
       CTRL_MPLEX                 => (others => '0'),
       IOBUF_CTRL_GEN             => (others => '0'),
-      IOBUF_DATA_COUNT           => iobuf_data_count,
       STAT_ONEWIRE               => open,
       STAT_ADDR_DEBUG            => open,
       STAT_TRIGGER_OUT           => STAT_TRIGGER_OUT,      
index 8ae59dee280b50866a8ae399aa904a4d4cf6bc9b..1431dd84561dc550b72f766313ec8257cb8654c4 100644 (file)
@@ -1147,6 +1147,7 @@ end component;
 \r
       TMG_TRG_ERROR_IN         : in  std_logic;\r
       MAX_EVENT_SIZE_IN        : in  std_logic_vector(15 downto 0) := x"FFFF";\r
+      BUFFER_DISABLE_IN            : in  std_logic_vector(15 downto 0) := x"0000";      \r
       --Status\r
       STAT_DATA_BUFFER_LEVEL   : out std_logic_vector(DATA_INTERFACE_NUMBER*32-1 downto 0);\r
       STAT_HEADER_BUFFER_LEVEL : out std_logic_vector(31 downto 0);\r
@@ -1307,6 +1308,7 @@ end component;
 \r
       TMG_TRG_ERROR_IN         : in  std_logic;\r
       MAX_EVENT_SIZE_IN        : in  std_logic_vector(15 downto 0) := x"FFFF";\r
+      BUFFER_DISABLE_IN        : in  std_logic_vector(15 downto 0) := x"0000";\r
       --Status Registers\r
       STATUS_OUT               : out std_logic_vector(127 downto 0);\r
       STAT_DATA_BUFFER_LEVEL   : out std_logic_vector(DATA_INTERFACE_NUMBER*32-1 downto 0);\r