vram/MemArbiter: plumb verbose test flag into test

This commit is contained in:
David Anderson 2024-09-09 11:22:05 -07:00
parent 80391cefee
commit 719339e69f
1 changed files with 4 additions and 2 deletions

View File

@ -71,6 +71,7 @@ interface TB;
endinterface
module mkArbiterTB(MemArbiter#(n, Addr) dut, Vector#(m, TestCase#(n)) tests, TB ifc);
let testflags <- mkTestFlags();
let cycles <- mkCycleCounter();
Reg#(Bit#(TLog#(m))) idx <- mkReg(0);
@ -113,7 +114,8 @@ module mkArbiterTB(MemArbiter#(n, Addr) dut, Vector#(m, TestCase#(n)) tests, TB
got_grants[i] = dut.ports[i].grant();
$display("RUN %s (%0d)", tests[idx].name, idx);
if (got_grants != want_grants || got_conflict_out != want_conflict_out) begin
let err = (got_grants != want_grants || got_conflict_out != want_conflict_out);
if (err || testflags.verbose) begin
$display("input:");
for (Integer i=0; i<valueOf(n); i=i+1)
$display(" ", $format("%0d", i), ": ", req_s(reqs[i]));
@ -125,8 +127,8 @@ module mkArbiterTB(MemArbiter#(n, Addr) dut, Vector#(m, TestCase#(n)) tests, TB
$display(" want grants: ", fshow(tests[idx].want_grants));
$display(" want granted: ", fshow(want_conflict_out));
dynamicAssert(False, "wrong arbiter output");
end
dynamicAssert(!err, "wrong arbiter output");
dynamicAssert(cycles == 1, "arbiter took more than 0 cycles");