BugHunter Pro and the VeriLogger Simulators

2.12 Compiling Command-Line Based Designs with BugHunter

2.12 Compiling Command-Line Based Designs with BugHunter

Previous topic Next topic  

2.12 Compiling Command-Line Based Designs with BugHunter

Previous topic Next topic  

If you have a design that is normally compiled using batch scripts that launch command-line simulation tools, you can easily convert such designs to compile and run under BugHunter.

Quickly converting a batch script compiled design to a BugHunter project

For example, assume you have a batch script that performs the following commands to build and run a Verilog design using our command line simulation tools:

simx +incdir+.\includes -f moreoptions.f file1.v file2.v --scd_top top

simxloader +nostdout

To compile and run this design using BugHunter, you only need to set the appropriate Additional Options fields in the Verilog tab of the Project Simulation Properties dialog:

Note that any elaborator options passed in the Compile edit box will automatically be transferred to the elaborator during a Build operation by BugHunter, so the "--scd_top top" string could have been placed in the Compiler edit box instead of the Elaborator edit box. For clarity, however, we recommend that known elaborator options should be placed in the Elaborator edit box.

Using environment variable substitution in command-line options

It is sometime useful to use environment variable substitution when specifying paths in your command-line options. For example, a project may be used across multiple computers, and some of the files may be in different locations on each computer. Instead of creating two different copies of the project, you can define environment variables for these varying paths and use variable substitution in the command-line options string.

For example, let's say the .\includes directory from the previous example above is stored on the C: drive of computer A and the D: drive of computer B. On each computer we can define an environment variable, INCDIR, that points to the appropriate location:

On computer A: set INCDIR=c:\includes

On computer B: set INCDIR=d:\includes

Next, change the Compiler edit box contents to use environment variable substitution:

+incdir+$(INCDIR) -f moreoptions.f file1.v file2.v --scd_top top

The $() indicates that environment variable substitution should be performed on the string "INCDIR", replacing this string with either "c:\includes" or "d:\includes" depending on which machine the project is being built.

Converting a batch script for a 3rd party simulator without a separate elaboration phase

Some simulators, such as Cadence's Incisive simulator and SynaptiCAD's simx, allow designs to be compiled, elaborated, and ran in three separate steps. For example, a batch file to compile and run the design above using ncsim might look like:

ncverilog +incdir+.\includes -f moreoptions.f file1.v file2.v

ncelab top

ncsim +nostdout

To compile such a design using the BugHunter GUI with a two phase simulator in which Compile and Elaboration is performed in one step, just pass both the compile and elaboration phase options in the Compile edit box.

Note that BugHunter can automatically translate the ncsim options to simx options if you first pass the --nc_options command to set the options translation mode (see Section 12:3 SimSwapper Translation Modes). For example,

--nc_options +incdir+.\includes -f moreoptions.f file1.v.file2.v