Add mapped address output and test

This commit is contained in:
Byron Lathi
2023-10-18 08:54:23 -07:00
parent 35d4ea968e
commit 69e443d223
2 changed files with 21 additions and 0 deletions

View File

@@ -63,6 +63,8 @@ int errors;
int rnd_values [16];
int rnd_addr;
initial begin
for (int i = 0; i < 16; i++) begin
rnd_values[i] = $urandom();
@@ -95,6 +97,17 @@ initial begin
end
end
for (int i = 0; i < 16; i++) begin
rnd_addr = $urandom();
addr = i << 12 | rnd_addr[11:0];
#1 // Neccesary for this assertion to work
assert (map_addr == {rnd_values[i][12:0], rnd_addr[11:0]}) else begin
$error("Expected %x got %x", {rnd_values[i][12:0], rnd_addr[11:0]}, map_addr);
end
@(posedge r_clk_cpu);
end
if (errors != 0) begin
$finish_and_return(-1);
end else begin