diff --git a/lib/spi/src/spi_flash_wb.vhd b/lib/spi/src/spi_flash_wb.vhd index c0b410f..b9a6cfa 100644 --- a/lib/spi/src/spi_flash_wb.vhd +++ b/lib/spi/src/spi_flash_wb.vhd @@ -73,8 +73,8 @@ ARCHITECTURE rtl OF spi_flash_wb IS begin mst_dout_re <= '1'; mst_shift_en <= not spi_hold; - mst_cmd <= to_cmd(2080, 32); - mst_din <= X"03" & ADDR_I(FLASH_ADDR_BITS-1 downto CACHE_ADDR_BITS) & X"00"; + mst_cmd <= to_cmd(32 + 8 * 2**CACHE_ADDR_BITS, 32); + mst_din <= X"03" & ADDR_I(FLASH_ADDR_BITS-1 downto CACHE_ADDR_BITS) & (CACHE_ADDR_BITS-1 downto 0 => '0'); INT_O <= '0'; ACK_O <= ACK_mem or ACK_reg; DAT_O <= DAT_reg when ACK_reg = '1' else DAT_mem; diff --git a/lib/spi/src/tb_spi_flash_wb.vhd b/lib/spi/src/tb_spi_flash_wb.vhd index 9f68ec6..763faa6 100644 --- a/lib/spi/src/tb_spi_flash_wb.vhd +++ b/lib/spi/src/tb_spi_flash_wb.vhd @@ -64,6 +64,11 @@ BEGIN WPNeg <= '1'; uut : entity work.spi_flash_wb + GENERIC MAP + ( + FLASH_ADDR_BITS => 24, + CACHE_ADDR_BITS => 9 + ) PORT MAP ( CLK_I => CLK,