diff --git a/generic_ip/preslicer/0/src/preslicer_0.vhd b/generic_ip/preslicer/0/src/preslicer_0.vhd index 1351bc4..68e21bb 100644 --- a/generic_ip/preslicer/0/src/preslicer_0.vhd +++ b/generic_ip/preslicer/0/src/preslicer_0.vhd @@ -49,11 +49,10 @@ use work.common_pkg.all; entity preslicer_0 is generic( - --MAX_BPP : integer := 3; - NUM_STRIPES_DEPTH : integer range 2 to 8 := 4; -- whole stripes must it be possible to buffer in preslicer - NUM_STRIPES_FULL_MARGIN : integer range 1 to 7 := 1; -- at least this many stripes space must be available - SHIFT_DEPTH : integer range 1 to 1024 := 128; -- head shift buffer depth - MAX_OP_WIDTH : natural range 1 to 48 := 12 + 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 + SHIFT_DEPTH : integer range 1 to 2048 := 128; -- head shift buffer depth + MAX_OP_WIDTH : natural range 1 to 128 := 12 ); port ( @@ -98,7 +97,8 @@ architecture rtl of preslicer_0 is signal almost_full : std_logic; signal q : std_logic_vector(32 downto 0); - constant STRIPE_SIZE_POW2 : integer := 2**log2(SHIFT_DEPTH * MAX_OP_WIDTH / 32); + constant DWORD_BITS : integer := 32; + 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) @@ -191,8 +191,8 @@ begin -- Flag, for each BPP mode, when it is okay to read from the FIFO. For 1 BPP then only a single word is needed. -- For 2 BPP it's okay to read when at least two words are present, for 3/4 BPP it is four. ok_to_rd <= '1' when (empty = '0' and bpp_mode = 2x"1") or - ((full = '1' or usedw(usedw'high downto 1) /= 7x"0") and bpp_mode = 2x"2") or - ((full = '1' or usedw(usedw'high downto 2) /= 6x"0") and (bpp_mode = 2x"3" or bpp_mode = 2x"0")) else '0'; + ((full = '1' or unsigned(usedw(usedw'high downto 1)) /= 0) and bpp_mode = 2x"2") or + ((full = '1' or unsigned(usedw(usedw'high downto 2)) /= 0) and (bpp_mode = 2x"3" or bpp_mode = 2x"0")) else '0'; pixel_buf_wr_data <= pixel_buf_wr_data_int(31 downto 0); pixel_buf_last_word <= pixel_buf_wr_data_int(32);