From b22c3f79faa30332224728e2d6637a3d761b9614 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sat, 13 Jun 2015 10:14:56 +0000 Subject: [PATCH] - fixed cache size dependent prefetch git-svn-id: http://moon:8086/svn/vhdl/trunk@1299 cc03376c-175c-47c8-b038-4cd826a8556b --- lib/spi/src/spi_flash_wb.vhd | 4 ++-- lib/spi/src/tb_spi_flash_wb.vhd | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) 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,