signal reset_timeout : std_logic_vector( 4 downto 0);
+signal dca_trb_reset : std_logic;
+signal dca_trb_reset_nosync : std_logic;
+
begin
reset_dca <= not RST_N_DCA;
TX_DATA_SIZE => tx_data_size_dca,
TX_READ_SIZE_ACK => tx_rd_size_ack,
+ DCA_TRB_RESET => dca_trb_reset_nosync,
--WB_RESPONSE_READY_IN => WB_RESPONSE_READY,
PULSE_B_OUT => rx_data_wr_sync_i
);
+ THE_SYNC_DCA_TRB_RESET_STB : entity work.pulse_sync
+ port map(
+ RESET_A_IN => reset_dca,
+ CLK_A_IN => CLK_DCA,
+ PULSE_A_IN => dca_trb_reset_nosync,
+
+ RESET_B_IN => RESET,
+ CLK_B_IN => CLK,
+ PULSE_B_OUT => dca_trb_reset
+ );
+
rx_data_wr_sync <= rx_data_wr_sync_i when reset_timeout(4) = '1'
else '0';
RESET_DETECTED_PROC : process(CLK)
begin
if rising_edge(CLK) then
- if (dissect_current_state = IDLE) then
- reset_detected <= '0';
- elsif (rx_data_dca_sync(15 downto 8) = x"80" and rx_data_wr_sync = '1' and saved_hdr_ctr = "0010") then
+ if (dca_trb_reset = '1') then
reset_detected <= '1';
else
- reset_detected <= reset_detected;
+ if (dissect_current_state = IDLE) then
+ reset_detected <= '0';
+ elsif (rx_data_dca_sync(15 downto 8) = x"80" and rx_data_wr_sync = '1' and saved_hdr_ctr = "0010") then
+ reset_detected <= '1';
+ else
+ reset_detected <= reset_detected;
+ end if;
end if;
end if;
end process RESET_DETECTED_PROC;
if rising_edge(CLK) then
if (dissect_current_state = IDLE) then
make_reset <= '0';
+ elsif (dca_trb_reset = '1') then
+ make_reset <= '1';
elsif (dissect_current_state = CLEANUP and reset_detected = '1') then
make_reset <= '1';
else
TX_DATA_IN : in std_logic_vector(31 downto 0);
TX_DATA_SIZE : in std_logic_vector(15 downto 0); -- in byte
- TX_READ_SIZE_ACK : out std_logic;
+ TX_READ_SIZE_ACK : out std_logic;
+
+ DCA_TRB_RESET : out std_logic;
DEBUG_OUT : out std_logic_vector(63 downto 0)
);
TX_SIZE_i(15 downto 0) => TX_DATA_SIZE,
TX_SIZE_i_ack => TX_READ_SIZE_ACK,
+ DCA_TRB_RESET_o => open,
+ DCA_TRB_RESET_o_stb => DCA_TRB_RESET,
+
rst_n_i => RST_N,
clk_sys_i => CLK_DCA
);