From: Jan Michel Date: Wed, 16 Dec 2015 09:56:55 +0000 (+0100) Subject: Clean-up of endpoint ports and adding a new register to disable individual readout... X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=d2b49bf3138d880ace3c6639457f1c814974b54f;p=trbnet.git Clean-up of endpoint ports and adding a new register to disable individual readout fifos. --- diff --git a/special/handler_data.vhd b/special/handler_data.vhd index 67872e9..63b838b 100644 --- a/special/handler_data.vhd +++ b/special/handler_data.vhd @@ -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 diff --git a/special/handler_trigger_and_data.vhd b/special/handler_trigger_and_data.vhd index 31c0934..a794a2e 100644 --- a/special/handler_trigger_and_data.vhd +++ b/special/handler_trigger_and_data.vhd @@ -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, diff --git a/trb_net16_endpoint_hades_full_handler.vhd b/trb_net16_endpoint_hades_full_handler.vhd index 0c962a7..7d2eae7 100644 --- a/trb_net16_endpoint_hades_full_handler.vhd +++ b/trb_net16_endpoint_hades_full_handler.vhd @@ -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; diff --git a/trb_net16_endpoint_hades_full_handler_record.vhd b/trb_net16_endpoint_hades_full_handler_record.vhd index 98f9d21..0302689 100644 --- a/trb_net16_endpoint_hades_full_handler_record.vhd +++ b/trb_net16_endpoint_hades_full_handler_record.vhd @@ -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, diff --git a/trb_net_components.vhd b/trb_net_components.vhd index 8ae59de..1431dd8 100644 --- a/trb_net_components.vhd +++ b/trb_net_components.vhd @@ -1147,6 +1147,7 @@ end component; 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); @@ -1307,6 +1308,7 @@ end component; 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 STATUS_OUT : out std_logic_vector(127 downto 0); STAT_DATA_BUFFER_LEVEL : out std_logic_vector(DATA_INTERFACE_NUMBER*32-1 downto 0);