There are a variety of ways to do results checking in a testbench. They tend to fall into three categories.
- Tests generate expected results. The test writer is assumed to have a detailed understanding of what his or her test is trying to accomplish and is given methods to flag an error should something unexpected occur.
- Test generators generate expected results based on knowing the effect certain commands in any given test sequence have on the Device Under Test (DUT). The generator has the ability to generate a large number of sequences based on general templates created by its developer. Results checking for directed tests must be done using method #1 above.
- Monitors and other testbench infrastructure in the verification environment generate expected results based on observing the inputs to and outputs from the DUT. Stimulus can be provided by a test generator or directed test.
Almost every time I've worked on a new testbench I end up having a discussion with someone about this topic. Why? Because unlike some who prefer options 1 or 2, I am a big fan of option 3 (testbench infrastructure generates expected results).