REGIO_WRITE_ACK_IN : in std_logic := '0';
REGIO_UNKNOWN_ADDR_IN : in std_logic := '0';
REGIO_TIMEOUT_OUT : out std_logic;
-
+ EXTERNAL_SEND_RESET : in std_logic := '0';
+ TIMER_TICKS_OUT : out std_logic_vector(1 downto 0);
-- Debug and Status Ports ----------------------------------------------------------
HUB_STAT_CHANNEL : out std_logic_vector (4*16-1 downto 0);
architecture trb_net16_hub_streaming_arch of trb_net16_hub_streaming_port_sctrl_cts is
-constant mii : integer := MII_NUMBER-1;
+constant mii : integer := MII_NUMBER;
constant DATA_INTERFACE_NUMBER : integer := RDO_ADDITIONAL_PORT + 1;
-signal hub_init_dataready_out : std_logic_vector(4 downto 0);
-signal hub_reply_dataready_out : std_logic_vector(4 downto 0);
-signal hub_init_dataready_in : std_logic_vector(4 downto 0);
-signal hub_reply_dataready_in : std_logic_vector(4 downto 0);
-signal hub_init_read_out : std_logic_vector(4 downto 0);
-signal hub_reply_read_out : std_logic_vector(4 downto 0);
-signal hub_init_read_in : std_logic_vector(4 downto 0);
-signal hub_reply_read_in : std_logic_vector(4 downto 0);
-signal hub_init_data_out : std_logic_vector(79 downto 0);
-signal hub_reply_data_out : std_logic_vector(79 downto 0);
-signal hub_init_data_in : std_logic_vector(79 downto 0);
-signal hub_reply_data_in : std_logic_vector(79 downto 0);
-signal hub_init_packet_num_out : std_logic_vector(14 downto 0);
-signal hub_reply_packet_num_out : std_logic_vector(14 downto 0);
-signal hub_init_packet_num_in : std_logic_vector(14 downto 0);
-signal hub_reply_packet_num_in : std_logic_vector(14 downto 0);
+signal hub_init_dataready_out : std_logic_vector(5 downto 0);
+signal hub_reply_dataready_out : std_logic_vector(5 downto 0);
+signal hub_init_dataready_in : std_logic_vector(5 downto 0);
+signal hub_reply_dataready_in : std_logic_vector(5 downto 0);
+signal hub_init_read_out : std_logic_vector(5 downto 0);
+signal hub_reply_read_out : std_logic_vector(5 downto 0);
+signal hub_init_read_in : std_logic_vector(5 downto 0);
+signal hub_reply_read_in : std_logic_vector(5 downto 0);
+signal hub_init_data_out : std_logic_vector(80 downto 0);
+signal hub_reply_data_out : std_logic_vector(80 downto 0);
+signal hub_init_data_in : std_logic_vector(80 downto 0);
+signal hub_reply_data_in : std_logic_vector(80 downto 0);
+signal hub_init_packet_num_out : std_logic_vector(15 downto 0);
+signal hub_reply_packet_num_out : std_logic_vector(15 downto 0);
+signal hub_init_packet_num_in : std_logic_vector(15 downto 0);
+signal hub_reply_packet_num_in : std_logic_vector(15 downto 0);
signal cts_init_data_out : std_logic_vector(15 downto 0);
signal cts_init_dataready_out : std_logic;
signal io_read_out : std_logic_vector(3 downto 0);
signal io_data_in : std_logic_vector(4*16-1 downto 0);
signal io_packet_num_in : std_logic_vector(4*3-1 downto 0);
-signal io_error_in : std_logic_vector(2 downto 0);
signal reset_i : std_logic;
signal regio_write_ack_i : std_logic;
signal regio_no_more_data_i: std_logic;
signal regio_unknown_addr_i: std_logic;
-
+signal external_send_reset_long : std_logic;
+signal external_send_reset_timer : std_logic;
begin
---------------------------------------------------------------------
begin
if rising_edge(CLK) then
reset_i <= RESET;
- reset_i_mux_io <= MED_STAT_OP(mii*16+14) or reset_i;
+ reset_i_mux_io <= RESET; --MED_STAT_OP(mii*16+14) or
end if;
end process;
MED_CTRL_OP(14+i*16) <= HUB_MED_CTRL_OP(14+i*16);
MED_CTRL_OP(15+i*16) <= hub_make_network_reset ;
end generate;
- MED_CTRL_OP(13+mii*16 downto mii*16) <= (others => '0');
- MED_CTRL_OP(14+mii*16) <= '0';
- MED_CTRL_OP(15+mii*16) <= hub_make_network_reset;
-
-
- hub_make_network_reset <= MED_STAT_OP(15) or MED_STAT_OP(15+mii*16);
-
+-- MED_CTRL_OP(13+mii*16 downto mii*16) <= (others => '0');
+-- MED_CTRL_OP(14+mii*16) <= '0';
+-- MED_CTRL_OP(15+mii*16) <= hub_make_network_reset;
+
+
+ hub_make_network_reset <= external_send_reset_long or MED_STAT_OP(15+4*16); --MED_STAT_OP(15) or MED_STAT_OP(15+(mii-1)*16);
+
+ make_gbe_reset : process begin
+ wait until rising_edge(CLK);
+ if(EXTERNAL_SEND_RESET = '1') then
+ external_send_reset_long <= '1';
+ external_send_reset_timer <= '1';
+ end if;
+ if timer_ticks(0) = '1' or reset_i = '1' then
+ external_send_reset_timer <= '0';
+ external_send_reset_long <= external_send_reset_timer;
+ end if;
+ end process;
+
---------------------------------------------------------------------
-- Connecting I/O
---------------------------------------------------------------------
MED_STAT_OP => med_stat_op(mii*16-1 downto 0),
MED_CTRL_OP => HUB_MED_CTRL_OP(mii*16-1 downto 0),
- INT_INIT_DATAREADY_OUT(4 downto 0) => hub_init_dataready_out,
- INT_INIT_DATA_OUT(79 downto 0) => hub_init_data_out,
- INT_INIT_PACKET_NUM_OUT(14 downto 0) => hub_init_packet_num_out,
- INT_INIT_READ_IN(4 downto 0) => hub_init_read_in,
- INT_INIT_DATAREADY_IN(4 downto 0) => hub_init_dataready_in,
- INT_INIT_DATA_IN(79 downto 0) => hub_init_data_in,
- INT_INIT_PACKET_NUM_IN(14 downto 0) => hub_init_packet_num_in,
- INT_INIT_READ_OUT(4 downto 0) => hub_init_read_out,
- INT_REPLY_DATAREADY_OUT(4 downto 0) => hub_reply_dataready_out,
- INT_REPLY_DATA_OUT(79 downto 0) => hub_reply_data_out,
- INT_REPLY_PACKET_NUM_OUT(14 downto 0) => hub_reply_packet_num_out,
- INT_REPLY_READ_IN(4 downto 0) => hub_reply_read_in,
- INT_REPLY_DATAREADY_IN(4 downto 0) => hub_reply_dataready_in,
- INT_REPLY_DATA_IN(79 downto 0) => hub_reply_data_in,
- INT_REPLY_PACKET_NUM_IN(14 downto 0) => hub_reply_packet_num_in,
- INT_REPLY_READ_OUT(4 downto 0) => hub_reply_read_out,
+ INT_INIT_DATAREADY_OUT => hub_init_dataready_out,
+ INT_INIT_DATA_OUT => hub_init_data_out,
+ INT_INIT_PACKET_NUM_OUT => hub_init_packet_num_out,
+ INT_INIT_READ_IN => hub_init_read_in,
+ INT_INIT_DATAREADY_IN => hub_init_dataready_in,
+ INT_INIT_DATA_IN => hub_init_data_in,
+ INT_INIT_PACKET_NUM_IN => hub_init_packet_num_in,
+ INT_INIT_READ_OUT => hub_init_read_out,
+ INT_REPLY_DATAREADY_OUT => hub_reply_dataready_out,
+ INT_REPLY_DATA_OUT => hub_reply_data_out,
+ INT_REPLY_PACKET_NUM_OUT => hub_reply_packet_num_out,
+ INT_REPLY_READ_IN => hub_reply_read_in,
+ INT_REPLY_DATAREADY_IN => hub_reply_dataready_in,
+ INT_REPLY_DATA_IN => hub_reply_data_in,
+ INT_REPLY_PACKET_NUM_IN => hub_reply_packet_num_in,
+ INT_REPLY_READ_OUT => hub_reply_read_out,
--REGIO INTERFACE
- REGIO_ADDR_OUT => regio_addr_out,
- REGIO_READ_ENABLE_OUT => regio_read_enable_out,
- REGIO_WRITE_ENABLE_OUT => regio_write_enable_out,
- REGIO_DATA_OUT => regio_data_out,
- REGIO_DATA_IN => regio_data_in,
- REGIO_DATAREADY_IN => regio_dataready_in,
- REGIO_NO_MORE_DATA_IN => regio_no_more_data_in,
- REGIO_WRITE_ACK_IN => regio_write_ack_in,
- REGIO_UNKNOWN_ADDR_IN => regio_unknown_addr_in,
- REGIO_TIMEOUT_OUT => regio_timeout_out,
+ REGIO_ADDR_OUT => regio_addr_i,
+ REGIO_READ_ENABLE_OUT => regio_read_enable_i,
+ REGIO_WRITE_ENABLE_OUT => regio_write_enable_i,
+ REGIO_DATA_OUT => regio_data_out_i,
+ REGIO_DATA_IN => regio_data_in_i,
+ REGIO_DATAREADY_IN => regio_dataready_i,
+ REGIO_NO_MORE_DATA_IN => regio_no_more_data_i,
+ REGIO_WRITE_ACK_IN => regio_write_ack_i,
+ REGIO_UNKNOWN_ADDR_IN => regio_unknown_addr_i,
+ REGIO_TIMEOUT_OUT => regio_timeout_i,
TIMER_TICKS_OUT => timer_ticks,
ONEWIRE => ONEWIRE,
ONEWIRE_MONITOR_IN => ONEWIRE_MONITOR_IN,
HUB_STAT_GEN => buf_HUB_STAT_GEN
);
- hub_ctrl_debug(2 downto 0) <= not io_error_in;
+ hub_ctrl_debug(2 downto 0) <= not ERROR_OK;
hub_ctrl_debug(31 downto 3) <= (others => '0');
HUB_STAT_GEN <= buf_HUB_STAT_GEN;
trg_apl_error_pattern_in(23 downto 16) <= CTS_TRG_RND_CODE_IN;
trg_apl_error_pattern_in(31 downto 24) <= CTS_TRG_INFORMATION_IN(7 downto 0);
CTS_TRG_BUSY_OUT <= trg_apl_run_out;
+
+ hub_reply_dataready_in(2) <= '0';
+ hub_reply_data_in(47 downto 32) <= (others => '0');
+ hub_reply_packet_num_in(8 downto 6) <= (others => '0');
+ hub_init_read_in(2) <= '0';
+
+
PROC_TRG_STATUS_BITS : process(CLK)
begin
-- IPU Channel Sender
---------------------------------------------------------------------
- hub_reply_data_in(31 downto 16) <= (others => '0');
- hub_reply_packet_num_in(5 downto 3) <= (others => '0');
- hub_reply_dataready_in(1) <= '0';
- hub_init_read_in(1) <= '1';
+ hub_reply_data_in(63 downto 48) <= (others => '0');
+ hub_reply_packet_num_in(11 downto 9) <= (others => '0');
+ hub_reply_dataready_in(3) <= '0';
+ hub_init_read_in(3) <= '1';
THE_STREAMING : trb_net16_api_ipu_streaming_internal
port map(
TRG_RELEASE_IN => lvl1_trg_release,
TRG_ERROR_PATTERN_IN => lvl1_error_pattern
);
-
+
+ hub_init_dataready_in(0) <= '0';
+ hub_init_data_in(15 downto 0) <= (others => '0');
+ hub_init_packet_num_in(2 downto 0) <= (others => '0');
+ hub_reply_read_in(0) <= '0';
RDO_LVL1_HANDLER : handler_lvl1
generic map (
STAT_FIFO_TO_APL => open
);
+ hub_init_dataready_in(1) <= '0';
+ hub_init_data_in(31 downto 16) <= (others => '0');
+ hub_init_packet_num_in(5 downto 3) <= (others => '0');
+ hub_reply_read_in(1) <= '0';
+
RDO_IPUDATA_APL : trb_net16_ipudata
port map(
CLK => CLK,
GSC_REPLY_DATA_OUT <= hub_reply_data_out(79 downto 64);
GSC_REPLY_PACKET_NUM_OUT <= hub_reply_packet_num_out(14 downto 12);
hub_reply_read_in(4) <= GSC_REPLY_READ_IN;
- GSC_BUSY_OUT <= buf_HUB_STAT_GEN(4);
+ GSC_BUSY_OUT <= buf_HUB_STAT_GEN(3);
+
+ hub_reply_dataready_in(4) <= '0';
+ hub_reply_data_in(79 downto 64) <= (others => '0');
+ hub_reply_packet_num_in(14 downto 12) <= (others => '0');
+ hub_init_read_in(4) <= '1';
-
-------------------------------------------------
-- Common Status Register
-------------------------------------------------
- proc_gen_common_stat_regs : process(common_stat, stat_lvl1_handler, lvl1_trg_information, lvl1_trg_type, lvl1_trg_number, lvl1_trg_code)
+ proc_gen_common_stat_regs : process(common_stat, stat_lvl1_handler, lvl1_trg_information,
+ lvl1_trg_type, lvl1_trg_number, lvl1_trg_code,
+ stat_counters_lvl1_handler, int_trigger_num)
begin
COMMON_STAT_REGS <= common_stat;
COMMON_STAT_REGS(4) <= stat_lvl1_handler(12);