Decode physical addresses instead of virtual.

address decoding is now performed on the translated address which comes
from the memory mapper, instead of the address coming directly from the
cpu.

This means that you can access the full amount of ram at any address
that it is mapped to.
This commit is contained in:
Byron Lathi
2022-04-07 12:32:51 -05:00
parent 5548f9d02a
commit 2f79a00000
3 changed files with 17 additions and 17 deletions

View File

@@ -4,7 +4,7 @@ timeunit 10ns;
timeprecision 1ns;
logic [15:0] addr;
logic [23:0] addr;
logic sdram_cs;
logic rom_cs;
logic hex_cs;
@@ -20,13 +20,13 @@ addr_decode dut(.*);
initial begin : TEST_VECTORS
for (int i = 0; i < 2**16; i++) begin
for (int i = 0; i < 2**24; i++) begin
addr <= i;
#1
assert(cs_count < 2)
else
$error("Multiple chip selects present!");
if (i < 16'h7fe0) begin
if (i < 16'h7fe0 || i >= 24'h010000) begin
assert(sdram_cs == '1)
else
$error("Bad CS! addr=%4x should have sdram_cs!", addr);
@@ -61,7 +61,7 @@ initial begin : TEST_VECTORS
else
$error("Bad CS! addr=%4x should have irq_cs!", addr);
end
if (i >= 2**15) begin
if (i >= 2**15 && i < 24'h010000) begin
assert(rom_cs == '1)
else
$error("Bad CS! addr=%4x should have rom_cs!", addr);