Skip to content

Commit e85be28

Browse files
Fix tutorial test bench
The test bench in the tutorial didn't compile, because it used `outputVerifier` instead of `outputVerifier'` (note prime at end). Furthermore, several engineers have commented over the years that this structure we've always suggested in our tutorial material, with `expectOutput` as a function that takes the output signal, and the DUT being wired up in the definition of `done`, is a bit odd. I feel it makes more sense to define `out` and `expected` as the signal from the DUT and the expected signal from the DUT.
1 parent 5ebb975 commit e85be28

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tutorial/src/first-steps/test-bench.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ testBench = done
3333
clk
3434
rst
3535
$(listToVecTH [(1, 1) :: (Signed 9, Signed 9), (2, 2), (3, 3), (4, 4)])
36-
expectOutput =
37-
outputVerifier clk rst $(listToVecTH [0 :: Signed 9, 1, 5, 14, 14, 14, 14])
38-
done = expectOutput (topEntity clk rst en testInput)
39-
en = enableGen
36+
out = topEntity clk rst en testInput
37+
expected = $(listToVecTH [0 :: Signed 9, 1, 5, 14, 14, 14, 14])
38+
done = outputVerifier' clk rst expected out
4039
clk = tbSystemClockGen (not <$> done)
4140
rst = systemResetGen
41+
en = enableGen
4242
```
4343

4444
This will create a stimulus generator that creates the same inputs as we used earlier for the simulation of the circuit, and creates an output verifier that compares against the results we got from our earlier simulation.

0 commit comments

Comments
 (0)