Logic Simulation. VCS Objective Learn how to simulate RTL and gate level design with VCS. Introduction VCS is used to compile input files and simulate design. For debug Discovery Visual Environment (DVE) is used. VCS is a command line tool compiling input sources. Using DVE it is possible to drag-and-drop signals in various views or use the menu options to view the signal source, trace drivers, compare waveforms, and view schematics. Use DVE to quickly find bugs in RTL or gate, assertions, testbench and coverage. Laboratory tasks 1. First compile johnson.v RTL source and Johnson_test.v testbenches using VCS with the following command: % vcs johnson_test.v johnson.v –gui –debug_all -gui -debug_all Enables DVE Enables command line debug including line tracing (optional) If compilation is successful, open DVE from the command line: % dve Fig.1. DVE Top-level GUI window 2. Setup DVE From menu bar select Simulator > Setup, In “Simulator executable” press “Browse…” and select “simv” file in the current directory Fig.2. Simulation setup The Simulation setup has the following options (Fig.2.): Simulator Executable - specifies the name of a simulator executable. Simulator arguments - identifies the simulator arguments. Interactive VPD file - specifies the name of the VPD file. VPD files (design database files) are platform- independent, versioned files into which it is possible to dump the selected signals during simulation. DVE gets hierarchy, value change, and some assertion information from these files. Current directory - specifies the full path of the simulator executable. toolbars menus frame Pane targets Status bar Fig.3. Overview of DVE window A TopLevel window contains: 1. Frame 2. Menus 3. Toolbars 4. Status bar 5. Pane targets. Viewing a Waveform Hierarchy Pane - displays the scope hierarchy of the design. Data Pane - displays the variables of the selected scopes of the Hierarchy pane. Source View - Displays the source code and supports source code relative features, such as tracing driver or load, and setting line breakpoints. List View - provides a table view to display the values of signals over time. Schematic View - provides a module-based schematic to display the connectivity of the object. Assertions View - displays the summary of assertion results of simulation including the success, failures, and the incomplete ones. To view waveform information for signals in the Wave view (Fig.4). 1. Select a scope or object from the Hierarchy pane, Data pane, Source view, List view, Schematic view, or Assertion view. 2. Click the Add to Waves icon in the toolbar. Using Simulator Menu Commands Runs the simulation until a breakpoint is hit, the simulation finishes, or for the duration specified in the set Continue Time dialog box or toolbar time entries. When the simulation is running, this icon is activated. Click to stop the simulation. Fig.4. WaveView window Tracing Drivers and Loads 1. Trace drivers and loads of a signal at any time to see the drivers/loads that caused a value change and see all the drivers/loads that possibly contributed to a signal value. 2. Select a signal in a view or pane. For example, Data pane, Source view, List view, etc. 3. Right-click and select Trace Drivers or Trace Loads. When a driver is traced, a new Driver pane will be created if none exists in the current top level frame. If a driver pane exists, the driver information will be added to the top of the list. Additionally, the first driver will be highlighted in the Source view and annotated with a blue node in the gutter. In the Wave view, double-click on a waveform to see its drivers. (Fig. 5) Link the Driver panes to Source view in the same top level frame and Path Schematic view. The Link to radio buttons, at the right top of the pane, shows the current linked windows. By linking a Source and Schematic view, when the object is selected in the Drivers pane, the object will also be selected in the linked views. Fig.5.TopLevel window with tracing drivers and loads Comparing Signals, Scopes, and Groups For comparing individual signals with the same bit numbers, scopes (for comparing variable children), buses, or groups of signals from one or two designs. To view a comparison 1. Select one or two signals, signal groups, scopes, or buses from the Signal pane of the Wave view. 2. Right-click and select Compare. Fig.6.The Waveform Compare dialog box 3. Click Load Reference Signals/Scopes and select the text file with the signals and scopes to reference. Note: If comparing two designs from root, then the reference waveform region and test waveform region can be empty. 4. Click the More Options button (Fig. 6). The dialog box is expanded and additional options are displayed. 5. In the Signal types and ignore options section, select the signal types to compare and select ignore options. For example, if Ignore X is selected and if the reference signal value is X, there is always a match, whatever the values of the Test Signal. 6. Enter a Time Tolerance to filter out mismatch values that have time ranges smaller than the tolerance range. 7. In the General section, select to compare recursively or to only create signals with mismatches. 8. Enter mismatch settings for maximum mismatches per signal and maximum total mismatches to report. 9. Click Apply to start the comparison and keep the dialog box open. Or click OK to start the comparison and close the dialog box (to open it at any time from the Signal pane CSM). Results are displayed in the current Wave view. 10. Select a result in the Wave view, right-click and select Show Compare Info. Fig.7. Compared Signal Groups in the Wave View Selecting signal in the Schematic View To select a signal in the Schematic view: 1. Enter the signal name in the Find toolbar box in the Schematic view, and then click the Find Next toolbar button. The signal is highlighted in the schematic. 2. With the signal selected, click the Trace Drivers toolbar button, or select the Trace-Drivers menu item. The signal is highlighted in purple (Fig. 8). Fig.8. Highlighted Signal Groups in the WaveView Using User-defined Radixes This section describes how to create, edit, import, and export user-defined radices. You can define a custom mnemonic mapping from values to strings for display in the Wave view. To create, delete, import, and export a user-defined radix 1. Select Signal > Set Radix > User Defined > Edit. 2. Click New, enter a radix name, and then hit the Enter key on the keyboard. All buttons on the Edit User-defined Radix get enabled. 3. Click Add Row to activate a row for the user-defined radix and perform the following steps: - Select the text and background colors for each row entry. - Select the radix, click a cell in the Value and Display column, then enter the values. The radix is edited. 4. Select a row, and then click Delete Row. The row is deleted. 5. Select a radix from the Radix Table Name drop-down and click the Delete button. The radix is deleted. 6. Click Import, then browse and select the desired radix. The radix is imported. 7. Click Export, select the radix, and then enter a radix name. The radix is exported. 8. Select the Apply user-defined radix to selected signal(s) checkbox.(Fig. 9). The user-defined radix is applied to the selected signal in the Wave view. 9. Click OK or Apply to save the user-defined radix. Fig.9. The Edit User-defined Radix dialog box with Wave view window To exit DVE, write exit in the command line on the console. DVE> exit