Product Documentation
Virtuoso VHDL Toolbox User Guide
Product Version IC23.1, June 2023

4


Creating a Testbench

A testbench is typically an entity/architecture pair, which instantiates the top-level cell and provides stimulus to the Design Under Test (DUT). By using the VHDL Create Test Bench form, you can:

This chapter describes how you can use the VHDL Toolbox to configure properties for a testbench and the various methods used for creating a testbench.

In this chapter, you will learn about the following topics:

For information on the SKILL functions associated with VHDL Toolbox, see Digital Design Netlisting and Simulation SKILL Reference.

VHDL Create Test Bench Form

The VHDL Create Test Bench form contains fields that you can use to configure the properties of a testbench. To open the VHDL Create Test Bench form:

  1. In the VHDL Toolbox window, choose Commands – Edit Test Bench. The VHDL Create Test Bench form appears, as shown in the figure below.

The various options on the VHDL Create Test Bench form are:

Methods to Create a Testbench

You can create a testbench for the top level schematic in two ways:

Automatic Generation of Testbench

To create a testbench automatically, select the Generate Test Bench Template option on the Netlist Options tab of the VHDL Setup - Netlist form. When this option is used, the VHDL Toolbox creates a testbench and saves it as test_bench.vhd in the run directory.

The default structure of the testbench is as given below:

<Default Context Clause>
ENTITY <entname>
END [ENTITY] <entname>
<Default Context Clause>
<use lib clause>
ARCHITECTURE <archname> of <entname> IS
< COMPONENT DECLARATION>
< SIGNAL DECLARATION >
BEGIN
<INSTANCE NAME> : < BINDING >
PORT MAP ( 
  <formal_1> => <actual_1>
 )
END [ARCHITECTURE] <archname>

The instances are bound in the testbench in the same way as done during netlist creation, as described below:

You can configure details, such as the file name or the library name of the testbench to be generated, using the VHDL Create Test Bench form. Alternatively, you can also set certain SKILL variables. For more details, refer SKILL Variables to Configure Testbench Creation.

To view and edit the auto generated testbench, choose Commands – Edit Test Bench. The VHDL Create Test Bench form appears. The name and path of the testbench file appears in the VHDL Test Bench File field. To open the test bench in the default editor and make changes to the file, click the edit button .

Providing an Existing Testbench

If you have an existing testbench, provide its details to VHDL Toolbox using the VHDL Create Test Bench form. For more details about this form, refer to VHDL Create Test Bench Form.

SKILL Variables to Configure Testbench Creation

You can use the following SKILL variables to configure the testbench:


Return to top
 ⠀
X