Verification #42 · 2026-11-04 · Reference models · Easy · about 10 min
The reference model that rotates by too much
The DUT is an 8-bit rotator. Given data, a 4-bit amt (0 to 15) and a direction left, it rotates data by amt modulo 8: bits that fall off one end come back in at the other, and amt = 8 leaves data unchanged.
rot_scoreboard.check() is called once per DUT result. It asks rot_model.predict() for the right answer and counts, in errors, one error for each result that differs. A correct DUT must give 0 errors, and a DUT that gets 5 results wrong must give exactly 5.
The scoreboard in scoreboard.sv reports errors for a perfect DUT. Fix the model.
Write and run your answer in the browser. The hidden tests check it, and it’s free.