diff --git a/vram/VRAMCore_Test.bsv b/vram/VRAMCore_Test.bsv index 6f0c1df..6923e5e 100644 --- a/vram/VRAMCore_Test.bsv +++ b/vram/VRAMCore_Test.bsv @@ -38,8 +38,16 @@ module mkIncrementingValue(ValFn); function ActionValue#(Bit#(8)) next(); return (actionvalue - val <= val+1; - return val; + // Cycle through 101 values. 101 is prime, so the + // pattern it generates doesn't align to a power of + // two and should detect any memory mapping errors. + if (val == 100) + val <= 0; + else + val <= val+1; + // Add another number to get all nonzero values, to + // detect writes that don't stick. + return 23+val; endactionvalue); endfunction