

You always want to be able to use the latest VHDL constructs in your testbench, but most synthesis tools don’t support them. It’s normal to use a higher version of VHDL for testbenches than for the RTL modules. You don’t need to change anything for the DUT. vhd file and select Properties→VHDL→Use 1076-2008->OK. Enable VHDL-2008įortunately, this can easily be fixed by setting the VHDL version for the testbench file to VHDL-2008. Package "STD.ENV" does not exist in this language version. If you try to compile the testbench in ModelSim without changing anything, you will get the following error: # ** Warning: gray_converter_tb.vhd(6): (vcom-1516) Note that we are importing which requires VHDL-2008. Signal gray : std_logic_vector(3 downto 0)
WRITE SELF CC CHECK CODE
For that I have created the module in the code below. Let’s jump right in and create an example of a self-checking testbench. We all know that stuff can break, and your best tool for catching these problems is the self-checking testbench. For example, when you make changes to the DUT, a sub-module, or an interfacing module.

It’s important to be able to verify that all modules have the intended behavior at any time.

The self-checking testbench runs entirely on its own, and prints an “OK” or “Failed” message in the end.Įvery VHDL module should have an associated self-checking testbench. A self-checking testbench is a VHDL program that verifies the correctness of the device under test (DUT) without relying on an operator to manually inspect the output.
