diff --git a/generic_ip/pixel_buffer/2/src/pixel_buffer_zero_gap_2.vhd b/generic_ip/pixel_buffer/2/src/pixel_buffer_zero_gap_2.vhd index 1d16188..3ed7452 100644 --- a/generic_ip/pixel_buffer/2/src/pixel_buffer_zero_gap_2.vhd +++ b/generic_ip/pixel_buffer/2/src/pixel_buffer_zero_gap_2.vhd @@ -139,8 +139,12 @@ architecture rtl of pixel_buffer_zero_gap_2 is signal q_int : data_array_t(NUM_CHANS-1 downto 0)(MAX_OP_WIDTH*32-1 downto 0); signal rd_req_int : std_logic_vector(NUM_CHANS-1 downto 0); + signal rd_req_int_d : std_logic_vector(NUM_CHANS-1 downto 0); + signal rd_req_int_d_d : std_logic_vector(NUM_CHANS-1 downto 0); type rdreq_vec_t is array (natural range <> ) of std_logic_vector; signal rdreq_vec_int : rdreq_vec_t(NUM_CHANS-1 downto 0)(MAX_OP_WIDTH-1 downto 0); + signal rdreq_vec_int_d : rdreq_vec_t(NUM_CHANS-1 downto 0)(MAX_OP_WIDTH-1 downto 0); + signal rdreq_vec_int_d_d : rdreq_vec_t(NUM_CHANS-1 downto 0)(MAX_OP_WIDTH-1 downto 0); signal rd_req_rdy_int : std_logic_vector(NUM_CHANS-1 downto 0); signal empty_int : std_logic_vector(NUM_CHANS-1 downto 0); @@ -280,11 +284,11 @@ begin end generate; - clr_buf_active_rdreq(i) <= (last_stripe(i)(MAX_OP_WIDTH-1) and is_last_wave(i) and rd_req_int(i)) + clr_buf_active_rdreq(i) <= (last_stripe(i)(MAX_OP_WIDTH-1) and is_last_wave(i) and rd_req_int_d_d(i)) -- 2 clocks delay to match delay from rd_req to last_stripe_valid or last_stripe_dropped(i); -- if the last stripe of the image is dropped, the above case never happens GEN_SH: for j in 0 to SUB_HEADS-1 generate - clr_buf_active_rdvec(j)(i) <= (last_stripe(i)(j*2) and is_last_wave(i) and rdreq_vec_int(i)(j*2)) + clr_buf_active_rdvec(j)(i) <= (last_stripe(i)(j*2) and is_last_wave(i) and rdreq_vec_int_d_d(i)(j*2)) -- 2 clocks delay to match delay from rd_req to last_stripe_valid or last_stripe_dropped(i); -- if the last stripe of the image is dropped, the above case never happens clr_buf_active(j)(i) <= clr_buf_active_rdvec(j)(i) when VECTORED_RDREQ else clr_buf_active_rdreq(i); @@ -421,6 +425,23 @@ begin end process; + + P_REG : process(rst_n, clk) is + begin + if rst_n = '0' then + rd_req_int_d <= (others => '0'); + rd_req_int_d_d <= (others => '0'); + rdreq_vec_int_d <= (others => (others => '0')); + rdreq_vec_int_d_d <= (others => (others => '0')); + elsif clk'event and clk = '1' then + rd_req_int_d <= rd_req_int; + rd_req_int_d_d <= rd_req_int_d; + + rdreq_vec_int_d <= rdreq_vec_int; + rdreq_vec_int_d_d <= rdreq_vec_int_d; + end if; + end process; + P_DIAG : process(rst_n, clk) is begin if rst_n = '0' then