From bb72dda61b23f7d41bee4f16fa8ab41c60e73b75 Mon Sep 17 00:00:00 2001 From: Christos Spirotis Date: Thu, 10 Sep 2020 14:46:31 +0100 Subject: [PATCH] HMBSI1536-87 Introduced reset for command queue in data streamer component --- .../data_streamer/7/src/data_streamer_7.vhd | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/generic_ip/data_streamer/7/src/data_streamer_7.vhd b/generic_ip/data_streamer/7/src/data_streamer_7.vhd index 1caed7f..0c5606d 100644 --- a/generic_ip/data_streamer/7/src/data_streamer_7.vhd +++ b/generic_ip/data_streamer/7/src/data_streamer_7.vhd @@ -114,7 +114,7 @@ architecture rtl of data_streamer_7 is constant CONST_IP_ID_NUMBER : std_logic_vector(7 downto 0) := 8x"0d"; constant CONST_IP_ID_MFR_NUMBER: std_logic_vector(7 downto 0) := 8x"04"; - constant CONST_IP_VER_MINOR : std_logic_vector(7 downto 0) := 8x"05"; + constant CONST_IP_VER_MINOR : std_logic_vector(7 downto 0) := 8x"06"; constant CONST_IP_VER_MAJOR : std_logic_vector(7 downto 0) := 8x"07"; subtype CMD_BITS is natural range 3 downto 0; @@ -217,7 +217,10 @@ architecture rtl of data_streamer_7 is signal is_slim : std_logic; - signal cmd_available_step : std_logic; + signal cmd_available_step : std_logic; + + signal cmd_queue_rst_sreg : std_logic_vector( 2 downto 0); + signal cmd_queue_rst : std_logic; begin @@ -232,6 +235,25 @@ begin -- --------------------------------------- -- COMMAND QUEUE -- --------------------------------------- + + -- This process initialises a reset shift register for the command queue whenever the FPGA is reset + -- to an all ones pattern. When the FPGA reset goes away the shift register starts filling up with '0's. + CMD_Q_RST : process (clk, rst_n) + begin + if rst_n = '0' then + cmd_queue_rst_sreg <= (others => '1'); + elsif (clk'event and clk = '1') then + -- Shift in '0' on every rising edge of the clock when there is no FPGA reset active + cmd_queue_rst_sreg <= cmd_queue_rst_sreg(cmd_queue_rst_sreg'LENGTH-2 downto 0) & '0'; + end if; + end process CMD_Q_RST; + + -- The final reset driving the command queue is the logic OR of control_clear_cmd comming from + -- the register block and the MSB of the reset shift register. This results on the command queue + -- receiving a clear whenever the FPGA itself is reset. + cmd_queue_rst <= control_clear_cmd or cmd_queue_rst_sreg(cmd_queue_rst_sreg'LENGTH-1); + + -- Instantiate the command queue cmd_queue_inst : entity work.cmd_queue_7 generic map( QUEUE_DEPTH => CMD_QUEUE_DEPTH @@ -239,7 +261,7 @@ begin port map ( clock => clk, - sclr => control_clear_cmd, + sclr => cmd_queue_rst, wrreq => cmd_q_write, data => cmd_q_write_data,