From 76a1a36006d6d3cd4a89586de12dc6d0ca5feee6 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 15 Sep 2024 00:04:32 -0700 Subject: [PATCH] vram/VRAM: expand the full size test to check neighbor writes As part of debugging why my writes seemed to get mirrored across a stripe of 4 bytes. This test verifies that writing two contiguous addresses reads back the correct value, when run against the simulated ECP5 EBR model. --- vram/VRAM_Test.bsv | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vram/VRAM_Test.bsv b/vram/VRAM_Test.bsv index 5164d86..2f8a031 100644 --- a/vram/VRAM_Test.bsv +++ b/vram/VRAM_Test.bsv @@ -105,6 +105,7 @@ module mkTestFull(FSM); let fsm <- mkFSM(seq dut.cpu.request.put(VRAMRequest{addr: 1, data: tagged Valid 42}); + dut.cpu.request.put(VRAMRequest{addr: 2, data: tagged Valid 45}); dut.cpu.request.put(VRAMRequest{addr: 1, data: tagged Invalid}); action let resp <- dut.cpu.response.get(); @@ -112,6 +113,13 @@ module mkTestFull(FSM); $display("vram read: ", fshow(resp)); dynamicAssert(resp.data == 42, "wrong data read after writing"); endaction + dut.cpu.request.put(VRAMRequest{addr: 2, data: tagged Invalid}); + action + let resp <- dut.cpu.response.get(); + if (testflags.verbose) + $display("vram read: ", fshow(resp)); + dynamicAssert(resp.data == 45, "wrong data read after writing"); + endaction endseq); return fsm; endmodule