diff --git a/lib/Testing.bsv b/lib/Testing.bsv index 4d529f2..16884c7 100644 --- a/lib/Testing.bsv +++ b/lib/Testing.bsv @@ -36,6 +36,21 @@ module mkCycleCounter(CycleCounter); method all = total._read; endmodule +interface TestFlags; + method Bool verbose(); +endinterface + +module mkTestFlags(TestFlags); + Wire#(Bool) verbose_val <- mkBypassWire(); + + rule every; + let v <- $test$plusargs("v"); + verbose_val <= v; + endrule + + method verbose = verbose_val; +endmodule + // mkTest runs the given test, printing status text before and after // the run. Tests can be nested. function Stmt mkTest(String name, Stmt test);