Exercise 3

The source files are tut2.tv, and counter1.v or counter1.vhd. tut2.tv is a simple translation of tut1.tv into a procedural, or 'imperative', style. The code contains two functions, both of which execute drive statements. The code is interesting in that it uses an implicit variable, and has a minimal level of type checking (the _StrictChecking pragma is set to 0; the default level is 1).

This form of testbench is more flexible than the simple linear sequence of test vectors in tut1.tv. However, the use of implicit variables, and the minimal level of type checking, mean that this style of coding is not suitable for large testbenches. See tut3.tv (exercises 5 and 6) for a safer version.

The expected output is:

  (Log) (200 ns) 20 vectors executed (20 passes, 0 fails)