Step 2: Add the MUT to the Project

<< Click to Display Table of Contents >>

Navigation:  Chapter 1A: TestBencher Pro Design Flow >

Step 2: Add the MUT to the Project

Previous pageReturn to chapter overviewNext page

The Model Under Test (MUT) files of the design should be added to the project. TestBencher will use these files to instantiate MUTs into your testbench and extract the signal and port information for use in the transaction diagrams that stimulate the MUTs.

Copy or Add the MUT source files to the project:

•Right click on the User Source Files folder and either add or copy your design files to the project.
•The Copy menu copies the source file to the project folder and adds the copy to the project list. The Add function adds the file and its path without making a copy. Files can also be added by choosing the Project > Add User Source File(s) menu from the main bar.

addMutToProject

 

•If your MUT requires definitions from a package compiled into a different library, follow the steps in Section 8.5: Parsing Package Files into Libraries to ensure these packages are properly parsed. If your MUT parse does require files to be compiled into multiple libraries, you will probably need to directly set your desired model under test after the first parse, then parse again (see Step 3: Extract Ports into Template).

(Optional) Instantiate multiple MUTs in the Project

If your project only hooks up to one Model Under Test, MUT, that is the top level model in the source files then you can skip this and go on to Step 3. However, this product supports multiple MUTs and multiple instantiations of the same MUT. First build the project, then select your MUT and edit the port mappings of the new MUTs as desired. This should be done before creating the transactions so that you have all signals available during the transaction build step.

•Press the Build Button to parse the source files and populate the project window tree with module information.

compileButton

•Drill down into the User Source files node and right click on a MUT to open the context menu.
•Choose Set as a Model Under Test.

Menu_SetMUT

•Notice that the module has been added to the Models Under Test tree node. The green color indicates the port mappings are using defaults that match the port names of the MUT.

Menu_CloneEditMUT

•Choosing Clone Model Under Test from the right click context menu (shown above), creates another instance of the MUT.

cloned_mut

•The program guesses at the port mappings by matching same name signals. However, choosing Edit Model Under Test from the right click context menu (shown above), opens a dialog that allows the model instance name to be changed and the port and parameter mappings to be edited.

EditInstMap_Top

•Double clicking on the port name opens a drop-down that lets you choose a different port or type in a different name.
•After you edit the instance mappings the icon in the tree will turn RED, to indicate that the program will not overwrite the ports if other things change in the project.

EditInstMap_Ports

•If you want to investigate the model instantiations and define any new signals that you created, press the Make TB button, then double click on the Transaction-Level Model node to open an editor with generated test bench code.
•Make sure to define your new signals outside the code generation blocks. And also add them somewhere before the $InstantiateMUT code generation block.

Adding_wires

adding_wireswhere

Mixed VHDL and Verilog Designs:

If you have a multiple-language design or if you are more comfortable working in a particular HDL language, then the generated test bench and the design model do not have to be in the same language. You will need to write a wrapper module in the test bench generation language that instantiates the models in the other language. You will also need a multiple-language simulator to compile and debug the design.

mixed_signal_setup

•In Step 1, when you create the project, set the language to be the language that the test bench will be generated in. Also set the simulator to the name of your multiple-language simulator.
•Create a new file containg a wrapper module in the test bench language that instantiates the design model and maps signal types between the two different languages. The syntax for the instantiation of the design module will specified by your simulator. The ports for the wrapper will be the signals that the testbench drives and observes.
•Add the design files to User Source Files folder as described above. TestBencher can parse both VHDL and Verilog files and also send the files to the multiple-language simulator.