Product Documentation
Virtuoso NC-Verilog Environment User Guide
Product Version IC23.1, September 2023

6


Working with the Stimulus

In the NC-Verilog® Integration environment, a test fixture provides the stimulus that drives the simulation. This chapter describes the following:

Simulation Process Flowchart

Specifying the Test Fixture

To run a simulation, your current run directory must contain a test fixture. A test fixture provides stimulus to drive the simulation. In the NC-Verilog Integration Environment, a test fixture includes:

NC-Verilog Integration Environment saves the paths to these files in the following two variables in the.vlogifrc file:

For information on selecting test fixtures, refer to Selecting Test Fixture Files. You can use either of the following methods to specify a test fixture:

Using Default Test Fixture Files

By default, when you generate netlist for your design for the first time in a new run directory, NC-Verilog creates the following test fixture files:

The test fixture files are automatically created when netlist is generated because the Generate Verilog Test Fixture Template check box on the Netlist Setup form is selected by default.

To use a test fixture that was used for the previous simulation of your design, deselect the Generate Verilog Test Fixture Template check box on the Netlist Setup form. In this case, the default test fixture files are not created while generation of netlist and the testbench and stimulus files saved in the directories specified in the.vlogifrc file are used.

Editing an Existing Test Fixture

If you do not want to use the default test fixture files created during netlist generation, you can select an existing set of files. If required, you can also modify the default or other selected text fixture files. In the NC-Verilog Integration Environment, you can use the Edit Test Fixture form to work with the test fixture files.

To open the Edit Test Fixture form, choose CommandsEdit Test Fixture.

For more information on editing test fixtures, refer to Viewing or Editing Test Fixture Files.

Working with Test Fixture Files

The following sections describe how you can work with the test fixture files:

Selecting Test Fixture Files

The File Name field in the Testbench and Stimulus sections of the Edit Test Fixture form show the names of the testbench and stimulus files to be used for simulation. If you have generated netlist for your design for the first time in a new run directory, names of the default files are displayed. Otherwise, names of the files used in the last simulation run are displayed.

To select another testbench file:

  1. In the Testbench group box, click Browse File ( ).
    The Select Testbench File form appears.
  2. Browse to the directory where the testbench you want to use is saved and select the file.
  3. Click Open to use the specified file and close the form.
    The selected file becomes the current testbench and its name appears in the File Name field.
    The names of the testbench files used in previous simulations are saved in the File Name field list. You can select a file name from this list also and use it for the current simulation.
  4. Ensure that the Set Selected File As Testbench check box is selected. If this check box is deselected, the testbench file used in the previous simulation run is used.
  5. Click Apply to apply the change.
The value of the vlogifCurrentTestFixture variable in the .vlogifrc file is also updated with the file name you selected in this form.

Similarly, in the Stimulus group box, you can select a stimulus file.

Resetting the Default Test Fixture Files

At any time, if you want to select the default test fixture files, click the Defaults button in the Edit Test Fixture form.

The names of the default files, textfixture.template and textfixture.verilog, are displayed in both the File Name fields in the form. In addition, the two check boxes, Set Selected File as Testbench and Set Selected File as Stimulus, are also automatically selected.

If the default test fixture files were not created in any previous run, these are created when the next time netlist is created for this design.

Viewing or Editing Test Fixture Files

You can view or edit the contents of the currently selected test fixture files in a text editor. To open the testbench or stimulus file from the Edit Test Fixture form, click Edit/View Selected File( ).

The selected file opens in the default text editor of Virtuoso. You can make the desired changes in the file and save it. However, before making changes to a file, you might want to save a copy of that file. For more details, see Copying Edit Test Fixture Files.

After you edit a file, click Check Syntax below the file name to check for any syntax errors.

NC-Verilog internally starts ncvlog that checks the test fixture file for any syntax error and displays appropriate messages.

The executable and log file names will depend on the simulator being used. For the changes in the executable and log file name when using the Xcelium simulator, see Running Simulations with Xcelium.

Copying Edit Test Fixture Files

You can copy the current test fixture files to the current or a different run directory. You would typically do this if you want to edit the file for the current simulation, but you want to use it as it is for another simulation run.

To copy the currently selected test fixture file,

  1. Click Copy Selected File ( ).
    The Copy To form appears.
  2. Browse to the directory where you want to save a copy of the current file.
  3. In the File name field, specify the name with which you want to save a copy of the file.
  4. Click Save.

A copy of the testbench file is created in the specified directory.

Deleting Test Fixture Files

To delete the selected testbench or the stimulus file, click Delete Selected File ( ) next to the file name. A dialog box appears prompting you to confirm that you want to delete the file. Click Yes to delete the file. The file is removed from the File Name field. It is also deleted from the run directory in which it was created.


Return to top
 ⠀
X