diff --git a/generic_ip/preslicer/0/src/altera/preslicer_fifo_0.vhd b/generic_ip/preslicer/0/src/altera/preslicer_fifo_0.vhd index efbb9b9..c2810b7 100644 --- a/generic_ip/preslicer/0/src/altera/preslicer_fifo_0.vhd +++ b/generic_ip/preslicer/0/src/altera/preslicer_fifo_0.vhd @@ -45,7 +45,7 @@ entity preslicer_fifo_0 is ( WIDTH : natural range 1 to 128 := 32; DEPTH : natural range 1 to 8182 := 1024; - ALMOST_EMPTY_THRESH : natural range 1 to 1024 := 512 + ALMOST_FULL_THRESH : natural range 1 to 1024 := 512 ); port ( @@ -117,7 +117,7 @@ BEGIN generic map ( add_ram_output_register => "ON", almost_empty_value => 2, - almost_full_value => ALMOST_EMPTY_THRESH, + almost_full_value => ALMOST_FULL_THRESH, intended_device_family => "Cyclone V", lpm_numwords => DEPTH, lpm_showahead => "ON", diff --git a/generic_ip/preslicer/0/src/preslicer_0.vhd b/generic_ip/preslicer/0/src/preslicer_0.vhd index 68e21bb..93799d7 100644 --- a/generic_ip/preslicer/0/src/preslicer_0.vhd +++ b/generic_ip/preslicer/0/src/preslicer_0.vhd @@ -1,4 +1,4 @@ -------------------------------------------------------------------------------- +----------------------------------------------------------------------------- --! @file --! @brief SOM FPGA preslicer --! @@ -49,10 +49,10 @@ use work.common_pkg.all; entity preslicer_0 is generic( - NUM_STRIPES_DEPTH : integer range 2 to 32 := 4; -- whole 1bpp equivalent stripes must it be possible to buffer in preslicer - NUM_STRIPES_FULL_MARGIN : integer range 1 to 31 := 1; -- at least this many 1bpp equivalent stripes space must be available + NUM_STRIPES_DEPTH : integer range 2 to 32 := 8; -- whole 1bpp equivalent stripes must it be possible to buffer in preslicer + NUM_STRIPES_FULL_MARGIN : integer range 1 to 31 := 2; -- at least this many 1bpp equivalent stripes space must be available SHIFT_DEPTH : integer range 1 to 2048 := 128; -- head shift buffer depth - MAX_OP_WIDTH : natural range 1 to 128 := 12 + MAX_OP_WIDTH : natural range 1 to 128 := 8 ); port ( @@ -101,9 +101,9 @@ architecture rtl of preslicer_0 is constant STRIPE_SIZE_POW2 : integer := 2**log2((SHIFT_DEPTH * MAX_OP_WIDTH) / DWORD_BITS); - constant DEPTH : natural range 1 to 8182 := STRIPE_SIZE_POW2 * NUM_STRIPES_DEPTH; -- in 32bit words (+ 1 bit flag) - constant ALMOST_EMPTY_THRESH : natural range 1 to 1024 := STRIPE_SIZE_POW2 * (NUM_STRIPES_DEPTH - NUM_STRIPES_FULL_MARGIN); - signal usedw : std_logic_vector(log2(DEPTH) - 1 downto 0); + constant DEPTH : natural range 1 to 8182 := STRIPE_SIZE_POW2 * NUM_STRIPES_DEPTH; -- in 32bit words (+ 1 bit flag) + constant ALMOST_FULL_THRESH : natural range 1 to 1024 := STRIPE_SIZE_POW2 * (NUM_STRIPES_DEPTH - NUM_STRIPES_FULL_MARGIN); + signal usedw : std_logic_vector(log2(DEPTH) - 1 downto 0); signal bpp1_slice : exp_data_t; signal bpp2_slice : exp_data_t; @@ -146,10 +146,10 @@ begin "00" & shift_reg(1)(23 downto 22) & "00" & shift_reg(1)(21 downto 20) & "00" & shift_reg(1)(19 downto 18) & "00" & shift_reg(1)(17 downto 16); - bpp2_slice(2) <= "000" & shift_reg(1)(15 downto 14) & "00" & shift_reg(1)(13 downto 12) & - "00" & shift_reg(1)(11 downto 10) & "00" & shift_reg(1)(9 downto 8) & - "00" & shift_reg(1)(7 downto 6) & "00" & shift_reg(1)(5 downto 4) & - "00" & shift_reg(1)(3 downto 2) & "00" & shift_reg(1)(1 downto 0); + bpp2_slice(2) <= "000" & shift_reg(1)(15 downto 14) & "00" & shift_reg(1)(13 downto 12) & + "00" & shift_reg(1)(11 downto 10) & "00" & shift_reg(1)( 9 downto 8) & + "00" & shift_reg(1)( 7 downto 6) & "00" & shift_reg(1)( 5 downto 4) & + "00" & shift_reg(1)( 3 downto 2) & "00" & shift_reg(1)( 1 downto 0); bpp2_slice(1) <= shift_reg(0)(32) & "00" & shift_reg(0)(31 downto 30) & "00" & shift_reg(0)(29 downto 28) & @@ -157,21 +157,21 @@ begin "00" & shift_reg(0)(23 downto 22) & "00" & shift_reg(0)(21 downto 20) & "00" & shift_reg(0)(19 downto 18) & "00" & shift_reg(0)(17 downto 16); - bpp2_slice(0) <= "000" & shift_reg(0)(15 downto 14) & "00" & shift_reg(0)(13 downto 12) & - "00" & shift_reg(0)(11 downto 10) & "00" & shift_reg(0)(9 downto 8) & - "00" & shift_reg(0)(7 downto 6) & "00" & shift_reg(0)(5 downto 4) & - "00" & shift_reg(0)(3 downto 2) & "00" & shift_reg(0)(1 downto 0); + bpp2_slice(0) <= "000" & shift_reg(0)(15 downto 14) & "00" & shift_reg(0)(13 downto 12) & + "00" & shift_reg(0)(11 downto 10) & "00" & shift_reg(0)( 9 downto 8) & + "00" & shift_reg(0)( 7 downto 6) & "00" & shift_reg(0)( 5 downto 4) & + "00" & shift_reg(0)( 3 downto 2) & "00" & shift_reg(0)( 1 downto 0); -- Pull out the bits from the shift register for the 3BPP mode bpp1_slice(3) <= shift_reg(0)(32) & "000" & shift_reg(0)(31) & "000" & shift_reg(0)(30) & "000" & shift_reg(0)(29) & "000" & shift_reg(0)(28) & "000" & shift_reg(0)(27) & "000" & shift_reg(0)(26) & "000" & shift_reg(0)(25) & "000" & shift_reg(0)(24); - bpp1_slice(2) <= "0000" & shift_reg(0)(23) & "000" & shift_reg(0)(22) & "000" & shift_reg(0)(21) & "000" & shift_reg(0)(20) & + bpp1_slice(2) <= "0000" & shift_reg(0)(23) & "000" & shift_reg(0)(22) & "000" & shift_reg(0)(21) & "000" & shift_reg(0)(20) & "000" & shift_reg(0)(19) & "000" & shift_reg(0)(18) & "000" & shift_reg(0)(17) & "000" & shift_reg(0)(16); - bpp1_slice(1) <= "0000" & shift_reg(0)(15) & "000" & shift_reg(0)(14) & "000" & shift_reg(0)(13) & "000" & shift_reg(0)(12) & - "000" & shift_reg(0)(11) & "000" & shift_reg(0)(10) & "000" & shift_reg(0)(9) & "000" & shift_reg(0)(8); - bpp1_slice(0) <= "0000" & shift_reg(0)(7) & "000" & shift_reg(0)(6) & "000" & shift_reg(0)(5) & "000" & shift_reg(0)(4) & - "000" & shift_reg(0)(3) & "000" & shift_reg(0)(2) & "000" & shift_reg(0)(1) & "000" & shift_reg(0)(0); + bpp1_slice(1) <= "0000" & shift_reg(0)(15) & "000" & shift_reg(0)(14) & "000" & shift_reg(0)(13) & "000" & shift_reg(0)(12) & + "000" & shift_reg(0)(11) & "000" & shift_reg(0)(10) & "000" & shift_reg(0)( 9) & "000" & shift_reg(0)( 8); + bpp1_slice(0) <= "0000" & shift_reg(0)( 7) & "000" & shift_reg(0)( 6) & "000" & shift_reg(0)( 5) & "000" & shift_reg(0)( 4) & + "000" & shift_reg(0)( 3) & "000" & shift_reg(0)( 2) & "000" & shift_reg(0)( 1) & "000" & shift_reg(0)( 0); -- Pick out the appropriate slices, for the BPP mode, to get the 128 bit expanded vector GEN_EXP_DATA : for i in 0 to 3 generate @@ -181,8 +181,8 @@ begin end generate; -- Indicate the word_num phases to read the fifo for each BPP mode - read_phase <= '1' when (bpp_mode = 2x"1" and word_num(0) = 2x"2") or - (bpp_mode = 2x"2" and word_num(0)(1) = '0') or + read_phase <= '1' when (bpp_mode = 2x"1" and word_num (0) = 2x"2") or + (bpp_mode = 2x"2" and word_num(0)(1) = '0') or bpp_mode = 2x"3" or bpp_mode = 2x"0" else '0'; -- Flag when the word_num index is 0- @@ -201,9 +201,9 @@ begin preslicer_fifo_inst : entity work.preslicer_fifo_0 generic map ( - WIDTH => 33, - DEPTH => DEPTH, - ALMOST_EMPTY_THRESH => ALMOST_EMPTY_THRESH + WIDTH => 33, + DEPTH => DEPTH, + ALMOST_FULL_THRESH => ALMOST_FULL_THRESH ) port map (