ISM User Guide
ISM User Guide
Xilinx is disclosing this user guide, manual, release note, and/or specification (the Documentation) to you
solely for use in the development of designs to operate with Xilinx hardware devices. You may not reproduce,
distribute, republish, download, display, post, or transmit the Documentation in any form or by any means
including, but not limited to, electronic, mechanical, photocopying, recording, or otherwise, without the prior
written consent of Xilinx. Xilinx expressly disclaims any liability arising out of your use of the Documentation.
Xilinx reserves the right, at its sole discretion, to change the Documentation without notice at any time. Xilinx
assumes no obligation to correct any errors contained in the Documentation, or to advise you of any corrections
or updates. Xilinx expressly disclaims any liability in connection with technical support or assistance that may be
provided to you in connection with the Information.
THE DOCUMENTATION IS DISCLOSED TO YOU AS-IS WITH NO WARRANTY OF ANY KIND. XILINX
MAKES NO OTHER WARRANTIES, WHETHER EXPRESS, IMPLIED, OR STATUTORY, REGARDING
THE DOCUMENTATION, INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, OR NONINFRINGEMENT OF THIRD-PARTY RIGHTS. IN NO EVENT WILL
XILINX BE LIABLE FOR ANY CONSEQUENTIAL, INDIRECT, EXEMPLARY, SPECIAL, OR INCIDENTAL
DAMAGES, INCLUDING ANY LOSS OF DATA OR LOST PROFITS, ARISING FROM YOUR USE OF THE
DOCUMENTATION.
Copyright 2002-2012 Xilinx Inc. All Rights Reserved. XILINX, the Xilinx logo, the Brand Window and other
designated brands included herein are trademarks of Xilinx, Inc. All other trademarks are the property of their
respective owners. The PowerPC name and logo are registered trademarks of IBM Corp., and used under license.
All other trademarks are the property of their respective owners.
Revision History
The following table shows the revision history for this document.
Date
Version
Description
10/19/2011
13.3
Updated:
12/07/2011
13.3
Added: Supported properties, selection options, and new Type value to Board Support.
Removed: References to OS Support.
01/18/2012
13.4
01/27/2012
13.4
www.xilinx.com
Table of Contents
Revision History .................................................................................................... 2
Chapter 1
Getting Started............................................................................................7
VHDL Simulation.......................................................................................43
Verilog Simulation.....................................................................................49
www.xilinx.com
Debugging .................................................................................................85
www.xilinx.com
Introduction........................................................................................................ 131
Prerequisites....................................................................................................... 131
Use Models ......................................................................................................... 131
Limitations.......................................................................................................... 132
Usage for Compilation....................................................................................... 132
fuse Command Line Flow.................................................................................. 133
Project Navigator Flow ...................................................................................... 133
Hybrid Co-Simulation Flow.............................................................................. 136
Hardware Board Usage ...................................................................................... 137
Hardware Co-Simulation................................................................................... 137
ISim Hardware Co-Simulation Tcl Commands................................................ 138
Board Support .................................................................................................... 139
Appendix A Reference .............................................................................................147
Simulation Executable Commands ................................................................... 147
Third-Party Command Equivalency ................................................................. 160
HDL Language Support..................................................................................... 163
Appendix B Migrating from ModelSim XE to ISim.................................................191
Migration Overview........................................................................................... 191
Simulation Process............................................................................................. 192
Step 1: Gathering Files and Mapping Libraries............................................... 194
Step 2: Parsing and Elaborating the Design ..................................................... 194
Step 3: Simulating the Design........................................................................... 194
Step 4: Examining and Debugging the Design ................................................ 195
Appendix C Additional Resources..........................................................................201
www.xilinx.com
www.xilinx.com
Chapter 1
Getting Started
ISim Overview
Xilinx ISim is a Hardware Description Language (HDL) simulator that lets you perform
behavioral and timing simulations for VHDL, Verilog, and mixed VHDL/Verilog
language designs.
Simulation Libraries
The Xilinx simulation device libraries are precompiled, and updated automatically
when updates are installed.
Note Do not run the Simulation Library Compilation Wizard (Compxlib) to compile
libraries for use with ISim.
Language Support
ISim supports the following languages.
Language
Support
VHDL
IEEE-STD-1076-2000
Verilog
IEEE-STD-1364-2001
SDF
VITAL
VITAL-2000
Mixed VHDL/Verilog
Yes
VHDL FLI/VHPI
No
Verilog PLI
No
SystemVerilog
No
No
www.xilinx.com
Feature Support
ISim supports the following features.
Feature
Support
Incremental Compilation
Yes
Yes
SDF Annotation
Yes
VCD Generation
Yes
SAIF Support
Yes
Yes
Multi-threading
Yes
www.xilinx.com
Steps in Simulation
ISim Modes of Operation
There are three modes of operation available in ISim:
Non-Interactive Batch
Mode of Operation
Features
Graphical User
Interface
Non-Interactive Batch
www.xilinx.com
2.
2.
3.
Stimulus File
Include an HDL-based testbench as the stimulus file. Create or edit your testbench
using any of the following means:
Language Templates - Use a template to populate the file correctly, such as those
available with the ISE software. For more information, see Using the Language
Templates in ISE Help.
User Libraries
Depending on which use mode is used to launch ISim, there are two different methods
available to add user libraries:
When launching Project Navigator, define user libraries in the ISE software. See
Working with VHDL Libraries in ISE Help for details.
When launching ISim from PlanAhead software, define the user libraries in that
software. See the PlanAhead User Guide (UG632) for more information.
10
The design is parsed and design components are elaborated for you when you
invoke ISim from either the ISE software or the PlanAhead software. For
details, see "Simulation from ISE Software" in Step 3: Simulating the Design, or the
PlanAhead User Guide (UG632).
The design is parsed and elaborated manually at the command line, as described
in the next section. And then the generated simulation executable is invoked with
-gui to launch graphical user interface.
www.xilinx.com
2.
In the project file starting from the first line, enter library and source file information
as follows:
verilog|vhdl <library_name> {<file_name_1> .v|.vhd}
verilog|vhdl<library_name> {<file_name_2> .v|.vhd}
verilog|vhdl <library_name> {<file_name_n> .v|.vhd}
where:
<library_name> indicates the library that a particular source on the given line
should be compiled. work is the default library.
<file_name> is the source file or files associated with the library. More than
one Verilog source can be specified on a given line. One VHDL source can be
specified on a given line.
Using fuse Use the fuse command to parse the design using the PRJ, elaborate the design, and
generate the simulation executable. For example:
fuse -prj my_project.prj work.top work.glbl -o my_sim.exe
For more information about the fuse command syntax and available switches, see fuse
Overview
Make sure that this step was run successfully. If not, see Examining Error Messages
and Examining Log Files in Step 5: Debugging the Design.
www.xilinx.com
11
Optionally, you can also invoke the simulation executable, launch the GUI, and run
simulation with a Tool Command Language (Tcl) file by leveraging the -tclbatch
option, for example, my_sim.exe -gui -tclbatch my_sim.tcl.
You can use the wave add command (example: wave add / to add all signals at top
level) in your my_sim.tcl file to automatically trace the signals and display the signals
in the GUI upon launch.
Simulation from the ISE software
Parsing, elaboration, and running the simulation executable command are all run in the
background when you run one of the following processes in the ISE software or the
PlanAhead application.
These processes launch the ISim GUI with the top-level signals being traced by default.
Optionally, you can specify custom Tcl files to control the signals that would get traced
upon launch of ISim GUI. The simulator run for the time specified under the ISE
simulation process property Simulation Run Time.
See Simulation Properties in ISE Help for details.
To run for an additional time, use one of the run simulation commands described in
Running a Simulation in ISim.
For more information, see Launching the ISim GUI.
2.
Viewing or querying the results in the Console panel or the Tcl prompt. See
Simulation Command Overview.
12
www.xilinx.com
HDL Compiler - Indicates an error during the parsing or static elaboration step.
If an error occurs during parsing and elaboration, and this step was not run
successfully, the problem can be an HDL compiler issue. Enter fuse -v 1 to dump
information that might help identify the problem. Also, a fuse.log file contains
a list of error messages, and errors also appear in the ISE software Console (in ISE
Integration Mode).
Use the file name and line number in the message to locate the problem.
fuse.log - Log file containing output produced by the fuse command during the
parsing and elaboration step.
isim.log - Log file containing output produced by simulation executable during the
simulation step. This file does not disclose any design data, and is safe to share with
Xilinx Technical Support if you report a problem.
isimcrash.log - Log file generated when the tool encounters an unexpected error
or condition. This is generated inside isim/<simulation_executable> .sim
directory. Provide this file to Xilinx Technical Support for further assistance. This
file also does not disclose any design data, and is safe to share with Xilinx Technical
Support if you report a problem.
isim ptrace on
isim ltrace on
dump
show
isim force
bp
onerror
www.xilinx.com
13
Tutorials
For tutorials on how to use ISim, see the following table:
14
www.xilinx.com
Chapter 2
www.xilinx.com
15
16
Description
Menu Commands
Displays the list of all the files associated with the design.
Console Panel
Breakpoints Panel
Objects Panel
www.xilinx.com
Description
10
Wave Window
11
12
Status Bar
Signals
Input Port
Output Port
InOut, Bidirectional Port
Internal Signal
Constants, parameters, and generics
Variable
Linkage Signal (VHDL only)
Buffer Signal
www.xilinx.com
17
Buses
Input Bus
Output Bus
InOut, Bidirectional Bus
Internal Bus
Constant, Parameter and Generics Bus
Variable Bus
Linkage Bus
Buffer Bus
2.
3.
Release the mouse button to place the panel to the new location.
18
www.xilinx.com
Menu Commands
The View menu commands enable you to hide the main window panels, toolbar, and
status bar.
Console
Search Results
Source Files
Breakpoints
Objects
Standard
Edit
View
ISim
Window
Help
View > Status Bar - hides and restores the status bar located at the bottom of the
main window.
Standard minimize, maximize and close commands apply to the Wave window and Text
Editor window using the upper right-hand icons.
Toggle Icons
The toggle icons are available at the top right of the ISim window panels, for example,
the Instances and Processes panel and the Objects panel.
With these commands, you can hide, restore, float, and dock the panel.
www.xilinx.com
19
Toggle Slide Out - minimizes the panel. Also used to restore the pane by hovering over
the panes name at the edge of the window, and clicking the minimize button.
Toggle Maximized - maximizes the panel.
Click again to restore the panel size.
Toggle Floating - floats the panel.
Click again to restore the floated window to its former location.
Close - closes the panel from view.
To restore the panel, select View > Panels and select the pane to restore to view.
Menu Command
1.
Select an object.
2.
Expand - Expands the hierarchy object that is selected. One level can be
expanded at a time.
20
1.
Select an object.
2.
Right-click and select the applicable command from the context menu
Expand - Expands the hierarchy object that is selected. One level can be
expanded at a time.
www.xilinx.com
Wave Window
Wave Window Overview
The Wave window displays signals, buses, and their waveforms. Each tab in the Wave
window shows a wave configuration, which consists of a list of signals and buses, their
properties, and any added wave objects; such as dividers, cursors, and markers.
In the GUI, the signals and buses in the wave configuration are traced during simulation,
and therefore, the wave configuration is used to examine the simulation results. The
design hierarchy and the signal transitions are not part of the wave configuration but
rather are stored in a separate database (.wdb) file.
Default.wcfg Details
When you ISim from any mode, it creates the Default.wcfg file. You must supply a
filename to save a wave configuration file to the disk as a .wcfg file.
In the GUI mode, when ISim exits, it prompts you to enter a filename in the Save
As dialog box.
In Batch mode, type wcfg save to save the contents of the Default.wcfg before
exiting ISim.
Active Window
When ISim starts, the first active window is Default.wcfg. You can change the active
window by clicking the window tab or using wave select command.
In the GUI, select File > New and File > Open to change the active window to the
newly created waveform configuration window.
In Tcl, the wcfg new and wcfg open commands change the active window to the
newly created window just like File > New and File > Open.
www.xilinx.com
21
Signals
Input Port
Output Port
InOut, Bidirectional Port
Internal Signal
Constants, parameters, and generics
Variable
Linkage Signal (VHDL only)
Buffer Signal
Buses
Input Bus
Output Bus
InOut, Bidirectional Bus
Internal Bus
Constant, Parameter and Generics Bus
Variable Bus
Linkage Bus
Buffer Bus
22
Main Cursor - The main cursor is a solid line that intersects the waveform, and
the value at that intersection is displayed in the Value column for each waveform.
The cursor is the current simulation time while simulation is running, with the
time displayed directly above the cursor.
Secondary Cursor - The secondary cursor is a dotted line used with the main
cursor to identify a time range. The time range can be used with zoom and print to
focus on the area.
www.xilinx.com
Markers - A marker is used to mark a particular time for future reference. A marker
is a vertical line intersecting the waveform. A marker lets you display the signal value
where the marker intersects the waveform. The time of the marker displays at the top
of the line. In addition, a series of markers can be used to jump the cursor forward or
back for quick analysis of value change. See Adding Markers and Displaying Waveform
Values With Markers.
Hollow/Filled-in Circle - When placing or moving cursors and markers, the Snap to
Transition button assists with placing the cursor/marker more precisely on a signal
transition.
When placing or moving a cursor or marker, the mouse displays a hollow circle
when hovering between transitions.
The mouse displays a filled in circle when hovering over a transition of a signal
www.xilinx.com
23
2.
3.
Click OK.
A new untitled wave configuration opens. The new wave configuration is empty until
you add signals.
If more than one wave configuration is open:
select Window > Next or Window > Previous to navigate through open wave
configurations.
In the GUI
1.
In the Instances and Processes panel, expand the design hierarchy, and select an
item.
The objects that correspond to the selected instance or process displays in the
Objects panel.
24
2.
3.
Use one of the following methods to add objects to the Wave Configuration:
Right-click, and select Add to Wave Window from the context menu.
Drag and drop the objects from the Objects panel to the Name column of the
Wave window.
In the Console, use the wave add command as described in the following
subsections.
www.xilinx.com
Using Tcl
1.
Optionally, you can first identify the objects you want to add by exploring the design
hierarchy in the Instances and Processes panel and the Objects panel, as described
above, or by entering the scope command in the Console panel.
2.
In the Console panel, enter the wave add command to enter an individual object or a
group of objects.
The wave configuration is an object that is loaded into memory with which you
can work.
When saving a wave configuration to a.wcfg file using a GUI Tcl command, the
.wcfg file takes the name supplied as a command argument. In saving to the file,
the wave configuration name is changed to match the .wcfg file name
When loading a wave configuration from a .wcfg file, the wave configuration
uses the name of the .wcfg file.
www.xilinx.com
25
The first column displays the instance, process, and static tasks or functions in a tree
structure showing the block hierarchy of the design.
The second column displays the names of the design units (Verilog module or
VHDL entity (architecture) corresponding to the instance, static task/function, or
process from the first column.
The third column displays the type of the instance, static task/function, or process.
The following describes the icons used for the items displayed in this panel:
VHDL Entity
VHDL Package
VHDL Block
VHDL Process
Verilog Module
Verilog Task or Function
Verilog Block
Verilog Process
To expand a hierarchy to display its components, click the arrows or use the Expand
context menu commands. See Expanding and Collapsing a Hierarchy.
To sort the information in this panel according to the data in one of the columns, click
the column title, such as Design Unit.
To hide or restore the panel, select View > Panel > Instances and Processes.
26
1.
Place the cursor in the Objects panel or the Instances and Processes panel.
2.
3.
In the Search dialog box, enter a text string. You can use an asterisk (*) as a
wildcard symbol.
4.
5.
www.xilinx.com
6.
Click OK.
Objects that match the search criteria display in the Search Results Panel.
In the Instances and Processes panel, the Objects panel, or the Source Files panel,
select an item.
2.
Double-click the item, or right-click and select Go To Source from the context
menu.
The HDL source file associated with that object opens in the text editor in read-only
mode.
Objects Panel
Objects Panel Overview
The Objects panel displays all simulation objects (ports, signals, variables, constants,
parameters, and generics) associated with the selected instances and processes in the
Instances and Processes panel.
The top of the panel displays which instance or process is selected in the Instances and
Processes panel; those objects and their values are listed in the Objects panel.
The table columns are defined as follows:
Object Name - Displays the name of the simulation object, accompanied by the
symbol which represents the type of object.
Value - The value of the simulation object at the current simulation time or at the
main cursor, as determined by the Sync Time toolbar icon.
Data Type - Displays the data type of the corresponding simulation object, logic or
an array.
www.xilinx.com
27
Place the cursor in the Objects panel or the Instances and Processes panel.
2.
3.
In the Search dialog box, enter a text string. You can use an asterisk (*) as a
wildcard symbol.
4.
5.
6.
Click OK.
Objects that match the search criteria display in the Search Results Panel.
Objects panel
Wave window
To Show Drivers
1.
2.
Select Edit > Wave Objects > Show Drivers, or select Show Drivers from the
right-click menu.
The Console lists the drivers for the object or signal. When there is no driver, a message
in the Console indicates that there is no driver.
28
www.xilinx.com
Note Running this command is the same as running show driver at the Console
prompt.
2.
2.
2.
3.
4.
Enter a number.
5.
2.
2.
www.xilinx.com
29
Note You can also use the Go To Source Code command from the context menu, or
double-click a file.
The selected file opens in read-only mode in the Text Editor window.
Do Not edit your Hardware Description Language (HDL) files in the ISim text editor.
Editing files could result in a conflict with the files in your ISE software project.
2.
3.
4.
In the Instances and Processes panel, the Objects panel, or the Source Files panel,
select an item.
2.
Double-click the item, or right-click and select Go To Source from the context
menu.
The HDL source file associated with that object opens in the text editor in read-only
mode.
30
www.xilinx.com
Information about specific operations is available in the ISE Text Editor Help.
Never edit your HDL files in the ISim text editor. Editing files could result in a conflict
with the files in your ISE software project.
2.
Use available features, such as scrolling, find, layout preferences, to assist you
with viewing the file contents.
Note If edits are made to HDL files in ISim, do not save the changes.
Setting Breakpoints
In ISim, you can set breakpoints in executable lines in your HDL file so you can run your
code continuously until the source code line with the breakpoint is reached, as described
in Using Breakpoints to Debug Your Design.
Note You can set breakpoints on lines with executable code only.
Select View > Breakpoint > Toggle Breakpoint, or click the Toggle Breakpoint
toolbar button .
2.
In the HDL file, click a line of code just to the right of the line number.
Note Alternatively, you can right-click a line of code, and select Toggle Breakpoint.
To remove a breakpoint, click the breakpoint to remove it.
After the procedure completes, a simulation breakpoint icon
line of code.
Note If you place a breakpoint on a line of code that is not executable, the breakpoint
is not added.
A list of breakpoints is available in the Breakpoints panel.
On the Memory Tab which contains all the two-dimensional arrays of logic types
in a design, double click a displayed memory object.
Run a search on a memory name in the Instance and Processes panel. After the
searched memory displays on the Search Results Panel, right-click the memory and
select Memory Editor from the context menu.
Note For objects that are not two-dimensional array of a logic type, the Memory Editor
choice in the Context Menu is grayed out.
The Memory Editor corresponding to the two-dimensional array shows up in the main
window as a tab along with the Waveform Viewer or Text Editor.
www.xilinx.com
31
Address - The Address is used for going to a particular location in the Memory
Editor.
Columns - The Columns combo box is to control the display of the number of
elements per row. The auto column displays the maximum of 2 to power N of
elements.
Address Radix - The address Radix combo box controls the radix of the address
displayed in the Memory Editor.
Value Radix - The Value Radix combo box controls the radix of the display value
in the Memory Editor.
You can float the Memory Editor window and the Memory Editor retains the previous
state after the float operation. You can navigate inside Memory Editor with the arrow
keys, the current position of a selected item displays on the status bar based on the
current address radix.
Console Panel
Console Panel Overview
The Console panel lets you view a log of commands generated by ISim, and enter
standard and ISim-specific Tools Command Language (Tcl) commands at the command
prompt.
Messages - Messages that are generated by the ISim include errors, warnings, and
informational messages, and display in the Console panel. The Console panel also
echoes simulator commands that were invoked from the graphical controls in the
ISim GUI.
Simulation commands - The command prompt lets you enter simulation Tcl
commands, and to view the command dump (or print-out) in the Console panel. See
Entering Simulation Commands for more information.
A number of right-click menu commands are available to help manage the contents of
the Console panel.
Breakpoints Panel
Breakpoints Panel Overview
A breakpoint is a user-determined stopping point in the source code used for debugging
a design with ISim. The Breakpoints panel displays a list of breakpoints that are set in
the design. See Debugging Your Design Using Breakpoints.
See also Setting Breakpoints and Deleting Breakpoints.
For each breakpoint set in your source files, the list in the Breakpoints panel identifies the
file location, filename, and line number. You can delete a selection, delete all breakpoints,
and go to the source code from the Breakpoint panel toolbar icons or context menu.
32
www.xilinx.com
Select Edit > Find in Files, or click the Find Text in Files toolbar button
2.
In the Find in Files dialog box, specify the text to find, set the parameters for your
search, and click Find.
3.
To clear all results from the panel, click the Clear All toolbar button
To open the file that contains the find result in the Workspace, select a find
result, and click the Show Current Result toolbar button .
Note Alternatively, you can double-click the find result to open the file.
To view the next find result, click the Show Next Result toolbar button
To view the previous find result, click the Show Previous Result toolbar
button
.
To stop the currently running Find in Files search, click the Stop Job toolbar
button
.
To save your Find in Files search results to a Comma Separated Value (CSV)
file, click the Save Results as a Text File toolbar button .
www.xilinx.com
33
Standard Toolbar
The Standard toolbar provides access to frequently-used File menu commands. To
show/hide the Standard toolbar, select View > Toolbars > Standard.
New Opens the New dialog box and lets you select the type of file you want
to create.
Open Opens the Open dialog box and lets you browse through your directories
and select a file to open. The file displays in the appropriate application or editor.
Save Saves the active file to disk and overwrites the previously saved version. If a
file is not saved previously, the Save As dialog box opens and lets you save the
active file to disk.
Print Opens the Print dialog box and lets you print the active file.
Edit Toolbar
The Editor toolbar provides access to frequently-used Edit menu commands. To
show/hide the Editor toolbar, select View > Toolbars > Edit.
Cut removes the selected text or object from the Workspace and places it in the clipboard.
Copy copies the selected text or object from the Workspace and places it in the clipboard.
Paste inserts the text or an object from the clipboard into the active window.
Delete deletes the item in focus in the Workspace window.
Unselect All Unselects everything in the active window.
Undo Reverses your latest operation. This button works only when there is something
to undo.
Redo Reverses your latest "undone" operation.
Find Searches for a text string in the active window.
Help Toolbar
The Help toolbar provides convenient access to frequently used Help menu commands.
To show/hide the Help toolbar, select View > Toolbars > Help.
Support and Services displays the Xilinx Support page in the default Web browser.
Whats This activates tooltips. After clicking this button, you can hover over a menu item
or toolbar button and get a brief description of its functionality.
34
www.xilinx.com
Window Toolbar
The Window toolbar provides access to frequently-used Window menu commands. To
show/hide the Window toolbar, select View > Toolbars > Window.
Cascade overlaps all the windows with the active window on top.
Tile Horizontally arranges the windows horizontally as non-overlapping tiles.
Tile Vertically arranges the windows vertically as non-overlapping tiles.
Float floats the active window.
View Toolbar
The View toolbar provides access to frequently-used View menu commands. To
show/hide the View toolbar, select View > Toolbars > View.
Zoom In increases the size of the viewed objects.
Zoom Out decreases the size of the viewed objects.
Zoom to Full View zooms out to display the entire view in the active window.
Zoom to Cursors displays the waveforms such that the two cursors are at the left and
right edge of the display. If the secondary is off, the command centers the display around
the main cursor without changing the magnification level.
Refresh Cleans up the display of the file in focus.
ISim Toolbar
The ISim toolbar provides access to frequently-used ISim commands. To show/hide the
ISim toolbar, select View > Toolbars > ISim.
Go To Previous Transition moves the main cursor to the previous transition.
Go To Next Transition moves the main cursor to next transition.
Adds a marker at the position of the main cursor to the Waveform area.
Moves the main cursor to the nearest marker to the left of the main cursors
current position.
Moves the main cursor to the nearest marker to the right of the main cursors
current position.
Resets the simulation time to zero.
Runs simulation until there are no more events, a stop command is issued or a
break point is encountered.
Runs simulation for the amount of time specified (Run For).
Specifies the amount of time the simulation runs when you click the Run For
button.
www.xilinx.com
35
Keyboard Shortcuts
36
Shortcut
Menu Command
F1
F3
F5
F6
F7
F8
F11
Step
Delete
Ctrl+N
Ctrl+O
Ctrl+S
Ctrl+P
Ctrl+Z
Ctrl+Y
Ctrl+X
Ctrl+C
Ctrl+V
Ctrl+F
Ctrl+G
Go To (Edit menu)
Ctrl+A
Ctrl+W
Ctrl+F4
Ctrl+Tab
Ctrl+Shift+Tab
Ctrl+Home
Go To Time 0
Ctrl+End
Go To Latest Time
Ctrl+Shift+F5
Restart
Mouse Wheel
Left
Previous Transition
www.xilinx.com
Right
Next Transition
Pause
Break
What to Expect
Successful Simulation Re-launch
When you Re-launch a simulation in the ISim GUI successfully your simulation is
complete without errors.
Unsuccessful Simulation Re-launch
When you Re-launch an unsuccessful simulation in the ISim GUI a dialog box opens
with the syntax error failure to compile source code. The links take you directly to the
source code with errors in the source window. It is recommended that you address the
linked errors sequentially to correct the issues and then recompile using the Re-launch
button to verify the fix.
Applying Stimulus
Force Selected Signal Dialog Box
Use the Force Selected Signal dialog box to enter parameters to force a VHDL signal,
Verilog wire, or a Verilog reg to a constant value. Assignments made from within HDL
code or any previously applied constant or clock force are overridden by the newly
applied constant force.
Click Apply to apply all changes.
Signal Name
Displays the default signal name. The default signal name is the full path name of
the item selected in the Object Window or waveform. You can change the signal
name in the edit box. When you enter an invalid signal name in the edit box, the
edit box will turn red.
Value Radix
Displays the current radix setting of the selected signal. You can choose one of the
supported radix types: Binary, Hexadecimal, Unsigned Decimal, Signed Decimal,
Octal, and ASCII.
Force to Value
You can specify a force constant value. The Force to Value uses the radix defined in
Value Radix.
www.xilinx.com
37
38
www.xilinx.com
Examples:
To assign a permanent clock to a signal (100 MHz clock), set the following fields:
Leading Edge Value: 1
Trailing Edge Value: 0
Starting at Time Offset: 0
Cancel after Time Offset: <blank>
Duty Cycle (%): 50
Period: 10 ns
To assign a clock to a signal for a specific period of time (start toggling at 100 ns, stop
toggling after 1 ms), set the following fields:
Leading Edge Value: 1
Trailing Edge Value: 0
Starting at Time Offset: 100 ns
Cancel after Time Offset: 1 ms
Duty Cycle (%): 50
Period: <specify clock period>
To assign a toggling value for a signal (toggle between hex F and hex A every 50 ns for
1 us), set the following fields:
Value Radix: Hexadecimal
Leading Edge Value: F
Trailing Edge Value: A
Starting at Time Offset: 0
Cancel After Time Offset: 1 us
Duty Cycle (%): 50
Period: 50 ns
www.xilinx.com
39
ISim Preferences
Setting ISim Preferences
The preference settings enable you to view and change the settings for ISim.
To Set Preferences
1.
2.
In the left pane of the Preferences dialog box, click a category to view.
ISim Simulator
3.
4.
5.
The Preference settings are saved and are effective immediately in your ISim session.
40
www.xilinx.com
Delete
Deletes the custom scheme that you have selected.
You can edit the color of this scheme
Contains the color selection for each item in the ISim main window that can be
customized. Click Apply to apply changes.
www.xilinx.com
41
42
www.xilinx.com
Chapter 3
VHDL Simulation
VHDL Simulation Overview
Running a simulation from the command line involves three basic steps:
1.
2.
3.
<library_name> specifies the library into which the source on the given line should
be compiled. <library_name> is optional and is only needed when using a different
library than the default work.
<file_name_1>.vhd is the source file. Each line can contain only one VHDL source file.
Example:
vhdl work top.vhd
vhdl mylib_for_testbench testbench.vhd
Note The top-level file testbench.vhd contains the entity named testbench.
Generating the ISim Simulation Executable - Running fuse
The HDL linker, fuse, performs static elaboration of a design in terms of parsed nodes,
generates object code for each unique module instance, and links the generated object
codes with the ISim simulation engine library to create an ISim simulation executable.
www.xilinx.com
43
Syntax:
fuse {[<library_name> .]<top_name> }-prj <proj_name>.prj -o
<output_file_name>
where:
-o switch is optional for defining the executable name. Without -o, the default
executable name is x.exe.
<library_name> specifies the library into which the source specified by<file_name>
should be compiled. There can be multiple VHDL file names per line.
Example:
vhpcomp suba.vhd subb.vhd
See vhpcomp Overview and Syntax for more information about the command.
Generation of the ISim Simulation Executable - Running fuse
Syntax:
fuse {[<library_name> .]<top_name> } -o <output_file_name>
where:
-o switch lets you define the simulation executable name (for example,
my_sim.exe). Without -o, the default name for the simulation executable is x.exe.
Example:
fuse work.topunit work.glbl -o my_sim.exe
See fuse Overview and Syntax for more information about the fuse command.
44
www.xilinx.com
Simulation
After the compilation and the ISim simulation executable generation, the final stage is
simulation. To run the simulation, run the executable file generated by fuse.
Command
Behavior
See ISim Simulation Executable Overview and Syntax for more information about the
command.
<library_name> indicates the library that the source on the given line should be
compiled. The default library name is work.
<file_name_n> .vhd are any additional source files required by the testbench (such as
auxiliary testbench files)
Generation of the ISim Simulation Executable - Running fuse The HDL linker, fuse, performs static elaboration of a design in terms of parsed nodes,
generates object code for each unique module instance, and links the generated object
codes with the simulation engine library to create an ISim simulation executable.
Syntax:
www.xilinx.com
45
-o switch is optional. Without -o, the default name for the simulation executable
is x.exe.
-work is optional and is only needed when trying to specify a different library
than the default work.
<library_name> indicates the library into which the source specified by<file_name>
should be compiled. There can be multiple VHDL file names per line.
See vhpcomp Overview and Syntax for more information about the command.
Generating the ISim Simulation Executable - Running fuse Syntax:
fuse {[<library_name>.<top_name> ]} -o <output_file_name>
where:
-o switch is optional. Without -o, the default name for the simulation executable
is x.exe.
See fuse Overview and Syntax for more information about the fuse command.
Simulation
After compiling and generating the ISim executable, the final stage is simulation.
You run the ISim simulation executable generated by the fuse command to perform
simulation.
To execute Tcl commands in a file after the simulation has begun, use the -tclbatch
switch.
46
www.xilinx.com
It is also possible to instruct the simulator to use the correct timing delays from the
Standard Delay Format (SDF) file.
Syntax:
<executable_name>.exe -tclbatch <tcl_file_name>
-sdfmin|-sdftyp|-sdfmax [<instance>=]<sdf file name>
where
<instance> is the hierarchical path name of the instance at which SDF back annotation
needs to be done.
See ISim Simulation Executable Overview and Syntax for more information about the
command.
The ISim HDL compile programs, vhpcomp, vlogcomp and fuse, use the
xilinxsim.ini configuration file to find the definitions and physical locations of
VHDL and Verilog logical libraries.
Search Order
The compilers attempt to read xilinxsim.ini from these locations in the following
order.
1.
$XILINX/vhdl/hdp/<platform> .
2.
Syntax
The xilinxsim.ini file has the following format:
<logical_library1> = <physical_dir_path1>
<logical_library2> = <physical_dir_path2>
.
.
<logical_libraryn> = <physical_dir_pathn>
Example
The following is an example of a xilinxsim.ini file:
VHDL
std=C:/libs/vhdl/hdp/
stdieee=C:/libs/vhdl/hdp/ieee
work=C:/work
www.xilinx.com
47
Verilog
unisims_ver=$XILINX/rtf/verilog/hdp/nt/unisims_ver
xilinxcorelib_ver=C:/libs/verilog/hdp/nt/xilinxcorelib_ver
mylib=./mylib
work=C:/work
Features/Limitations
The xilinxsim.ini file has the following features and limitations:
There must be no more than one library path per line inside the xilinxsim.ini
file.
If the directory corresponding to the physical path does not exist, vhpcomp or
vlogcomp creates it when the compiler first tries to write to it.
You can describe the physical path in terms of environment variables. The
environment variable must start with $ character.
48
www.xilinx.com
Chapter 4
Verilog Simulation
Verilog Simulation Overview
Running a simulation from the command line involves three basic steps:
1.
2.
3.
www.xilinx.com
49
where:
<library_name> indicates the library into which the source on the given line should
be compiled. More than one Verilog source can be specified on a given line.
[-d <macro>] defines one or more macro located in the location specified in [-i
<include_path>].
Example:
verilog work top.v testbench.v
Generating the ISim Simulation Executable - Running fuse
The HDL linker, fuse, performs static elaboration of a design in terms of parsed nodes,
generates object code for each unique module instance, and links the generated object
codes with the ISim simulation engine library to create an ISim simulation executable.
Syntax:
fuse {[<library_name> .]<top_name> }-prj <proj_name>.prj -L
<Verilog_library> -o <output_file_name>
where:
-o switch is optional. Without -o, the default name for the simulation executable
is x.exe.
Example:
fuse work.test_bench work.glbl -prj mydesign.prj -L unisims_ver
-L unimacro_ver -L xilinxcorelib_ver -o test_bench.exe
See fuse Overview and Syntax for more information about the fuse command.
50
-work is optional and is necessary only when you must specify a different library
than the default work.
www.xilinx.com
Example:
vlogcomp suba.v subb.v
See vlogcomp Overview and Syntax for more information about the vlogcomp
command.
Generation of the ISim Simulation Executable - Running fuse
Syntax:
fuse {[<library_name> .]<top_name> } {-L <Verilog_library> } -o
<output_file_name>
where:
-o switch is optional. Without -o, the default name for the simulation executable
is x.exe.
Example:
fuse work.test_bench work.glbl -L unisims_ver -L unimacro_ver -L
xilinxcorelib_ver -o test_bench.exe
See fuse Overview and Syntax for more information about the fuse command.
Simulation
After the compilation and the ISim simulation executable generation, the final stage is
simulation. To run the simulation, run the executable file generated by fuse.
Command
Behavior
See ISim Simulation Executable Overview and Syntax for more information about the
command.
www.xilinx.com
51
verilog indicates that the source is a Verilog file. More than one Verilog source can be
specified on a given line.
<library_name> is the target library into which the source(s) on that particular line
should be compiled.
[-d <macro>] allows you to define one or more macro of the path specified by [-i
<include_path>]. These options are optional.
Example:
verilog work top.v testbench.v
verilog work glbl.v
verilog work top_timesim.v
Links the generated object codes with the simulation engine library to create an
ISim simulation executable
Syntax:
fuse {[<library_name>. ]<top_name> } -prj <proj_name>.prj {-L
<verilog_library_name> }-o <output_file_name>
52
www.xilinx.com
where:
-o switch is optional. Without -o, the default name for the simulation executable
is x.exe.
Example:
fuse work.testbench work.glbl -prj design.prj -L simprims_ver
-o isim.exe
See fuse Overview and Syntax for more information about the fuse command.
-work is optional and is only needed when trying to specify a different library
than the default work.
<library_name> indicates the library into which the source specified by<file_name>
should be compiled. More than one Verilog source can be specified on a given line.
Example:
vlogcomp top_testbench.v top_timesim.v
See vlogcomp Overview and Syntax for more information about the vlogcomp
command.
Generation of the ISim Simulation Executable - Running fuse
Syntax:
fuse {[<library_name>. ]<top_name> } {-L <Verilog_library> } -o
<output_file_name>
where:
-o switch is optional. Without -o, the default name for the simulation executable
is x.exe.
Example:
fuse work.textbench work.glbl -L simprims_ver -o timesim.exe
See fuse Overview and Syntax for more information about the fuse command.
www.xilinx.com
53
Simulation
After the compilation and ISim simulation executable generation, the final stage
is simulation. The ISim executable generated by the fuse command runs to effect
simulation.
If you would like Tcl commands contained in a file to be executed after the simulation
has begun, use the -tclbatch switch.
It is also possible to instruct the simulator to use the correct timing delays from the
SDF file.
Syntax:
<executable_name>.exe -tclbatch <tcl_file_name>
-sdfmin|-sdftyp|-sdfmax [<instance>=]<sdf file name>
where
<instance> is the hierarchical path name of the instance at which the Standard Delay
File (SDF) back annotation needs to be done.
<sdf file name> is the filename of the SDF file you want to annotate.
See ISim Simulation Executable Overview and Syntax for more information about the
command.
2.
3.
4.
54
www.xilinx.com
After the source files on the command line are compiled, if there are any unresolved
references to modules, the compiler searches the source libraries for resolution. During
this search, the compiler attempts to match the name of any unresolved instantiated
design unit with a file of the same name in the specified -sourcelibdir directory. If such a
file exists, the compiler analyzes that file.
Note By default, the compiler ignores any files with extensions such as .v or .h, unless
-sourcelibext is also used.
-sourcelibdir <library_first> -sourcelibdir <library_second>
Examples
The following examples demonstrate the use of these command options.
vlogcomp
vlogcomp -work mywork1 file1.v -sourcelibdir mydir/cells
The compiler searches for unresolved cells inside directory mydir/cells. For example,
if file1.v instantiates DFF and DMUX, which are unresolved, then the compiler
would look for files with names DFF and DMUX inside directory mydir/cells. Files
DFF and DMUX should define modules DFF and DMUX.
fuse
fuse prj test.prj test -sourcelibfile ./mylib1/lib_abc.v
-sourcelibfile ./mylib1/lib_cde.v
where test.prj contains:
verilog work test.v
The compiler uses files from the -sourcelibfile options for modules used in test.v. It
analyzes the modules and elaborates the test design.
<proj_name> .prj
fuse prj test.prj test
where test.prj contains:
verilog work test.v -sourcelibdir ./mylib1 sourcelibdir ./mylib2
-sourcelibext .v
For every unresolved module with name modulename instantiated in file test.v, the
compiler looks up files with name modulename.v inside the directories ./mylib1 and
./mylib2, in that order.
www.xilinx.com
55
The ISim HDL compile programs, vhpcomp, vlogcomp and fuse, use the
xilinxsim.ini configuration file to find the definitions and physical locations of
VHDL and Verilog logical libraries.
Search Order
The compilers attempt to read xilinxsim.ini from these locations in the following
order.
1.
$XILINX/vhdl/hdp/<platform> .
2.
Syntax
The xilinxsim.ini file has the following format:
<logical_library1> = <physical_dir_path1>
<logical_library2> = <physical_dir_path2>
.
.
<logical_libraryn> = <physical_dir_pathn>
Example
The following is an example of a xilinxsim.ini file:
VHDL
std=C:/libs/vhdl/hdp/
stdieee=C:/libs/vhdl/hdp/ieee
work=C:/work
Verilog
unisims_ver=$XILINX/rtf/verilog/hdp/nt/unisims_ver
xilinxcorelib_ver=C:/libs/verilog/hdp/nt/xilinxcorelib_ver
mylib=./mylib
work=C:/work
Features/Limitations
The xilinxsim.ini file has the following features and limitations:
56
There must be no more than one library path per line inside the xilinxsim.ini
file.
If the directory corresponding to the physical path does not exist, vhpcomp or
vlogcomp creates it when the compiler first tries to write to it.
You can describe the physical path in terms of environment variables. The
environment variable must start with $ character.
www.xilinx.com
www.xilinx.com
57
58
www.xilinx.com
Chapter 5
Mixing VHDL and Verilog is restricted to the module instance or component only. A
VHDL design can instantiate Verilog modules and a Verilog design can instantiate
VHDL components. Any other mix use of VHDL and Verilog is not supported.
A Verilog hierarchical reference cannot refer to a VHDL unit nor can a VHDL
expanded/selected name refer to a Verilog unit.
Only a small subset of VHDL types, generics and ports are allowed on the boundary
to a Verilog module. Similarly, a small subset of Verilog types, parameters and ports
are allowed on the boundary to VHDL design unit.
Optionally, specify the search order for VHDL entity or Verilog modules in the
design libraries of a mixed language project.
Use the fuse -L option to specify the binding order of a VHDL entity or a Verilog
module in the design libraries of a mixed language project.
Note The library search order specified by -L is used for binding Verilog modules
to other Verilog modules as well.
www.xilinx.com
59
Declare a VHDL component with the same name as the Verilog module (respecting
case sensitivity) that you want to instantiate.
For example,
COMPONENT MY_VHDL_UNIT PORT (
Q : out STD_ULOGIC;
D : in
STD_ULOGIC;
C : in
STD_ULOGIC );
END COMPONENT;
2.
To ensure that you are correctly matching port types, see port mapping rules in Mixed
Language Boundary and Mapping Rules.
Since Verilog is case sensitive, named associations and the local port names that you
use in the component declaration must match the case of the corresponding Verilog
port names.
60
www.xilinx.com
Performs a case sensitive search for a Verilog module in the user specified list of
unified logical libraries in the user specified search order. The first one matching
the name is picked and the search stops.
If case sensitive search is not successful, performs a case insensitive search for a
Verilog module in the user specified list of unified logical libraries in the user
specified search order. If a unique binding is found for any one library, the search
stops.
Performs a case insensitive search for an entity with the same name as the
instantiated module name in the user specified list of unified logical libraries in the
user specified order. The first one matching the name is picked and the search stops.
Performs a case sensitive search for a VHDL design unit name constructed as an
extended identifier in the user specified list of unified logical libraries in the user
specified order. If a unique binding is found for any one library, the name is picked
and the search stops.
Note For a mixed language design, the port names used in a named association to a
VHDL entity instantiated by a Verilog module are always treated as case insensitive.
Also note that you cannot use a defparam statement to modify a VHDL generic.
www.xilinx.com
61
General
The following restrictions apply to the boundaries between VHDL and Verilog design
units/modules.
The boundary between VHDL and Verilog is enforced at design unit level.
Port Mapping
The following rules and limitations for port mapping are used in mixed language
projects.
IN
OUT
INOUT
INPUT
OUTPUT
INOUT
The following table shows supported VHDL and Verilog data types for ports on
the mixed language design boundary:
VHDL Port
Verilog Port
bit
net
std_ulogic
net
std_logic
net
bit_vector
vector net
std_ulogic_vector
vector net
std_logic_vector
vector net
Note Verilog output port of type reg is supported on the mixed language boundary. On
the boundary, an output reg port is treated as if it were an output net (wire) port.
Note Any other type found on mixed language boundary is considered an error.
62
www.xilinx.com
integer
real
string
boolean
Note Any other generic type found on mixed language boundary is considered an error.
std_logic
bit
Verilog
Verilog
www.xilinx.com
63
64
www.xilinx.com
Chapter 6
Waveform Analysis
Before Analysis
Launching the ISim GUI
To launch the ISim GUI in read-only mode to view or analyze the data from a previous
simulation, see Opening a Static Simulation .
What to Expect
Simulation from ISE or PlanAhead software
When you launch ISim from the ISE or the PlanAhead software, a wave configuration
with top-level signals displays. Design data is populated in other areas of the GUI, such
as the Objects panel, and the Instances and Processes panel. You can then proceed to
add additional signals, or run the simulation in ISim.
Simulation at the Command Line
When you launch ISim from the command line by running the simulation executable
with the -gui switch (Graphical User Interface Mode), an empty wave configuration
displays. Design data is populated in other areas of the GUI, such as the Objects Panel,
and the Instances and Processes panel. You must add signals to the wave configuration
before you run the simulation in ISim.
www.xilinx.com
65
In the GUI
1.
In the Instances and Processes panel, expand the design hierarchy, and select an
item.
The objects that correspond to the selected instance or process displays in the
Objects panel.
2.
3.
Use one of the following methods to add objects to the Wave Configuration:
Right-click, and select Add to Wave Window from the context menu.
Drag and drop the objects from the Objects panel to the Name column of the
Wave window.
In the Console, use the wave add command as described in the following
subsections.
Using Tcl
1.
Optionally, you can first identify the objects you want to add by exploring the design
hierarchy in the Instances and Processes panel and the Objects panel, as described
above, or by entering the scope command in the Console panel.
2.
In the Console panel, enter the wave add command to enter an individual object or a
group of objects.
The wave configuration is an object that is loaded into memory with which you
can work.
When saving a wave configuration to a.wcfg file using a GUI Tcl command, the
.wcfg file takes the name supplied as a command argument. In saving to the file,
the wave configuration name is changed to match the .wcfg file name
When loading a wave configuration from a .wcfg file, the wave configuration
uses the name of the .wcfg file.
2.
3.
66
www.xilinx.com
The signal/bus is now copied to the wave configuration. You can move the signal/bus
using drag and drop as needed.
In addition, you can run simulation until a specific point in your HDL source code
is reached. To do so, use breakpoints and the Run All command. See Source Level
Debugging Overview.
Note The current simulation time is displayed on the status bar in the lower right corner.
Pausing a Simulation
While running a simulation for any length of time, you can pause a simulation using the
Break command, which leaves the simulation session open.
To close the session of ISim, see Closing ISim.
The simulator stops at the next executable HDL line. The line at which the simulation
stopped is displayed in the text editor.
Note This behavior applies to designs that have not been compiled with the -nodebug
switch.
The simulation can be resumed at any time by using the Run All, Run for the time
specified on the toolbar (Toolbar), or Step commands. See Running a Simulation in
ISim for details.
Closing ISim
You can terminate a simulation and close the ISim session.
www.xilinx.com
67
To Close ISim
Select File > Exit.
Enter the quit -f command in the Console panel at the prompt. This will prevent
an are you sure dialog box from opening.
Click the X at the top-right corner of the main window.
The simulation terminates and the session of ISim closes.
Click and hold the waveform, and drag either left or right.
This sets the secondary cursor, with the initial click, and the main cursor, when
you finish dragging.
Note When placing the secondary cursor by dragging, you must drag a minimum
distance before the secondary cursor will appear.
To Move a Cursor
To move a cursor hovering over the cursor until you see the grab symbol
and drag the cursor to the new location.
, and click
As you drag the cursor in the Wave window, you see a hollow or filled-in circle if the
Snap to Transition toolbar button is selected, which is the default behavior.
68
A filled-in circle
indicates that you are hovering over the waveform transition of
the selected signal.
A hollow circle
indicates that you are hovering between transitions in the
waveform of the selected signal.
www.xilinx.com
Setting Markers
Adding a Marker
You can add one or more markers to navigate through the waveform, and to display the
waveform value at a particular time. Markers are added to the wave configuration at
the location of the main cursor.
To Add a Marker
1.
Place the main cursor at the time where you want to add the marker by clicking in
the Wave window at the desired time or on the desired transition.
2.
Select Edit > Markers > Add Marker, or click the Add Marker toolbar button
A marker is placed at the cursor, or slightly offset if a marker already exists at the
location of the cursor. The time of the marker is displayed at the top of the line.
Moving a Marker
After you add a marker, you can move the marker to another location in the waveform
using the drag and drop method.
To Move a Marker
1.
Click marker label (at the top of the marker) and drag it to the desired location.
indicates that the marker can be moved around.
As you drag the marker in the Wave window, you will see a hollow or filled-in
circle if the Snap to Transition toolbar button is selected, which is the default
behavior.
2.
A filled-in circle
indicates that you are hovering over a transition of the
selected signals waveform or over another marker. For markers, the filled-in
circle is white.
A hollow circle
indicates that you are hovering between transitions in the
selected signals waveform.
Release the mouse key to drop the marker to the new location.
Deleting a Marker
You can delete one or all markers with one command.
To Delete Markers
1.
2.
Select Delete Marker from the context menu to delete a single marker.
Select Delete All Markers from the context menu to delete all markers.
Note The Delete key can also be used to delete a selected marker.
The marker or markers are removed from the waveform.
www.xilinx.com
69
The undo command (Edit > Undo) can be used to reverse a marker deletion.
Adding Dividers
You can add a divider to your wave configuration to create a visual separator of signals.
To Add a Divider
1.
In a Name column of the Wave window, click a signal below which you wish
to add a divider.
2.
Select Edit > New Divider, or right-click and select New Divider from the context
menu.
A divider is added to the wave configuration. The change is visual and nothing is added
to the HDL code.
The new divider will be saved with the wave configuration file when the file is saved
next.
Following changes can be made to a divider:
To delete a divider, highlight the divider, and click the Delete key, or right-click and
select Delete from the context menu.
Adding Groups
You can add a group to your wave configuration, which is a collection, or folder,
to which signals and buses can be added in the wave configuration as a means of
organizing a set of related signals. The group itself displays no waveform data but can
be expanded to show its contents or collapsed to hide them.
To Add a Group
1.
In a wave configuration, select one or more signals or buses you wish to add to
a group.
Note A group can also comprise dividers, virtual buses, and other groups.
2.
Select Edit > New Group, or right-click and select New Group from the context
menu.
A group that contains the selected signal or bus is added to the wave configuration. A
group is represented with the
icon. The change is visual and nothing is added to
the HDL code.
You can move other signals or buses to the group by dragging and dropping the
signal/bus name.
The new group and its nested signals/buses will be saved the next time you save the
wave configuration file.
Following changes can be made to a group:
70
Groups can be moved to another location in the Name column by dragging and
dropping the group name.
www.xilinx.com
To remove a group, highlight a group and select Edit > Wave Objects > Ungroup, or
right-click and select Ungroup from the context menu. Signals/buses formerly in the
group will be placed at the top level in the wave configuration hierarchy.
Caution! The Delete key will remove the group and its nested signals and buses from
the wave configuration.
In a wave configuration, select one or more signals or buses you wish to add to
a virtual bus.
2.
Select Edit > New Virtual Bus, or right-click and select New Virtual Bus from
the context menu.
A virtual bus, which contains the selected signal(s) or bus(es), is added to the wave
configuration. A virtual bus is represented with the
icon. The change is visual and
nothing is added to the HDL code.
You can move other signals or buses to the virtual bus by dragging and dropping the
signal/bus name.
The new virtual bus and its nested signals/buses will be saved the next time you save the
wave configuration file.
Following changes can be made to a virtual bus:
Move the virtual bus to another location in the waveform by dragging and dropping
the virtual bus name.
To remove a virtual bus, and ungroup its contents, highlight the virtual bus, and select
Edit > Wave Objects > Ungroup, or right-click and select Ungroup from the context
menu.
Caution! The Delete key will remove the virtual bus and its nested signals and buses
from the wave configuration.
Renaming Objects
You can rename any object in the Wave window, such as signals, dividers, groups,
and virtual buses.
To Rename an Object
1.
2.
3.
4.
Press Enter or click outside the name to make the name change take effect.
You can also double-click the object name and then enter a new name.
The change is effective immediately. Object name changes in the wave configuration do
not affect those in the design source code.
www.xilinx.com
71
Expand the Name column until you see the entire signal name.
Use the scroll bar in the Name column to view the name.
Select one or more signal or bus names. Use Shift+ click or Ctrl+ click to select
many signal names.
2.
Custom to display the custom name given to the signal when renamed. See
Renaming Objects.
2.
In the Preferences dialog box, click ISim Simulator in the left pane.
3.
4.
2.
Binary
Hexadecimal
Unsigned Decimal
Signed Decimal
Octal
ASCII
Note Changes to the radix of an item in the Objects panel do not apply to values in the
Wave window or the Console panel. To change the radix of an individual signal (HDL
object) in the Wave window, use the Wave window context menu. To change the radix in
the Console panel, use the isim set radix Tcl command.
72
www.xilinx.com
Select a bus.
2.
The bus bit order is reversed. The Reverse Bit Order command is marked to show that
this is the current behavior.
Menu Command
1.
Select an object.
2.
Expand - Expands the hierarchy object that is selected. One level can be
expanded at a time.
Select an object.
2.
Right-click and select the applicable command from the context menu
Expand - Expands the hierarchy object that is selected. One level can be
expanded at a time.
www.xilinx.com
73
Using Commands
Zooming Behavior
Command
Shortcut Key
Zoom in
Press F8.
Press F7.
Press F6.
Not applicable.
1.
2.
Not applicable.
74
Function
Command
www.xilinx.com
Either:
Or:
2.
Select a marker.
Select View > Floating Ruler, or click the Floating Ruler button
You only need to follow this procedure the first time. The floating ruler will appear
each time the secondary cursor is placed or marker is selected, as instructed
in Step 1.
The floating ruler displays.
Select the command again to hide the floating ruler.
In the wave configuration in the Wave window, add one or more markers, as
described in Adding a Marker.
For a single marker, if the main cursor and marker occupy the same location, the
Value column displays the signal and bus values. No further action is required.
For multiple markers, continue.
2.
Select Edit > Markers > Next Marker, or click the Next Marker toolbar button
4.
Select Edit > Markers > Previous Marker, or click the Previous Marker toolbar
button
.
The cursor moves backward through markers in the wave configuration.
5.
www.xilinx.com
75
Select a signal.
The starting point is the location of the cursor in the waveform.
2.
To advance to the next transition, select View > Cursors > Next Transition or click
the Next Transition icon .
The marker advances to the next transition for the selected signal. The values for
all signals at that time are displayed in the Value column.
3.
4.
To go back to the previous transition, select View > Cursors > Previous Transition
or click the Previous Transition icon .
The marker moves back to the previous transition for the selected signal. The
values for all signals at that time display in the Value column.
5.
The cursor advances or moves back, and the signal values are updated.
Place the mouse on the first transition and press and hold the left mouse button.
2.
3.
4.
If the floating ruler is displayed, the time values of the cursors display just above
the floating ruler.
5.
Optional. You can switch the cursors using the Swap Cursors icon
The time range displays until you click in the wave configuration to place a new main
cursor.
If you move the secondary cursor, as described in Placing Cursors, the time range
updates automatically.
76
www.xilinx.com
Display the floating ruler using a selected marker as the time base.
2.
3.
You can also use a combination of cursors and markers for measuring time. To do so,
use the secondary cursor as the time base, and the floating ruler displays the time
measurement of the markers and main cursor against the secondary cursor.
Using Go To Time
The Go To Time function enables you to jump the main cursor to a particular time in
the wave configuration. Two Go To Time toolbar button also enables you to jump to
time 0 (zero) and the latest simulation time. All signal and bus values are updated for
the location of the main cursor.
To Go To a User-Specified Time
With a wave configuration open:
1.
2.
In the Go To Time box, enter the time and time unit you wish to jump the cursor to,
or select a time/time unit from the drop-down list, if available.
3.
Press Enter.
www.xilinx.com
77
The Show Driver command is available for probing objects in the following areas:
Objects panel
Wave window
To Show Drivers
1.
2.
Select Edit > Wave Objects > Show Drivers, or select Show Drivers from the
right-click menu.
The Console lists the drivers for the object or signal. When there is no driver, a message
in the Console indicates that there is no driver.
Note Running this command is the same as running show driver at the Console
prompt.
To Print Preview
1.
2.
In the Print Preview dialog box, make sure the wave configuration looks as expected.
3.
Select Print or Setup to further customize the print options and layout, and to print.
See To Print.
4.
Print preview displays the wave configuration in black and white, or color as determined
by your default printer. You can select another printer, if available, just prior to printing.
To Print
1.
2.
In the ISim Print Setup dialog box, specify the Page Orientation, Time Range, Fit
Time Range To, and other display settings.
Note Time Range is populated with the time range of the main and secondary
cursor if both are placed in the wave configuration.
3.
Click OK.
4.
5.
Click Print.
78
www.xilinx.com
2.
3.
4.
5.
Click the color box and select a color for the areas you wish to change the color.
6.
7.
Click OK.
2.
www.xilinx.com
79
80
www.xilinx.com
Chapter 7
www.xilinx.com
81
a wave configuration file, which contains the order and settings associated with
objects in the wave configuration
For information about saving simulation results, see Saving the Results.
2.
3.
4.
Click OK.
The wave configuration opens in the Wave window. Multiple wave configurations can
be opened during one simulation session. Click the corresponding wave configuration
tab to view the wave configuration.
To open a wave configuration from the command prompt:
Since a wave configuration is not open by default when you launch the GUI, you can
include the -view switch to open an existing one. Run the simulation executable with
the following syntax:
<sim_exe>.exe gui wdb <wdb>.wdb -view <wcfg>.wcfg
where
-wdb <wdb>.wdb specifies the filename where the simulation data will be stored
-view <wcfg>.wcfg opens the specified waveform file in the ISim graphic user
interface
The ISim GUI opens with a new database (a live simulation). If simulation objects from
the .wcfg correspond to those in the database, the wave configuration is pre-populated
with data from the database.
For information about creating a new wave configuration, see Creating New Wave
Configurations.
82
www.xilinx.com
2.
Select File > Open, select the .wcfg file type from the file filter list, and select the
wave configuration (.wcfg) file from a previous simulation.
Or:
1.
-view <wcfg>.wcfg opens the specified waveform file in the ISim graphical
user interface.
The static simulator displays the wave configuration, with all signals previously traced,
and the associated waveform database.
Opening an Existing WCFG and Non-Associated Waveform Database
You can load simulation data (.wdb), and view a WCFG that is not associated with the
database. This particular way of opening a static simulation is useful for cases when
different views (as captured in a .wcfg file) of the same simulation result (the transitions
stored in the .wdb file) need to be seen by different engineers in a team. ISim will issue a
warning for any object name that is present in the .wcfg but not found in the .wdb file
and will display only those objects that match.
In a command prompt:
1.
-open <wdb>.wdb opens the specified waveform database file in the ISim
graphic user interface.
-view <wcfg>.wcfg opens the specified waveform file in the ISim graphical
user interface.
www.xilinx.com
83
In a command prompt:
1.
-view <wdb>.wdb opens the specified waveform database file in the ISim
graphical user interface.
The static viewer displays the data from the previous simulation and a new wave
configuration file named as Default.wcfg that displays up to a maximum of 1000
objects from the .wdb file in the Wave window. You can remove or add signals to the
default .wcfg file, and save the .wcfg for future viewing.
2.
Select File > Open, select the .wdb file type from the file filter list, and select the
wave database (.wdb) file from a previous simulation
Or:
1.
-open <wdb>.wdb opens the specified waveform database file in the ISim
graphical user interface.
The static viewer displays the data from the previous simulation in the Objects panel,
and the Instances and Processes panel. There is no waveform data open in the Wave
window.
You can open an existing wave configuration using File > Open, or create a new wave
configuration using File > New.
84
www.xilinx.com
Chapter 8
Debugging
Source Level Debugging Overview
ISim enables you to debug your HDL source code to verify that the design is running as
expected. Debugging is accomplished through controlled execution of the source code
to determine where problems may be occurring.
Some strategies available for debugging in ISim are:
Set breakpoints on the specific lines of HDL code, and run the simulation until a
breakpoint is reached
In larger designs, it can be cumbersome to stop after each line of HDL source code is
run. Breakpoints can be set at any predetermined points in your HDL source code,
and the simulation is run (either from the beginning of the testbench or from where
you currently are in the design) and stops are made at each breakpoint. You can use
the Step, Run All or Run For command to advance the simulation after a stop. For
more information, see Using Breakpoints to Debug Your Design.
Stepping
Stepping Through a Simulation
You can use the Step command at any point in the simulation to debug your HDL source
code. The Step command executes your HDL source code one line of source code at a
time to verify that the design is working as expected. A yellow arrow points to the line
of code currently being executed.
You can also create breakpoints for additional stops while stepping through your
simulation. For more information on debugging strategies in ISim, see Source Level
Debugging Overview
www.xilinx.com
85
Chapter 8: Debugging
The HDL associated with the top design unit will be opened as a new tab in the
Wave window.
Note Stepping will start from the current running simulation time. If youd like to
step through the simulation from the start (0 ns), restart the simulation. Use the
Restart command to reset time to the beginning of the testbench. See Running a
Simulation in ISim.
2.
Select Window > Tile Horizontally (or Window > Tile Vertically) to
simultaneously see the waveform and the HDL code.
3.
As each line is executed, you can see the yellow arrow moving down the code. If the
simulator is executing lines in another file, the new file opens, and the yellow arrow will
step through the code. It is common in most simulations for multiple files to be opened
when running the step command. The Console panel also indicates how far along the
HDL code the step command has progressed.
Using Breakpoints
Setting Breakpoints
In ISim, you can set breakpoints in executable lines in your HDL file so you can run your
code continuously until the source code line with the breakpoint is reached, as described
in Using Breakpoints to Debug Your Design.
Note You can set breakpoints on lines with executable code only.
Select View > Breakpoint > Toggle Breakpoint, or click the Toggle Breakpoint
toolbar button .
2.
In the HDL file, click a line of code just to the right of the line number.
Note Alternatively, you can right-click a line of code, and select Toggle Breakpoint.
To remove a breakpoint, click the breakpoint to remove it.
After the procedure completes, a simulation breakpoint icon
line of code.
Note If you place a breakpoint on a line of code that is not executable, the breakpoint
is not added.
A list of breakpoints is available in the Breakpoints panel.
86
www.xilinx.com
Chapter 8: Debugging
Open the HDL source file. See Opening HDL Source Files.
2.
Set breakpoints on executable lines in the HDL source file. See Setting Breakpoints
3.
4.
5.
6.
The simulation will run until one of the breakpoints is reached, at which point,
the simulation stops. The HDL source file displays, and the breakpoint stopping
point is indicated with a yellow arrow.
7.
Again, click the Wave window to return to the waveform to see if the design
behavior (i.e., signal value change) is as expected at the breakpoint.
8.
A controlled simulation is run, stopping at each breakpoint set in your HDL source files.
During design debugging, you can also run the Simulation > Step
command to
advance the simulation line by line to debug the design at a more detailed level. For
more information, see Stepping Through a Simulation
Deleting Breakpoints
When working with ISim, you can delete breakpoints from your HDL source code
as follows.
To Remove a Breakpoint
Use one of the following methods:
1.
Enter bp list to list all breakpoints in your design and shows each breakpoint
index number and line number.
2.
Note You can also remove a breakpoint in the Breakpoints Panel by selecting a
breakpoint and using the Delete context-menu command, or the Delete icon .
The single breakpoint is deleted.
www.xilinx.com
87
88
www.xilinx.com
Chapter 9
Estimating the power consumption with a power analysis tool, such as XPower
Analyzer.
Implementing the design for optimal power consumption with Map, and Place &
Route (PAR) tools.
The switching activity data can be written out from the simulation of the design either at
the RTL-level or after full placement and routing. Map, PAR and XPower Analyzer all
work with switching activity data generated from both RTL and post-place and route
simulation. For better accuracy in power analysis and power optimized implementation,
it is recommended to use switching activity data generated from a post-place and
route simulation. The data will match the design internal nodes that result from the
placement and routing.
It is also possible to use switching activity data generated from a RTL simulation
(quicker than the post-place and route simulation) for both power analysis and power
driven implementation. However, only activities for the inputs and outputs of the
design will be taken into account. The tools will use their vector-less analysis algorithms
to estimate activities of the designs internal nodes.
For more information about how these tools use the switching activity data, see the
Command Line Tools User Guide for implementation tools (Map and PAR), and XPower
Analyzer Help for power analysis.
SAIF -The Switching Activity Interchange format (SAIF) file contains toggle counts
(number of changes) on the signals of the design. It also contains the timing
attributes which specify time durations for signals at level 0, 1, X, or Z. The SAIF
file is recommended for power related tasks (i.e., power analysis or power driven
implementation) since it is smaller than the VCD file.
VCD - The Value Change Dump (VCD) file is an ASCII file containing header
information, variable definitions, and value change details for each step of the
simulation. The file can be used to estimate the power consumption of the design.
The computation time of this file can be very long, and the resulting file size is
larger than the SAIF file.
www.xilinx.com
89
2.
Create the desired activity file in order to gather the signals transition during
simulation for power estimation.
VCD - Use the vcd command at a Tcl prompt, or set the -vcdfile option in
your simulation executable at the command line.
90
3.
When simulation ends, close the SAIF or VCD file by issuing the appropriate saif or
vcd command. Example: saif close or vcd dumpoff.
4.
Retrieve the SAIF or VCD file from the isim working directory for use in another
tool.
www.xilinx.com
Chapter 10
Command Line - Enter simulation commands at the command line Tcl prompt.
Tclbatch - Enter simulation commands in a Tcl file, and reference the Tcl file with
the -tclbatch option of the simulation executable. For more information, see ISim
Simulation Executable Overview and Syntax.
You can enter individual commands or create simulation scripts. For examples of
simulation Tcl scripts, see the Simulation Constructs folder available in the Language
Templates. To access these examples, click Edit > Language Templates, and in the
Language Templates, expand Tcl, expand Tools, and expand ISim folder.
You can set a variable to represent a simulation command to quickly run frequently used
simulation commands. For more information, see Aliasing Simulation Commands.
Note For information on using Tcl, see Tcl/Tk Documentation.
bp: Sets and deletes breakpoints in your HDL source code for debugging purposes.
describe: Displays information about the given HDL data or block object.
dump: Displays a list of variables, generics, parameters and nets along with their
values for the current scope of the design hierarchy.
help: Displays a description with usage and syntax of the specified ISim command.
isim force: Forces or removes a value on a VHDL signal, Verilog wire, or Verilog reg.
isim get arraydisplaylength: Displays the limit of numbers of elements for an array
type HDL object.
www.xilinx.com
91
isim get userunit: Displays the current unit of measurement for all time values
where unit is unspecified.
isim set arraydisplaylength: Sets the limit on the number of elements for an array
type HDL object.
isim set userunit: Sets the default unit of measurement for all time values where
unit is unspecified.
onerror: For batch mode, controls the behavior immediately following a failed Tcl
simulation command.
quit: Exits either the simulation or the software, depending on the command options.
saif: Creates a Switching Activity Interchange format (SAIF) file and records
estimate power usage.
show: Displays selected aspects of the design in the Simulation Console tab.
step: Executes simulation through your HDL design, line by line, to assist with
debug.
test: Compares the actual value of a net or bus with a supplied value.
wcfg select: Selects the wave configuration file to be displayed in the active window.
wave add: Adds simulation objects or blocks to the specified wave configuration in
the ISim graphical user interface.
92
www.xilinx.com
2.
3.
4.
The command is run. The command log appears in the Console panel.
Run the ISim simulation executable that you generated from fuse at the command
line, for example, my_sim.exe.
A Tcl prompt appears:
This is a Full version of ISim.
Time resolution is 1 ps
ISim>
2.
3.
The command is run. Simulation output will automatically be directed to both the
stdout as well as the isim.log file.
Note You can use the Ctrl+C keyboard command to stop a simulation once invoked.
Example of a typical sequence.
1.
2.
3.
4.
5.
6.
wave log / - Log simulation output of all VHDL signal, Verilog wire and Verilog
reg at top level to the waveform database (wdb) file.
7.
8.
9.
www.xilinx.com
93
Create a file with a .tcl extension, for example, isim.tcl, and enter any
simulation commands you want to execute into the file.
You can enter individual commands or create simulation scripts. For examples
of simulation Tcl scripts, see the Simulation Constructs folder available in the
Language Templates with the Project Navigator. To access these examples in the
Language Templates:
a.
Note When creating a Tcl file, ensure that you have a quit command on the last line
of the file to ensure the simulation completely exits once the run is complete.
For example, the following could be the contents of isim.tcl:
wave add /
run 1000 ns
2.
To execute the commands in isim.tcl, enter the following at the command line
prompt:
stopwatchsim.exe -tclbatch isim.tcl
Simulation output will automatically be directed to both the stdout as well as
the isim.log file.
94
www.xilinx.com
If the escaped identifier contains a curly brace, then the technique of surrounding the
identifier with curly braces will not work, as Tcl interprets curly braces as special
characters even within curly braces. Instead, you must use the technique demonstrated
in VHDL extended Identifiers, below.
VHDL Extended Identifiers VHDL extended identifiers contain backslashes ( \ ), which are special characters to
Tcl. Because Tcl interprets backslash next to a close curly brace ( \} ) as being simply
a close curly brace character, VHDL extended identifiers cannot be written with curly
braces. Instead, the curly braces must be absent and each special character to Tcl
must be prefixed with a backslash. For example, to add the signal \my sig\ to the
Wave window, you must write the command as wave add \\my\ sig\\. Both the
backslashes that are part of the extended identifier, as well as the space inside the
identifier are prefixed with a backslash.
The variable is set. The Tcl variable svc is set to show value count.
To then run the variable (and thereby execute the simulation command), type eval
$svc.
Wave Configuration I/O Commands - Used to create, save, and select a wave
configuration.
www.xilinx.com
95
Description
()
[]
...
{}
<>
Less than and greater than symbols < > enclose variables for which
you must supply values.
Tcl Commands
Engine Commands
bp Command
The bp command controls the setting and removal of breakpoints in the HDL source
code that you are simulating. A breakpoint is used to interrupt the simulation during
debugging.
Note This command is case sensitive.
Syntax
bp (options )
96
www.xilinx.com
Options
Option
Description
add <file_name>
<line_number>
clear
Deletes all breakpoints for all HDL files loaded into ISim. If
you have breakpoints in multiple files, all breakpoints are
deleted.
del
<index>
[<index> ...
list
remove <file_name>
<line_number>
Examples
The bp command can be used as follows.
Set a Breakpoint
This example sets a breakpoint at line 2 for the file statmach.vhd.
bp add statmach.vhd 2
www.xilinx.com
97
Delete Breakpoints
This example deletes all breakpoints in your simulation.
bp clear
This example deletes a breakpoint by index number.
1.
2.
describe Command
The describe command displays information about the given HDL data or block
object.
Note This command is case sensitive.
Syntax
describe <object_name>
Options
Displays a description about either an HDL object or an HDL
block in the current simulation scope.
<object_name>
Examples
The describe command can be used as follows.
ISim> describe param
Verilog Instance: {param}
Path:{/parameter8_hn/param}
Location: {/home/test5.v:42}
Instantiation: {/home/test5.v:37}
dump Command
The dump command displays values for all VHDL signals and generics, and Verilog
wires, non-subprogram regs and parameters in the current scope. To navigate the
design hierarchy, use the scope command. The dump command uses the default radix
set using isim set radix command.
Note This command is case sensitive.
98
www.xilinx.com
Syntax
dump
Example
This example displays a list of all the signal names and their values at the current scope
of the design hierarchy to your computer screen.
dump
Command to Use
dump -p
show child
dump
-p<process_name>
help Command
The help command displays a description with usage and syntax of the specified ISim
Tcl command. With no command specified, the help command displays descriptions,
usage and syntax for all of the ISim Tcl commands.
Note This command is case sensitive.
Syntax
help [command_name ]
Options
Displays a description for the specified command. A list of
all simulation commands is found in Simulation Command
Overview.
command_name
Examples
The help command can be used as follows.
www.xilinx.com
99
Syntax
isim condition (add|remove|list) [ <condition expression >
<command >] [<radix_type >] [<label_name >] [<index_name >]
Options
Option
Description
(add|remove|list)
<condition
expression >
<command >
-all
Examples
ISim condition add Examples
To add a condition that states that when the signal asig is equal to 8, a stop occurs, and
the condition is called label0:
100
www.xilinx.com
To add a VHDL-specific signal condition that states that when the signal asig is equal
to 1, a stop occurs, and the condition is called label1:
isim condition add { /top/asig
To add a condition that states that for any change on signal asig, a stop occurs, and the
condition is called label2:
isim condition add /top/asig
To add a Verilog-specific signal condition that states that when clk is equal to St1, a stop
occurs, and the condition is called label3:
isim condition add { clk == St1 } {stop} -label label3
To add a condition that states that when asig (3:0) is equal to 0001 and reset is equal
to 1, a stop occurs:
isim condition add { asig(3:0) == 0001
www.xilinx.com
101
For a VHDL signal or a Verilog wire, removal of a force restores the value of the
signal or the wire to the current driven value.
For a Verilog reg, the forced value is retained even after the applied force has been
removed until the time one of the HDL processes that write into the Verilog reg
gets to assign a new value to the reg.
Syntax
isim force (add|remove) < object_name > < value > [options ]
Options
Option
Description
(add|remove)
<object_name>
-value <value>
-radix <radix_type>
-time <time>
-cancel <time>
-repeat <time>
Examples
The isim force command can be used as follows.
To Assign a Value
To force signal rst to 0 starting at the current simulation time:
isim force rst 0
To force signal rstto 1 starting at 10 ns from the current simulation time and cancel
forcing after 50 ns from the current simulation time:
isim force rst 1 -time 10 ns cancel 50 ns
102
www.xilinx.com
To apply a clock to the signal clk such that clk goes to 1 at current simulation time,
goes back to 0 at 20 ns later, and then repeats this every 40 ns until 1 us from the current
simulation time (for example, to generate a clock with 50% duty cycle and 40 ns period
for a duration of 1 us):
isim force clk 1 value 0 time 20 ns repeat 40 ns cancel 1 us
To force signal data_in to 1 at current simulation time, set data_in to 0 at current
simulation time + 50 ns, and set data_in back to 1 at current simulation time + 75 ns
and then repeat this 101 pattern every 100 ns for a duration of 5000 ns:
force add data_in 1 -value 0 -time 50 ns -value 1 -time 75 ns
-repeat 100 ns cancel 5000 ns
To Remove a Value
To remove the values on signal s, s1 and s2:
isim force remove s s1 s2
Syntax
isim get arraydisplaylength
where no options are available.
Example
Enter
isim get arraydisplaylength
Returns
64
Syntax
isim get radix
where no options are available.
Example
To return the radix:
isim get radix
Returns the current global radix.
www.xilinx.com
103
Syntax
isim get userunit
where no options are available.
Example
Enter
isim get userunit
Returns
1 ps
Syntax
isim ltrace [on | off]
Options
Turns line tracing on or off. Displays the name
of the currently executing line in the Console.
The default is off.
[on | off]
Example
To see which line is currently executing.
isim ltrace on
run
The output lists the simulation_time, filename, line number, as follows:
1005
1005
1005
1005
ns "C:/Data/ISE_Projects/freqm/watchver/stopwatch_tb.v":26
ns "C:/Data/ISE_Projects/freqm/watchver/stopwatch_tb.v":27
ns(3) "C:/Data/ISE_Projects/freqm/watchver/statmach.v":63
ns(3) "C:/Data/ISE_Projects/freqm/watchver/statmach.v":64
104
www.xilinx.com
Syntax
isim ptrace [on | off]
Options
Turns process tracing on or off. Displays the
name of the currently executing VHDL or
Verilog process in the Simulation Console tab.
The default is off.
[on | off]
Example
To see which process is currently executing.
isim ptrace on
Syntax
isim set arraydisplaylength <size>
Options
Enter a number of elements of an array type HDL object to
displays.
<size>
Examples
Enter
isim set arraydisplaylength 2
show value xcountout
Returns
00
00
Also, examine the Value column for arrays in the Objects Panel in the ISim GUI.
Enter
isim set arraydisplaylength 64
show value xcountout
Returns
0001000000
0001000000
www.xilinx.com
105
Also, examine Value column for arrays in the Objects Panel in the ISim GUI.
Syntax
isim set radix <radix_type >
Options
Sets the global radix for the current simulation.
This radix type is used for other commands:
show value, put, test, dump, isim force, and
isim condition.
<radix_type>
Examples
To set a radix of hex, and to see a count value.
isim set radix hex
show value count
Returns a.
To set a radix of dec, and to see a count value.
isim set radix dec
show value count //count is defined as reg[3:0] count
Returns -4.
To set a radix of unsigned, and to see a count value.
isim set radix unsigned
show value count
Returns 10.
Syntax
isim set userunit (options )
106
www.xilinx.com
Options
The userunit is entered as number (1|10|100)
followed by unit (fs|ps|ns|us|ms|s).
<[1|10|100]fs|ps|ns|us|ms|s>
Example
Set the simulator timescale to 1ps:
isim set userunit 1 us
onerror Command
The onerror command lets you control the behavior immediately following a failed
Tools Command Language (Tcl) simulation command. See examples for various
applications, such as printing the error and resuming the next command.
This command can be used to debug simulation command errors, and is particularly
useful when running a Tcl script in which an error is encountered. This command is not
intended for users who enter one Tcl command at a time at the Tcl prompt.
Note This command is case sensitive.
Syntax
onerror( options )
Options
Option
Description
{list_of_Tcl_commands }
{ source Tcl_script }
Examples
In this example, ISim exits after printing the time that the error occurred and all values
in the current scope.
onerror { showtime;dump;quit -f }
In this example, ISim continues reading the next command in the Tcl script after showing
the time the error occurred and all values in the current scope.
onerror { show time;dump;resume }
In this example, ISim reads the sourced Tcl file and executes its command upon
encountering an error.
onerror { source myerror.tcl }
www.xilinx.com
107
put Command
The put command enables you to modify values of signals or buses during simulation.
The put command can be used to assign:
an array of signals/buses
To use the put command, the signal or bus must be declared as a signal in your
Hardware Description Language (HDL) source code.
You cannot use the put command to assign a value to a VHDL variable, a VHDL
generic, or a Verilog parameter. You can assign values to the whole signal, a bit of a
signal or a slice of a signal. You can also access the signal hierarchically. This command
can be overridden. The stimulus from your design can override the put command;
consequently, the command is temporary.
Note This command is case sensitive.
Syntax
put <signal_name|vhdl_process_name/process_variable_name >
[element reference, element reference, ...] <value> | <object>
<value> -radix <radix_type >
Option
Description
<signal_name|
vhdl_process_name/
process_variable_name>
[ <element reference>, <element
reference> ]
<value>
108
www.xilinx.com
Option
Description
<object> <value>
[-radix <radix_type> ]
Examples
Assign a Value To a Bus or Signal
To assign a value to a signal called clk:
put clk 1
or
put clk 1 -radix bin
or
put clk "1" -radix bin
To assign a value to a 4-bit bus called busx:
put busx 0101
To assign a value FF to signal A:
put A FF -radix hex
To assign a bit value of 1 to a signal called count(6) in the module u1 that is
instantiated under your current scope:
put u1/count(6) 1
std_logic_vector(0 to 5);
(0 to 3) vectorarray(0 to 5, 1 to 4, 2 to 6);
www.xilinx.com
109
put sigarray(0,1,2)(1:2)10
To set bits three of the array element of sigarray to 1:
put sigarray(0,1,2)(3)1
For an array of records which in turn contain an array of standard logic vectors that is
declared as follows:
type ram_3d_vector is array(0 to 10, 7 downto 0, 0 to
2) of std_logic_vector(1 to 4);
type rectype is record
a: integer;
b: string(1 to 7);
c: std_logic_vector(0 to 3);
d: ram_3d_vector;
end record;
type recarray is array(0 to 3, 4 downto 1) of rectype;
signal recarrsig : recarray;
signal recsig : rectype;
To set the second element (b) of the record recsig to the string abc:
put recsig.b(2:4)abc
To set the four bit wide vector represented by the coordinates 2,3,1 in the three
dimensional array d in the record recsig to 0110:
put recsig.d(2,3,1) 0110
To set the first two bits of the four bit wide vector represented by the coordinates 2,3,1 in
the three dimensional array d in the record recsig to 01:
put recsig.d(2,3,1)(1:2) 01
To set the four bit wide vector represented by the coordinates 2,3,1 in the three
dimensional array d in the record recsig represented by the coordinates 2,2 in the two
dimensional array recarrsig to 0011:
put recarrsig(2,2).d(2,3,1)0011
quit Command
The quit command exits either the simulation or the software, depending on the
command options. With no options, the quit command closes the ISim software after
being prompted to do so (for graphic user interface (GUI) mode) or simply closes ISim
(in command-line mode).
Note This command is case sensitive.
Syntax
quit [options ]
110
www.xilinx.com
Options
Quits the current simulation and quits the ISim software.
You are not prompted to save the wave configuration even
when changes have been made to wave configurations.
-f
Examples
To use this command to exit ISim and leave the Tcl prompt, type:
quit
To use this command to exit ISim and save your waveform:
quit -f
To use this command to quit the current simulation:
quit -s
restart Command
The restart command stops simulation and sets simulation time back to 0. This lets
you start simulation over again within the same simulation run without reloading the
design. The equivalent GUI command is Simulation > Restart.
Specifically, restart resets the following command settings:
Syntax
restart
Example
To use this command to set simulation time back to 0, and start simulation:
restart
resume Command
The resume command is used with the onerror command to continue executing
commands after an error is encountered.
Note This command has no effect when entered alone.
Note This command is case sensitive.
www.xilinx.com
111
Syntax
resume
where no options are available.
Example
In this example, ISim continues reading the next command in the Tools Command
Language (Tcl) script after showing the time the error occurred and all values in the
current scope.
onerror { show time;dump;resume }
run Command
The run command starts simulation. With no options, the run command runs
simulation for 100 ns. The equivalent GUI commands are Simulation > Run All and
Simulation > Run.
Note This command is case sensitive.
Syntax
run [options ]
Options
Option
Description
all
continue
<time> <unit>
The <unit> is the unit of time. Possible values are fs, ps,
ns, us, ms and sec. Default is ps.
Examples
The run command can be used as follows.
To run simulation until there are no more events or until ISim reaches a breakpoint:
run all
To run simulation for 2000 nanoseconds:
run 2000 ns
To run simulation for 1.2 nanoseconds:
run 1.2 ns
To run simulation for 100 ns.
run
112
www.xilinx.com
saif Command
The saif command lets you create a Switching Activity Interchange format (SAIF) file
and record port and signal switching rates. See also Writing Activity Data of the Design.
Note This command is case sensitive.
Syntax
saif <options >
Options
Option
Description
close
level <number_of_levels>
Examples
The saif command can be used as follows.
In this example, all ports of a design starting at the current scope recursively are written
to a file called xpower.saif.
saif open
In this example, the ports and internal nets of a design starting at the current scope
recursively are written to a file called xpower.saif.
saif open -allnets
In this example, ports and internal nets of a design starting at uut recursively are
written to a file called uut_backward.saif.
saif open -scope uut -file uut_backward.saif -allnets
www.xilinx.com
113
scope Command
The scope command lets you navigate the design hierarchy. With no options, the
scope command displays the current module information.
Note This command is case sensitive.
Syntax
scope [options ]
Options
Option
Description
..
<path_name>
The <path_name > is the path to the module for which you want
to display the module information. You can use a relative or an
absolute path.
Examples
The scope command can be used as follows.
To move up one level in the design hierarchy:
scope ..
To move to the module UUT that is instantiated in the current module:
scope UUT
To use the scope Tools Command Language (Tcl) command on child instances in a
post route netlist.
For example:
X_IPAD \CLK/PAD (
.PAD(CLK)
);
where, \CLK/PAD is an extended identifier.
Enter:
scope /testbench/UUT/\\CLK/PAD\
Notice that you must use a backslash (\) before \CLK and a backslash after PAD at
the end.
sdfanno Command
The sdfanno command back-annotates VITAL delays from a Verilog Standard Delay
Format (SDF) file to a VHDL design that is made of VITAL-compliant VHDL models.
The sdfanno command also back-annotates to the timing specified in specify blocks
of Verilog modules.
Note This command is case sensitive.
Syntax
sdfanno (-min | -typ | -max) <file_name > [<options> ]
where -min | -typ | -max and <file_name> are required, and <options> is
optional.
114
www.xilinx.com
Options
Option
Description
<file_name>
-nowarn
-noerror
-root <root_path>
Examples
sdfanno -typ Examples
To annotate the submodule "subdesign" with the typical delay values from
mysubdesign.sdf:
sdfanno -typ mysubdesign.sdf -root /subdesign
To annotate the current top-level design with the typical delay values from design.sdf
and ignore all errors or warnings:
sdfanno -typ design.sdf -noerror -nowarn
www.xilinx.com
115
show Command
The show command displays selected aspects of the design.
Note This command is case sensitive.
Syntax
show (options )
Options
Option
Description
child | child -r
constant
driver
load
port
scope
signal
time
value <generic_name> |
<parameter_name> |
<process_name>
/<process_variable_name> |
<signal_name>
[element reference, element
reference, ...]
| <object> [-radix
<radix_type> ]
116
www.xilinx.com
Description
Option
variable
Examples
Show Child
If you are located at the top level of the hierarchy in a design called fifo_controller
and enter show child. The following hierarchy information displays:
Block Name: <fifo_controller>
Enter show child -r for the same level of the design, the current and recursive
hierarchy information displays.
Show Driver
If you are located at the top level of the hierarchy in a design called fifo_count and
enter show driver fifocount. The following information displays for the signal
fifocount:
<Driver for fifocount>
fifoctlr_cc_v2.v:221
The number 221 at the end of the lines refers to the code line in the source file.
www.xilinx.com
117
Show Load
If you are located at the top level of the hierarchy in a design called fifo_count and
enter show load fifocount. The following information displays for the signal
fifocount:
<Load for fifocount>
Signal <Hex(0)> (Block:
Signal <Hex(1)> (Block:
Signal <Hex(2)> (Block:
Signal <Hex(3)> (Block:
fifo_count/Lsbled/)
fifo_count/Lsbled/)
fifo_count/Lsbled/)
fifo_count/Lsbled/)
Show Scope
If you are located at the top level of the hierarchy in a design called fifo_count and
enter show scope. The following information displays:
<Block> /tb_cc_func/
std_logic_vector(0 to 5);
vectorarray(0 to 5, 1 to 4, 2 to 6);
118
www.xilinx.com
a:
integer;
b:
string(1 to 7);
c:
std_logic_vector(0 to 3);
d:
ram_3d_vector;
end record;
signal recarrsig :
signal recsig :
recarray;
rectype;
step Command
After you run an initial simulation, you can step through your HDL design one line
of source code at a time to verify that the design is working as expected. The step
command advances to the next line of executable code in the Verilog or VHDL file. The
equivalent GUI command is Simulation > Step.
Note This command is case sensitive.
Syntax
step
where no options are available.
Example
To step through one line of HDL source code:
www.xilinx.com
119
step
test Command
The test command compares the actual value of a VHDL signal, Verilog wire, Verilog
reg, VHDL generic, Verilog parameter or VHDL process variable in the current scope
with a supplied value. If the two values match, nothing is displayed. Otherwise the
current correct value is displayed, and ISim reports an error. You can test one bit, a
slice of a vector element or a whole value.
Note This command is case sensitive.
Syntax
test <signal_name|vhdl_process_name/process_variable_name >
{element reference, element reference, ...} <value> | <object>
<value> -radix <radix_type >
Options
Option
Description
<signal_name|
vhdl_process_name/process_
variable_name>
<element_reference,
element_reference,... >
<value>
Examples
The test command can be used as follows.
120
www.xilinx.com
std_logic_vector(0 to 5);
vectorarray(0 to 5, 1 to 4, 2 to 6);
www.xilinx.com
121
For an array of records that contains an array of standard logic vectors and is declared
as follows:
type ram_3d_vector is array(0 to 10, 7 downto 0, 0 to
2) of std_logic_vector(1 to 4);
type rectype is record
a: integer;
b: string(1 to 7);
c: std_logic_vector(0 to 3);
d: ram_3d_vector;
end record;
type recarray is array(0 to 3, 4 downto 1) of rectype;
signal recarrsig : recarray;
signal recsig : rectype;
To compare the second element (b) of the record recsig to the string abc:
test
recsig.b(2:4)abc
To compare the four bit wide vector represented by the coordinates 2,3,1 in the three
dimensional array d in the record recsig to 0110:
test recsig.d(2,3,1) 0110
To compare the first two bits of the four bit wide vector represented by the coordinates
2,3,1 in the three dimensional array d in the record recsig to 01:
test recsig.d(2,3,1)(1:2) 01
To compare the four bit wide vector represented by the coordinates 2,3,1 in the three
dimensional array d in the record recsig represented by the coordinates 2,2 in the two
dimensional array recarrsig to 0011:
test recarrsig(2,2).d(2,3,1)0011
vcd Command
The vcd command generates simulation results in Value Change Dump (VCD) format.
This command enables you to dump specified instances to a VCD file, to name the VCD
file, to start and stop the dump process, and other functions. See also Writing Activity
Data of the Design.
Note This command is case sensitive.
Syntax
vcd (options )
122
www.xilinx.com
Options
Option
Description
dumpfile <file_name>
dumpoff
dumpon
dumpall
dumplimit <file_size>
dumpflush
Examples
The vcd command can be used as follows.
Following are the commands you would use to write the VCD simulation values of the
module Unit Under Test (UUT) to a VCD file after running simulation for 1000 ns.
Specify which file to write:
vcd dumpfile adder.vcd
www.xilinx.com
123
Syntax
wave log [-r]{<object_name> }
Options
Option
Description
-r
<object_name>
Examples
To log the signals associated with the module instances /tb/UUT and /tb/child/gt to
the waveform database:
wave log /tb/UUT /tb/child/gt
To log all signals in the design:
wave log r /
Syntax
wcfg new
124
www.xilinx.com
Example
To create a new wave configuration:
wcfg new
Syntax
wcfg open <filename>
Options
Specifies the name of the wcfg file to open.
<filename>
Example
To open a wcfg file named toplevel.wcfg:
wcfg open toplevel.wcfg
Syntax
wcfg save <filename>
Options
Specifies the name of the file in which to save
the currently active wave configuration.
<filename>
Example
To save the active wave configuration to a wcfg file named toplevel.wcfg:
wcfg save toplevel.wcfg
Syntax
wcfg select <wave_config_name>
Options
Specifies the wave configuration to activate.
The <wave_config_name> must be the name of
an open existing wave configuration or the
command will report an error.
<wave_config_name>
www.xilinx.com
125
Example
To activate the wave configuration named design:
wcfg select design
Syntax
wave add [-into <ID>][-wcfg <wave_config_name> ][-reverse][-radix
<radix> ][-color <color> ][-name <custom_name> ]
[-r]{<object_name> }
Option
Description
-into <ID>
Specifies object ID of the group or virtual bus into which to add the
object.
-wcfg
<wave_config_name>
-reverse
-radix<radix>
Uses the specified radix when displaying signal values. The value of
radix is one of the following :default, bin, oct, hex, dec,
unsigned, or ascii.
-color <color>
This option sets the color of the simulation object(s) to <color>. The
value of <color> is defined in Red/Green/Blue (RGB) format.
For example #0000FF is blue, #FF0000 is red, and #00FF00 is green.
Textual name of color can also be specified for some of the popular
colors. Following color names are accepted: black, red, darkred, green,
darkgreen, blue, darkblue, cyan, darkcyan, magenta, darkmagenta,
darkyellow, gray, darkgray, lightgray. The RGB values for these colors
are defined in the RGB table.
-name <custom_name>
-r
<object_name>
126
www.xilinx.com
Examples
The wave add command can be used as follows.
To add the signals associated with object UUT to the current wave configuration:
wave add /tb/UUT
To add all top-level signals:
wave add /
To add all signals in the design in color whose RGB value is #00FF10:
wave add r / -color #00FF10
To add specific signals with radix hex and in color red:
wave add /tb/clk /tb/UUT/data radix hex color red
Syntax
divider add [-into <ID>][-color <color> ]
Options
Option
Description
-into <ID>
-color <color>
Examples
To add a divider with name Inputs to the current wave configuration:
divider add Inputs
To add red divider with name Outputs:
divider add Outputs color red
To add dividers into a group:
set test_group_id [group add test_group]
wave add "dcm_clk_s" /tb/data2 -into $test_group_id
divider add data color blue into $test_group_id
wave add "addr1" /tb/UUT/addr2 -into $test_group_id
divider add address color red into $test_group_id
www.xilinx.com
127
Syntax
group add [-into <ID>]
Options
Specifies the object ID of an already existing group
into which to add a newly created group.
-into <ID>
Examples
To add a group with name Inputs to the current wave configuration:
group add Inputs
To create a group that adds a simulation object, dcm_clk_s, to the group:
set test_group_id [group add test_group]
wave add "dcm_clk_s" -into $test_group_id
To create groups within a group:
set group_id [group add test_group]
set group_id_1 [group add group_1 into $group_id]
set group_id_2 [group add group_2 into $group_id]
wave add clk read_ok -into $group_id_1
wave add data_w -into $group_id_2
128
www.xilinx.com
Syntax
virtualbus add <name> [-into <ID>][-reverse][-radix
<radix> ][-color <color> ]
Options
Option
Description
<name>
-into <ID>
-reverse
-radix <radix>
-color <color>
Examples
To add a virtual bus with name mybus" having radix as hexadecimal to the current
wave configuration:
virtualbus add mybus radix hex
To create a virtual bus that adds two simulation objects, sigA and sigB, to the virtual bus:
set vbusId [virtualbus add mybus radix hex]
wave add sigA into $vbusId
wave add sigB into $vbusId
Syntax
marker add <time>
www.xilinx.com
129
Options
Option
Description
<time>
Examples
To add a marker at 10 ns to the current wave configuration:
marker add 10 ns
130
www.xilinx.com
Chapter 11
Prerequisites
Hardware co-simulation in ISim has the following requirements:
Use Models
Hardware Co-Simulation (HWCoSim) in ISim supports two use models: one for pure
logic-based designs and another for hybrid designs.
Port controlled by ISim and accessible from the software testbench (no external I/Os)
www.xilinx.com
131
Hybrid Designs
The pure logic-based design use model is simple and trivial to set up, but is not suitable
for designs that require hard IPs, external I/Os and specific clock frequencies. ISim
HWCoSim offers a hybrid co-simulation flow that supports designs with the following
characteristics:
Some clocks are in lockstep with the software simulation using emulated clock
sources, and other clocks are free-running using external clock sources
Some ports can be mapped to external I/Os, which are neither controlled by ISim
nor accessible from software testbench
Accelerates simulation
Limitations
Hardware co-simulation (HWCoSim) in ISim has the following limitations:
Only one instance in a design can be selected for hardware co-simulation, and it
cannot be the top-level testbench itself.
The lockstep hardware co-simulation has additional restrictions on clocking and I/Os:
All ports of the instance under co-simulation must be routable to a slice register
or LUT. Certain resources on the FPGA require dedicated routes, such as to an
IOB or to certain port of a primitive, and thus cannot be wired to any port of the
instance under co-simulation.
132
www.xilinx.com
-hwcosim_clock specifies the port name of the clock input for the instance.
For a design with multiple clocks, specify the fastest clock using this option so that
ISim can optimize the simulation. Other clock ports are treated as regular data ports.
Ensure you have ISim selected as the simulator for the project. Switch to the
Simulation view.
2.
From the Hierarchy pane, select the instance to co-simulate in hardware and
right-click to show the popup menu.
3.
Select Source Properties from the popup menu to open the Source Properties dialog
box.
4.
5.
In the Clock Port field, specify the name of the clock port on the instance. For an
instance with multiple clocks, specify the name of the fastest clock port.
Select a board from the Target Board for Hardware Co-Simulation pulldown
list. The list shows only the boards with an FPGA that is under the same device
family chosen for the project.
Click OK.
www.xilinx.com
133
Notice that the instance enabled for hardware co-simulation is now marked with
a special icon
134
6.
Select the testbench module in the hierarchy pane to the start the simulation.
Hardware Co-Simulation must be started at a level above the instance that is
selected for co-simulation.
7.
8.
Open the Process properties for the Simulate Behavior Model to specify any
additional options for ISim before starting the compilation and simulation process.
The following example displays steps 1 8:
www.xilinx.com
www.xilinx.com
135
Decide which portion of your design to run in lockstep with ISim simulation and
which to be free-running. The following diagram outlines the concept:
2.
Make a copy of the original design constraints file and use it as the basis for the
custom constraints file.
3.
Modify the custom constraints file to comment out the LOC constraints for those
pins that are controlled by ISim. Other pins with LOC constraints are assumed
to be external.
4.
As a simple example, suppose you have a FIFO design and you want to single step
the write side and free run the read side.
module FIFO (WCLK, WDATA, WE,
The
NET
NET
NET
NET
NET
NET
NET
NET
136
www.xilinx.com
2.
If you are using a Xilinx Parallel Cable IV, follow steps 2a through 2d.
a.
Connect the DB25 Plug Connector on the Xilinx Parallel Cable IV to the
IEEE-1284 compliant PC Parallel (Printer) Port Connector.
b. Using the narrow (14 pin) 6 High Performance Ribbon cable, connect the pod
end of the Xilinx Parallel Cable IV to the FPGA JTAG header on the board.
c.
d. If necessary, connect the male end of the Keyboard/Mouse cable to the associated
female connector on the Xilinx Power Jack cable (splitter cable).
3.
If you are using a Xilinx Platform Cable USB, follow steps 3a and 3b.
a.
Connect the Xilinx Platform Cable USB to a USB port on the PC.
b. Using the narrow (14 pin) 6 High Performance Ribbon cable, connect the pod
end of the Xilinx Platform Cable USB to the FPGA JTAG header on the board.
4.
If your board supports PointtoPoint (P2P) Ethernet co-simulation, and you want
to use Ethernet P2P for (faster) co-simulation, then in addition to the above steps,
use an Ethernet cable to connect the Ethernet port of your PC to the Ethernet port of
your board. If your computer has more than one Ethernet card/port, note the MAC
address of the port that you connected to the board. Specify that address to the ISim
engine using the ISim Tcl command: hwcosim set ethernetInterfaceID.
5.
Power the board on and check to make sure the LED on the cable is green. Install
the Xilinx cable drivers when prompted. For more information about Ethernet,
see Determining the Ethernet.
Hardware Co-Simulation
Unlike the executable for software simulation, the executable for hardware co-simulation
communicates with a hardware board and offloads the simulation of the selected
portion of a design into the hardware. It is invoked in the same way as in the software
simulation flow:
Invoking the executable launches a Tcl shell interface for controlling the simulation
Invoking the executable with the -gui option launches the ISim GUI front end with
waveform display.
Before the simulation starts and each time the simulation is restarted, the executable
configures the FPGA with the hardware co-simulation bitstream. The configuration
process can take a few seconds or longer, depending on the speed of the JTAG cable.
ISim prints a message to the console when the configuration is complete.
www.xilinx.com
137
init
scope /mytestbench/top/hwcosim_inst
hwcosim set skipConfig 1
run 1000 ns
restart
scope /mytestbench/top/hwcosim_inst
hwcosim set skipConfig 1
run 1000 ns
138
www.xilinx.com
Board Support
To support a new FPGA board for hardware co-simulation in ISim, the board must have
a JTAG header. Provide a board support file that records the following information
of the board:
After you enter the board information into a board support file, you can use that board
for Hardware Co-Simulation (HWCoSim) in ISim. There is no GUI option to generate
the board support file.
To support additional boards, you can either modify the default board support file
or provide your own board support file, which must be named as hwcosim.bsp, in
the directory where fuse is invoked. The board support file defines a list of board
specification in the following format.
In the following example, ml402-jtag is the board identifier that is provided to the fuse
command to compile the design for the given board. The board identifier includes
the following list of properties:
Type specifies the type of co-simulation interface to be used. . Allowed values are:
jtag andppethernet (for Point-To-Point Ethernet-based HWCoSim).
Pin specifies the clock pin location. For differential clock sources, provide both
Positive and Negative clock pin locations.
Note For P2P Ethernet HWCoSim, additional fields must be specified. See the setup for
the ml605-ppethernet entry in the $XILINX/sysgen/hwcosim/data/hwcosim.bsp
file as an example.
www.xilinx.com
139
140
www.xilinx.com
www.xilinx.com
141
Use the following steps to determine the Ethernet port, set and verify the Ethernet
address, and verify that the simulation runs. Refer to the following figure for Step 1.
1.
b. In the command window, type ipconfig -all to list all Ethernet ports and
connections.
c.
Locate the physical address of the Ethernet port connected to the co-simulation
board.
d. Convert the physical address delimiter from a dash (-) to a colon (:). For
example: 00:19:B9:75:E5:95
2.
142
www.xilinx.com
General
1.
2.
3.
www.xilinx.com
143
Compilation
1.
2.
Simulation
1.
Q: Can I skip the FPGA configuration and reuse the last downloaded bitstream for
multiple co-simulation runs?
A: There is no command line or GUI option for that; however, you can run this
Tcl command: hwcosim set skipConfig 1. Be aware that, by skipping the
bitstream configuration, the design running in the FPGA maintains its previous
states across simulation runs. You might need to appropriately reset the design in
the testbench when a new simulation run starts.
2.
144
www.xilinx.com
Q: Which clock is supplied to the DUT? How is the clocking of the DUT being
handled during co-simulation?
A: The clock pin of the hardware board specified in the board support file is the
master clock source but is not used directly to drive the DUT. This clock source is
scaled to a particular clock frequency (typically around 25 to 100 MHz) through a
DCM/PLL. The scaled clock further goes through a gated clock buffer (BUFGCTRL)
before driving the clock port of the DUT. The gated clock buffer generates a clock
pulse to the DUT per simulation cycle to synchronize the software simulation and
the DUT execution.
2.
3.
4.
Q: Can I connect some ports of the DUT to external I/Os such as DDR memory
modules?
A: External I/Os and clocks are supported in the hybrid co-simulation mode through
the use of a custom constraints file as described in Hybrid Co-Simulation Flow.
www.xilinx.com
145
146
www.xilinx.com
Appendix A
Reference
Simulation Executable Commands
Simulation Executable Command Overview
Note The following information is intended for advanced users.
You can run ISim at the command line instead of using the ISE software or the ISim
interface.
Running a Functional Simulation From the Command Line With a Verilog Design
Running a Timing Simulation From the Command Line With a Verilog Design
Running a Functional Simulation From the Command Line With a VHDL Design
Running a Timing Simulation From the Command Line With a VHDL Design
VHDL compiler (vhpcomp) - The VHDL compiler, vhpcomp, parses VHDL source
files for all design units in those files.
Elaboration Commands
HDL linker (fuse) - The HDL linker, fuse, performs static elaboration of a design in
terms of parsed nodes, generates object code for each unique module instance, and links
the generated object codes with ISim simulation engine library to create a simulation
executable. A user runs this generated simulation executable to effect simulation of
the design under consideration.
Simulation Commands
Simulation Executable - The ISE Simulation Executable is generated by the fuse
command. To run the simulation of a design in ISim, the generated simulation
executable needs to be invoked. When ISim is run inside the ISE interface, ISE takes
care of invoking the generated simulation executable. A command-line user needs
to explicitly invoke the generated simulation executable to effect simulation. The
simulation executable effects event-driven simulation and has rich support for driving
and probing simulation using Tcl.
www.xilinx.com
147
Appendix A: Reference
Project Files
A project file can be used to invoke vhpcomp, vlogcomp and fuse. You can collect all
of the design files for a particular project into a project file, and use the -prj option to
specify the project file. The project file can contain VHDL or Verilog files.
Each line in a project file must be formatted as follows:
<language> [<library> ]<filename> {[-d <macro> ] [-i
<include_path> ]}
where,
<language> is either vhdl or verilog.
<library> is an optional working library name.
Tcl Commands
The simulation executable provides a powerful Tcl interface that can be run in batch
mode. Tcl commands can be used to control the simulator and view the results of
simulation.
Invoke the simulation executable using the -tclbatch option to list a number of Tcl
commands in a batch file.
148
Command
Description
-f <cmd_file>
You can save ISim engine command options in a text file for
future use. This option reads and executes the saved options
that are specified in <cmd_file> .
-gui
-h
-intstyle
ise | xflow | silent
-log <file_name>
www.xilinx.com
Appendix A: Reference
Command
Description
-maxdeltaid <number>
-nolog
-sdfnowarn
-sdfnoerror
-sdfmin|
-sdftyp|-sdfmax
<root=file>
-sdfroot <root_path>
-tclbatch <file_name>
Turn batch mode on. By default batch mode is off. When batch
mode off, Tcl commands can be issued from the Console panel
even if the engine is busy simulating. When batch mode is on,
all of the commands in the specified batch file are executed
sequentially until completion, ignoring any commands entered
from the command prompt. The <file_name> specifies the name
of file containing Tcl commands to be executed.
For information about ISim Tcl commands, see Simulation
Command Overview.
When the simulator matches this command line argument
string with the $test$plusarg or $value$plusarg system
function of a Verilog design file, the test or design behavior
change associated with the system function is run.
-testplusarg
<string|stringvalue>
Specifies the VCD output file for Verilog projects. The default
file name is dump.vcd.
-vcdunit<unit>
Specifies the VCD output time unit. Possible values are fs, ps,
ns, us, ms and sec. Default is ps.
-view <waveform_file.wcfg>
-wdb
<waveform_database_file.wdb>
www.xilinx.com
149
Appendix A: Reference
Use Models - Hardware co-simulation in ISim currently supports two use models:
one for pure logic-based designs, and one for designs containing external inputs
and outputs.
Usage - Similar to software-based HDL simulation, you must first compile a design
into a simulation executable before doing hardware co-simulation. The compilation
is performed by invoking the ISim compiler fuse using the command line or through
Project Navigator. Implementation tools are run and a hardware co-simulation
bitstream is produced at the end of the compilation. This bitstream is used for
co-simulating the portion running in hardware with the portion running in ISim.
fuse
fuse Overview and Syntax
Note The following information is intended for advanced users.
150
www.xilinx.com
Appendix A: Reference
The fuse command is the Hardware Description Language (HDL) compiler, elaborator,
and linker used by the ISim. The command links design units already compiled with
vhpcomp or vlogcomp, and creates a simulation executable. It also takes a mixed
language project file and compiles the design units on-the-fly. Name(s) of the top-level
design unit(s) must be specified on the fuse command line argument. The fuse
command effects static elaboration on the design given the top design units and then
compiles the design units to object code. The design unit object codes are then linked
together to create a simulation executable.
Use the -prj option to call vhpcomp or vlogcomp, as appropriate, and to compile
your HDL code.
Use the -o <sim_exe> option to changes the simulation executable file name
and location from the default x.exe.
Note To exclude certain lines in a .prj file in the fuse command, use the "--" option.
The fuse command generates object code and data files for each design unit comprising
the design and places them inside isim/<simulation_executable> .sim directory.
Note Do no remove the isim/<simulation_executable> .sim directory
otherwise the design cannot be simulated.
Syntax
fuse (option )
where <option> is any option found in fuse Options.
Note This command is case sensitive.
fuse Options
The fuse command options are as follows.
Option
Description
-d<macro_definition>[=<value>=<value>]
-f<cmd_file>
-generic_top "<parameter>=<value>"
-h
-hwcosim_instance <arg>
www.xilinx.com
151
Appendix A: Reference
Option
Description
-hwcosim_clock <arg>
-hwcosim_board <arg>
-hwcosim_reuse_last_bitstream
<arg>
-i<include_path>
-incremental
-initfile
<sim_init_file>
-ise <file>
-L|-lib<search_lib>
[ = <lib_path>]
-maxdelay
152
www.xilinx.com
Appendix A: Reference
Option
Description
-maxdesigndepth<depth>
-mindelay
-mt
<value>
-nodebug
-nospecify
-notimingchecks
-o <sim_exe>
<platform> is Windows.
-override_timeprecision
-override_timeunit
-prj<prj_file>.prj
-rangecheck
-sourcelibdir
www.xilinx.com
153
Appendix A: Reference
Option
Description
-sourcelibext
-sourcelibfile
-timeprecision_vhdl
<time_precision>
-timescale
<time_unit/time_precision>
-v<value>
-version
fuse Examples
Using Precompiled HDL
The following examples show how to invoke fuse using precompiled HDL.
For VHDL using a top level configuration:
fuse work.yourtop
154
www.xilinx.com
Appendix A: Reference
For Verilog or mixed language design using all of the top-level modules:
fuse work.top_level_module_name_1 work.top_level_module_name_2
work.glbl -L simprims_ver -L logicalLib1 -o mysim.exe
work
work
work
work
x1.vhd
x2.vhd
x3.vhd
tb.vhd
work
work
work
work
x1.v
x2.v
x3.v
tb.v
www.xilinx.com
155
Appendix A: Reference
Note For mixed language designs, for the modules on language boundary and for the
Verilog modules that have been compiled into any libraries other than the work library,
those libraries must be passed to fuse using the -L command line option in the desired
search order so that fuse can locate those design units and link them into the simulation
executable. For more information, see Mixed Language Simulation Overview.
vlogcomp
vlogcomp Overview and Syntax
Note The following information is intended for advanced users.
ISim uses the Verilog compiler, vlogcomp, to parse Verilog source files and generate
object code for all design units in those files. The object code generated by vlogcomp is
used by fuse to create a simulation executable.
You must specify either a project file or one or more Verilog source files to compile. If
neither the project file nor the Verilog file is specified, vlogcomp issues an error.
Syntax
vlogcomp (option)
where option is any option found in vlogcomp Options.
Note This command is case sensitive.
vlogcomp Options
The vlogcomp command options are as follows.
156
Option
Description
<verilog_file>
-d <macro_definition>
[=<value> ]
-f <cmd_file>
-h
-i <include_path>
-incremental
-initfile<sim_init_file>
www.xilinx.com
Appendix A: Reference
Option
Description
-intstyle
ise |xflow |silent
-ise <file>
-L|-lib <search_lib>
[=<lib_path> ]
-maxdelay
-mindelay
-nodebug
-nospecify
-notimingchecks
-sourcelibdir
-sourcelibext
-sourcelibfile
-typdelay
-v <value>
www.xilinx.com
157
Appendix A: Reference
Option
Description
-version
-work <work_lib> [=
<lib_path> ]
vlogcomp Examples
The vlogcomp command can be used as follows:
To invoke the Verilog compiler with all options saved in a file called
run32.txt:vlogcomp -f run32.txt
To invoke the Verilog compiler using a work library with the logical name
mysimwork located in the /home/smithjj/mylib directory, and compile all the
Verilog files in the project file dsp64.prj:
vlogcomp -work mysimwork=/home/smithjj/mylib -prj dsp64.prj
To invoke the Verilog compiler using the default work library specified in the
xilinxsim.ini file and compile the Verilog files suba.v and subb.v:
vlogcomp suba.v subb.v
vhpcomp
vhpcomp Overview and Syntax
Note The following information is intended for advanced users.
ISim uses the VHDL compiler, vhpcomp, to parses VHDL source files and generate
object code for all design units in those files. The object code generated by vhpcomp is
used by fuse to create a simulation executable.
Specify either a project file or one or more VHDL files to compile. If neither project file
nor VHDL file are specified, vhpcomp issues an error.
Syntax vhpcomp (option)
where option is any option found in vhpcomp Options.
Note This command is case sensitive.
vhpcomp Options
The vhpcomp command options are:
158
Option
Description
<vhdl_file>
-f <cmd_file >
-h
-incremental
Compiles only the files that have changed since last compile.
www.xilinx.com
Appendix A: Reference
Option
Description
-intstyle
ise | xflow | silent
-ise <file>
-L|-lib <search_lib>
[=<lib_path> ]
-nodebug
-rangecheck
-work <work_lib>
[=<lib_path> ]
www.xilinx.com
159
Appendix A: Reference
vhpcomp Examples
The vhpcomp command can be used as follows:
To invoke the VHDL compiler with all options saved in a file called run32.txt:
vhpcomp -f run32.txt
To invoke the VHDL compiler using a work library with the logical name
mysimwork located in the /home/smithjj/mylib directory, and compile all the
VHDL files in the project file dsp64.prj:
vhpcomp -work mysimwork=/home/smithjj/mylib -prj dsp64.prj
To invoke the VHDL compiler using the default work library specified in the
xilinxsim.ini file and compile the VHDL files suba.vhd and subb.vhd:
vhpcomp suba.vhd subb.vhd
ISim Command
Remarks
sdfanno
{-min|-typ|-max}
<file_name>
160
[-nowarn]
[-noerror]
[-root<path_name>]
vsim
<lib_name> <design_name>.
fuse -lib
<lib_name> <design_name>
Builds a simulation
executable.
vlog -work
<libname><file_name>
vlogcomp <file_name>
vhpcomp <file_name>
www.xilinx.com
Appendix A: Reference
ISim Command
Remarks
bp del <index>[<index>... ]
bd<file_name> <line_number>
bp remove <file_name>
<line_number>
bd<file_name>
<line_number><id_number>|
bp remove <file_name>
<line_number>
Removes breakpoint at
<line_number>in <file_name>.
bp <file_name> <line_number>
bp add <file_name>
<line_number>
Adds breakpoint
at <line_number> in
<file_name>.Ignored
options: [-id <id#>],
[-inst <region>], [-cond
{<condition_expression>}]
bp -query <file_name>
bp list
show driver<net_name>
env
scope
env ..
scope ..
env <pathname>
scope <path_name>
exit
exit
force -deposit
<signal_name> <value>
[<time>]
put
force -freeze
help
help
help <command>
examine<signal_name>
www.xilinx.com
161
Appendix A: Reference
DO File Command
ISim Command
Remarks
if { [exa sig_a] ==
"0011ZZ"} {echo"Signal
value matches"}
noforce <signal>
quit
quit
radix
radix -<radix_type>
restart
restart
run
<length> <unit>
run -all|-continue
run
show
show scope
show
show signal
show -all
show child -r
vcd add -r
162
vcd
dumpfile<file_name>
www.xilinx.com
Appendix A: Reference
DO File Command
ISim Command
Remarks
vcd flush
vcd dumpflush
vcd dumplimit
<no_of_bytes>
vcd {dumpon |
dumpoff}
Exceptions
abstract_literal
access_type_definition
actual_designator
actual_parameter_part
actual_part
adding_operator
aggregate
alias_declaration
alias_designator
allocator
architecture_body
www.xilinx.com
163
Appendix A: Reference
Exceptions
architecture_declarative_part
architecture_statement_part
array_type_definition
assertion
assertion_statement
association_element
association_list
attribute_declaration
attribute_designator
attribute_name
AACTIVE, AASCENDING([N]),
AHIGH([N]), ALENGTH([N]),
ALEFT([N]), ALOW([N]), ARANGE([N]),
AREVERCE_RANGE([N]), ARIGHT([N])
SDELAYED[(T)], SEVENT,
SLAST_ACTIVE, SLAST_EVENT,
SLAST_VALUE
attribute_specification
base
base_specifier
base_unit_declaration
based_integer
based_literal
basic_character
basic_graphic_character
basic_identifier
binding_indication
bit_string_literal
bit_value
block_configuration
block_declarative_item
block_declarative_part
164
www.xilinx.com
Appendix A: Reference
Exceptions
block_header
block_specification
block_statement
case_statement
case_statement_alternative
character_literal
choice
choices
component_configuration
component_declaration
component_instantiation_statement
component_specification
composite_type_definition
concurrent_assertion_statement
concurrent_procedure_call_statement
concurrent_signal_assignment_statement
concurrent_statement
condition
condition_clause
conditional_signal_assignment
conditional_waveform
configuration_declaration
configuration_declarative_item
configuration_declarative_part
configuration_item
configuration_specification
constant_declaration
constrained_array_definition
constraint
context_clause
context_item
decimal_literal
declaration
www.xilinx.com
165
Appendix A: Reference
Exceptions
delay_mechanism
design_file
design_unit
designator
direction
discrete_range
element_association
element_declaration
element_subtype_definition
entity_aspect
entity_class
entity_class_entry
entity_class_entry_list
entity_declaration
entity_declarative_item
entity_declarative_part
entity_designator
entity_header
entity_name_list
entity_specification
entity_tag
enumeration_literal
enumeration_type_definition
exit_statement
exponent
expression
extended_digit
extended_identifier
factor
file_declaration
file_logical_name
file_open_information
file_type_definition
floating_type_definition
formal_designator
166
www.xilinx.com
Appendix A: Reference
Exceptions
formal_parameter_list
formal_part
full_type_declaration
function_call
generate_statement
generate_scheme
generic_clause
generic_list
generic_map_aspect
graphic_character
identifier
identifier_list
if_statement
incomplete_type_declaration
index_constraint
index_specification
index_subtype_definition
indexed_name
instantiated_unit
instantiation_list
integer
integer_type_definition
interface_constant_declaration
interface_declaration
nterface_element
interace_file_declaration
interface_list
interface_signal_declaration
interafce_variable_declaration
iteration_scheme
label
letter
letter_or_digit
library_clause
library_unit
literal
www.xilinx.com
167
Appendix A: Reference
Exceptions
logical_name
logical_name_list
logical_operator
loop_statement
miscellaneous_operator
mode
multiplying_operator
Exceptions
name
next_statment
numeirc_literal
object_declaration
operator_symbol
ISim Support
continuous_assign
supported
list_of_net_assignments
supported
net_assignment
supported
168
Verilog Construct
ISim Support
initial_construct
supported
always_construct
supported
blocking_assignment
supported
nonblocking_assignment
supported
procedural_continuous_assignment
supported
function_blocking_assignment
supported
function_statement_or_null
supported
www.xilinx.com
Appendix A: Reference
ISim Support
Commen
function_seq_block
supported
variable_assignment
supported
par_block
partially supported
seq_block
supported
Statements
Verilog Construct
ISim Support
statement
supported
statement_or_null
supported
function_statement
supported
ISim Support
delay_control
supported
delay_or_event_control
supported
disable_statement
supported
event_control
supported
event_trigger
supported
event_expression
supported
procedural_timing_control_statement
supported
wait_statement
supported
Conditional Statements
Verilog Construct
ISim Support
conditional_statement
supported
if_else_if_statement
supported
function_conditional_statement
supported
function_if_else_if_statement
supported
Case Statements
Verilog Construct
ISim Support
case_statement
supported
case_item
supported
function_case_statement
supported
function_case_item
upported
www.xilinx.com
169
Appendix A: Reference
Looping Statements
Verilog Construct
ISim Support
function_loop_statement
supported
loop_statement
supported
ISim Support
system_task_enable
supported
task_enable
supported
ISim Support
celldefine
unsupported
endcelldefine
unsupported
default_nettype
supported
define
supported
undef
supported
ifdef
supported
ifndef
supported
elsif
supported
else
supported
endif
supported
include
supported
resetall
supported
line
supported
timescale
supported
unconnected_drive
unsupported
nounconnected_driv
unsupported
Comment
Declaration Constructs
The following Verilog Declaration constructs are supported by the ISim as defined below.
170
www.xilinx.com
Appendix A: Reference
ISim Support
local_parameter_declaration
supported
parameter_declaration
supported
specparam_declaration
supported
Type Declarations
Verilog Construct
ISim Support
event_declaration
supported
genvar_declaration
supported
integer_declaration
supported
net_declaration
supported
real_declaration
supported
reg_declaration
supported
time_declaration
supported
ISim Support
net_type
supported
output_variable_type
supported
real_type
supported
variable_type
supported
Strengths
Verilog Construct
ISim Support
drive_strength
supported
strength0
supported
strength1
supported
charge_strength
unsupported
Delays
Verilog Construct
ISim Support
delay2
supported
delay3
supported
delay_value
supported
www.xilinx.com
171
Appendix A: Reference
Declaration Lists
Verilog Construct
ISim Support
list_of_event_identifiers
supported
list_of_genvar_identifiers
supported
list_of_net_decl_assignments
supported
list_of_net_identifiers
supported
list_of_param_assignments
supported
list_of_port_identifiers
supported
list_of_real_identifiers
supported
list_of_specparam_assignments
supported
list_of_variable_identifiers
supported
list_of_variable_port_identifiers
supported
Declaration Assignments
Verilog Construct
ISim Support
net_decl_assignment
supported
param_assignment
supported
specparam_assignment
supported
pulse_control_specparam
supported
error_limit_value
supported
reject_limit_value
supported
limit_value
supported
Declaration Ranges
Verilog Construct
ISim Support
dimension
supported
range
supported
Function Declarations
172
Verilog Construct
ISim Support
function_declaration
supported
function_item_declaration
supported
function_port_list
supported
range_or_type
supported
www.xilinx.com
Appendix A: Reference
Task Declarations
Verilog Construct
ISim Support
task_declaration
supported
task_item_declaration
supported
task_port_list
supported
task_port_item
supported
tf_input_declaration
supported
tf_output_declaration
supported
tf_inout_declaration
supported
task_port_type
supported
ISim Support
block_item_declaration
supported
block_reg_declaration
supported
list_of_block_variable_identifiers
supported
block_variable_type
supported
Expression Constructs
The following Verilog Expression constructs are supported by the ISim as defined below.
Concatenations
Verilog Construct
ISim Support
concatenation
supported
constant_concatenation
supported
constant_multiple_concatenation
supported
module_path_concatenation
supported
module_path_multiple_concatenation
supported
multiple_concatenation
supported
net_concatenation
supported
net_concatenation_value
supported
variable_concatenation
supported
variable_concatenation_value
supported
Function Calls
Verilog Construct
ISim Support
constant_function_call
supported
function_call
supported
system_function_call
supported
www.xilinx.com
173
Appendix A: Reference
Expressions
Verilog Construct
ISim Support
base_expression
supported
conditional_expression
supported
constant_base_expression
supported
constant_expression
supported
constant_mintypmax_expression
supported
constant_range_expression
supported
dimension_constant_expression
supported
expression1
supported
expression2
supported
expression3
supported
expression
supported
lsb_constant_expression
supported
mintypmax_expression
supported
module_path_conditional_expression
supported
module_path_expression
supported
module_path_mintypmax_expression
supported
msb_constant_expression
supported
range_expression
supported
width_constant_expression
supported
Primaries
Verilog Construct
ISim Support
constant_primary
supported
module_path_primary
supported
primary
supported
ISim Support
net_lvalue
supported
variable_lvalue
supported
Operators
174
Verilog Construct
ISim Support
unary_operator
supported
binary_operator
supported
unary_module_path_operator
supported
binary_module_path_operator
supported
www.xilinx.com
Appendix A: Reference
Numbers
Verilog Construct
ISim Support
number
supported
real_number
supported
exp
supported
decimal_number
supported
binary_number
supported
octal_number
supported
hex_number
supported
sign
supported
size
supported
non_zero_unsigned_number
supported
unsigned_number
supported
binary_value
supported
octal_value
supported
hex_value
supported
decimal_base
supported
binary_base
supported
octal_base
supported
hex_base
supported
non_zero_decimal_digit
supported
decimal_digit
supported
binary_digit
supported
octal_digit
supported
hex_digit
supported
x_digit
supported
z_digit
supported
Strings
Verilog Construct
ISim Support
string
supported
General Constructs
The following Verilog general and miscellaneous constructs are support by the ISim
as defined below.
www.xilinx.com
175
Appendix A: Reference
Attributes
Verilog Construct
ISim Support
attribute_instance
unsupported
attr_spec
unsupported
attr_name
unsupported
Comments
Verilog Construct
ISim Support
comment
supported
one_line_comment
supported
block_comment
supported
comment_text
supported
Identifiers
176
Verilog Construct
ISim Support
arrayed_identifier
supported
block_identifier
supported
cell_identifier
unsupported
config_identifier
unsupported
escaped_arrayed_identifier
supported
escaped_hierarchical_identifier
supported
escaped_identifier
supported
event_identifier
supported
function_identifier
supported
gate_instance_identifier
supported
generate_block_identifier
supported
genvar_identifier
supported
genvar_function_identifier
unsupported
hierarchical_block_identifier
supported
hierarchical_event_identifier
supported
hierarchical_function_identifier
supported
hierarchical_identifier
supported
hierarchical_net_identifier
supported
hierarchical_variable_identifier
supported
hierarchical_task_identifier
supported
identifier
supported
inout_port_identifier
supported
input_port_identifier
supported
instance_identifier
supported
www.xilinx.com
Appendix A: Reference
Verilog Construct
ISim Support
library_identifier
unsupported
memory_identifier
supported
module_identifier
supported
module_instance_identifier
supported
net_identifier
supported
output_port_identifier
supported
parameter_identifier
supported
port_identifier
supported
real_identifier
supported
simple_arrayed_identifier
supported
simple_hierarchical_identifier
supported
simple_identifier
supported
specparam_identifier
supported
system_function_identifier
supported
system_task_identifier
supported
task_identifier
supported
terminal_identifier
supported
text_macro_identifier
supported
topmodule_identifier
supported
udp_identifier
supported
udp_instance_identifier
supported
variable_identifier
supported
Identifier Branches
Verilog Construct
ISim Support
simple_hierarchical_branch
supported
escaped_hierarchical_branch
supported
White Space
Verilog Construct
ISim Support
white_space
supported
www.xilinx.com
177
Appendix A: Reference
Primitive Instantiations
Verilog Construct
ISim Support
gate_instantiation
supported
cmos_switch_instance
unsupported
enable_gate_instance
supported
mos_switch_instance
unsupported
n_input_gate_instance
supported
n_output_gate_instance
supported
pass_switch_instance
unsupported
pass_enable_switch_instance
unsupported
pull_gate_instance
supported
name_of_gate_instance
supported
Primitive Strengths
Verilog Construct
ISim Support
pulldown_strength
supported
pullup_strength
supported
Primitive Terminals
Verilog Construct
ISim Support
enable_terminal
supported
inout_terminal
supported
input_terminal
supported
ncontrol_terminal
supported
output_terminal
supported
pcontrol_terminal
supported
178
Verilog Construct
ISim Support
cmos_switchtype
unsupported
enable_gatetype
supported
mos_switchtype
unsupported
n_input_gatetype
supported
n_output_gatetype
supported
pass_en_switchtype
unsupported
pass_switchtype
unsupported
www.xilinx.com
Appendix A: Reference
Module Instantiations
Verilog Construct
ISim Support
module_instantiation
supported
parameter_value_assignment
supported
Comment
list_of_parameter_assignments supported
ordered_parameter_assignment supported
named_parameter_assignment supported
module_instance
supported
name_of_instance
partially supported
list_of_port_connections
supported
ordered_port_connection
supported
named_port_connection
supported
Generated Instantiation
Verilog Construct
ISim Support
generated_instantiation
supported
generate_item_or_null
partially supported
Comment
The module_or_generate_item
alternative is not supported.
Production from 1364-2001 Verilog
standard:
generate_item_or_null ::=
generate_conditional_statement
| generate_case_statement |
generate_loop_statement |
generate_block
| module_or_generate_item
generate_item
supported
generate_conditional_statement supported
generate_case_statement
supported
generate_case_item
supported
generate_loop_statement
supported
genvar_assignment
partially supported
www.xilinx.com
179
Appendix A: Reference
Verilog Construct
ISim Support
Comment
generate_block ::=
begin
: generate_block_identifier
{ generate_item }
end
ISim Support
library_text
unsupported
library_descriptions
unsupported
library_declaration
unsupported
file_path_spec
unsupported
include_statement
unsupported
Comment
ISim Support
config_declaration
unsupported
design_statement
unsupported
config_rule_statement
unsupported
default_clause
unsupported
inst_clause
unsupported
inst_name
unsupported
cell_clause
unsupported
liblist_clause
unsupported
use_clause
unsupported
180
ISim Support
ISim Support
source_text
supported
description
supported
module_declaration
supported
module_keyword
supported
www.xilinx.com
Appendix A: Reference
ISim Support
module_parameter_port_list
supported
list_of_ports
supported
list_of_port_declarations
supported
port
supported
port_expression
supported
port_reference
supported
port_declaration
supported
Module Items
Verilog Construct
ISim Support
module_item
supported
module_or_generate_item
supported
module_or_generate_item_declaration
supported
non_port_module_item
supported
parameter_override
supported
ISim Support
specify_block
supported
specify_item
supported
pulsestyle_declaration
supported
showcancelled_declaration
supported
ISim Support
path_declaration
supported
simple_path_declaration
supported
parallel_path_declaration
supported
full_path_description
supported
list_of_path_inputs
supported
list_of_path_outputs
supported
www.xilinx.com
181
Appendix A: Reference
ISim Support
specify_input_terminal_descriptor
supported
specify_output_terminal_descriptor
supported
input_identifier
supported
output_identifier
supported
182
Verilog Construct
ISim Support
path_delay_value
supported
ist_of_path_delay_expressions
supported
t_path_delay_expression
supported
trise_path_delay_expression
supported
tfall_path_delay_expression
supported
tz_path_delay_expression
supported
t01_path_delay_expression
supported
t10_path_delay_expression
supported
t0z_path_delay_expression
supported
tz1_path_delay_expression
supported
t1z_path_delay_expression
supported
tz0_path_delay_expression
supported
t0x_path_delay_expression
supported
tx1_path_delay_expression
supported
t1x_path_delay_expression
supported
tx0_path_delay_expression
supported
txz_path_delay_expression
supported
tzx_path_delay_expression
supported
path_delay_expression
supported
edge_sensitive_path_declaration
supported
parallel_edge_sensitive_path_declaration
supported
full_edge_sensitive_path_declaration
supported
data_source_expression
supported
edge_identifier
supported
state_dependent_path_declaration
supported
polarity_operator
supported
www.xilinx.com
Appendix A: Reference
ISim Support
system_timing_check
supported
$hold_timing_check
supported
$setuphold_timing_check
supported
$recovery_timing_check
supported
$removal_timing_check
supported
$recrem_timing_check
supported
$skew_timing_check
unsupported
$timeskew_timing_check
unsupported
$fullskew_timing_check
unsupported
$period_timing_check
supported
$width_timing_check
supported
$nochange_timing_check
unsupported
ISim Support
checktime_condition
unsupported
controlled_reference_event
upported
data_event
supported
delayed_data
unsupported
delayed_reference
unsupported
end_edge_offset
unsupported
event_based_flag
unsupported
notify_reg
supported
reference_event
supported
remain_active_flag
unsupported
stamptime_condition
unsupported
start_edge_offset
unsupported
threshold
supported
timing_check_limit
supported
www.xilinx.com
183
Appendix A: Reference
ISim Support
timing_check_event
supported
controlled_timing_check_event
supported
timing_check_event_control
supported
specify_terminal_descriptor
supported
edge_control_specifier
supported
edge_descriptor
supported
zero_or_one
supported
z_or_x
supported
timing_check_condition
supported
scalar_timing_check_condition
supported
scalar_constant
supported
184
Verilog Construct
ISim Support
$display
supported
$displayb
supported
$displayh
supported
$displayo
supported
$monitor
supported
$monitorb
supported
$monitorh
supported
$monitoro
supported
$monitoroff
supported
$monitoron
supported
$strobe
supported
$strobeb
supported
$strobeh
supported
$strobeo
supported
$write
supported
$writeb
supported
$writeh
supported
$writeo
supported
www.xilinx.com
Appendix A: Reference
ISim Support
$fclose
supported
$fdisplay
supported
$fdisplayb
supported
$fdisplayh
supported
$fdisplayo
supported
$ferror
supported
fflush
supported
$fgetc
supported
$fgets
supported
$fmonitor
supported
$fmonitorb
supported
$fmonitorh
supported
$fmonitoro
supported
$fopen
supported
$fread
supported
$fscanf
supported
$fseek
supported
$fstrobe
supported
$fstrobeb
supported
$fstrobeh
supported
$fstrobeo
supported
$ftell
supported
$fwrite
supported
$fwriteb
supported
$fwriteh
supported
$fwriteo
supported
$readmemb
supported
$readmemh
supported
$rewind
supported
$sdf_annotate
supported
$sformat
supported
$sscanf
supported
$swrite
supported
$swriteb
supported
$swriteh
supported
$swriteo
supported
$ungetc
supported
www.xilinx.com
185
Appendix A: Reference
Timescale Tasks
Verilog Construct
ISim Support
$printtimescale
supported
timeformat
supported
ISim Support
$finish
supported
$stop
supported
ISim Support
$async$and$array
unsupported
$async$nand$array
unsupported
$async$nor$array
unsupported
$async$or$array
unsupported
$sync$and$array
unsupported
$sync$nand$array
unsupported
$sync$nor$array
unsupported
$sync$or$array
unsupported
$async$and$plane
unsupported
$async$nand$plane
unsupported
$async$nor$plane
unsupported
$async$or$plane
unsupported
$sync$and$plane
unsupported
$sync$nand$plane
unsupported
$sync$nor$plane
unsupported
$sync$or$plane
unsupported
186
Verilog Construct
ISim Support
$q_add
supported
$q_exam
supported
$q_full
supported
$q_initialize
supported
$q_remove
supported
www.xilinx.com
Appendix A: Reference
ISim Support
$realtime
supported
$stime
supported
$time
supported
Conversion Functions
Verilog Construct
ISim Support
$bitstoreal
supported
$realtobits
supported
$itor
supported
$rtoi
supported
$signed
supported
$unsigned
supported
ISim Support
$dist_chi_square
supported
$dist_erlang
supported
$dist_exponential
supported
$dist_normal
supported
$dist_poisson
supported
$dist_t
supported
$dist_uniform
supported
$random
supported
ISim Support
$test$plusargs
supported
$value$plusargs
supported
www.xilinx.com
187
Appendix A: Reference
ISim Suppor
$dumpall
supported
$dumpfile
supported
$dumpflush
supported
$dumplimit
supported
$dumpoff
supported
$dumpon
supported
$dumpports
unsupported
$dumpportsall
unsupported
$dumpportsflush
unsupported
$dumpportslimit
unsupported
$dumpportsoff
unsupported
$dumpportson
unsupported
$dumpvars
supported
UDP Declaration
Verilog Construct
ISim Support
udp_declaration
supported
UDP Ports
188
Verilog Construct
ISim Support
udp_port_list
supported
udp_declaration_port_list
supported
udp_port_declaration
supported
udp_output_declaration
supported
udp_input_declaration
supported
udp_reg_declaration
supported
www.xilinx.com
Appendix A: Reference
UDP Body
Verilog Construct
ISim Support
udp_body
supported
combinational_body
supported
combinational_entry
supported
sequential_body
supported
udp_initial_statement
supported
init_val
supported
sequential_entry
supported
seq_input_list
supported
level_input_list
supported
edge_input_list
supported
edge_indicator
supported
current_state
supported
next_state
supported
output_symbol
supported
level_symbol
supported
edge_symbol
supported
UDP Instantiation
Verilog Construct
ISim Support
udp_instantiation
supported
udp_instance
supported
name_of_udp_instance
partially supported
www.xilinx.com
Comment
189
190
www.xilinx.com
Appendix B
About ModelSim XE
ModelSim XE stands for ModelSim Xilinx Edition, which is an OEM
product from Mentor Graphics. ModelSim XE provides a complete HDL
simulation environment that lets you verify the functional and timing models
of your design, and your HDL source code. ModelSim XE was discontinued
in the 12.4 software release. See the Product Discontinuance Notice at
http://www.xilinx.com/support/documentation/customer_notices/xcn10028.pdf.
ModelSim XE was shipped with each major Xilinx ISE Design Suite release through
version 12.3, and comes in two versions:
ModelSim XE Starter - a free version that can be downloaded from the Xilinx
website. A starter license is required for using this product.
About ISim
ISim is a Xilinx simulation product that provides a complete, full-featured HDL
simulator integrated within Project Navigator, Embedded Design Kit, and System
Generator.
ISim is available with all major Xilinx ISE Design Suite releases, and comes in two
versions:
ISim Lite - a limited version of the ISE Simulator. In this version, when your design
plus testbench exceeds 50,000 lines of HDL code, the simulator begins to derate the
performance of the simulator for that invocation.
www.xilinx.com
191
Feature comparison
Feature
ModelSim XE
Starter
ModelSim XE Full
ISim Lite
ISim Full
Line Limit
(Statements)
10,000
40,000
50,000
None
Performance
30% of ModelSim PE
or ModelSim DE
40% of ModelSim PE
or ModelSim DE
Same as ModelSim XE
Same as ModelSim XE
Mixed Language
No
No
Yes
Yes
VHDL
Yes
Yes
Yes
Yes
Verilog
Yes
Yes
Yes
Yes
SystemVerilog for
Design
No
No
Roadmap
Roadmap
SystemVerilog for
Verification
No
No
Roadmap
Roadmap
Debugging
Environment
Yes
Yes
Yes
Yes
Standalone Waveform
Viewer
Yes
Yes
Yes
Yes
Memory
Viewer/Editor
Yes
Yes
Yes
Yes
Verilog PLI/VPI
Yes
Yes
Roadmap
Roadmap
VHDL FLI/VHPI
No
No
Roadmap
Roadmap
Code Coverage
No
No
Roadmap
Roadmap
SecureIP/HardIP
Support
No
No
Yes
Yes
EDK Support
No
No
Yes
Yes
System Generator
Support
No
No
Yes
Yes
CoreGen Support
Yes
Yes
Yes
Yes
MIG Support
No
No
Yes
Yes
Floating License
No
No
Yes
Yes
32-bit OS Support
Windows
Windows
Windows/Linux
Windows/Linux
64-bit (native) OS
Support
No
No
Windows/Linux
Windows/Linux
Simulation Process
This section describes the different modes of simulation and the steps involved in
simulation. Each sub-section explains the differences between the two simulators.
192
www.xilinx.com
The following figure shows the different steps in simulation and the process for each
step.
www.xilinx.com
193
ISim Flow
Libraries for ISim are updated as part of the standard Xilinx installation. No additional
steps are needed. Mapping is also handled automatically by Xilinx. You do not need to
know where to download from or how to map the Xilinx libraries to start simulating.
ISim Flow
ModelSim XE uses the following commands for compilation and elaboration.
vhpcomp options (VHDL Compiler) runs the VHDL compiler and compiles VHDL
files to a specified directory.
vlogcomp options (Verilog Compiler) runs the Verilog compiler and compiles
Verilog files to a specified directory.
fuse options (VSIM simulator) elaborates the load for the simulation and creates an
executable that needs to be launched to run the simulation.
For each of these commands, multiple options give you additional control over
compilation and elaboration.
194
www.xilinx.com
ISim Flow
Running fuse creates a named executable. You must run this executable to launch the
simulation. By default this executable is named x.exe, but you can change the name.
By default, running the executable runs the simulation in command line mode. To
launch the GUI, use the gui switch.
www.xilinx.com
195
ISim has a different approach to measuring. ISim uses both cursors and markers. While
in ModelSim XE a cursor is a permanent measuring stick, ISim cursors are treated
as temporary. ISim has a primary and a secondary cursor that together can be used to
measure between two points. ISim markers let you measure between multiple points,
including the primary cursor.
ISim also provides a ruler for frame of reference. The selected marker or cursor is always
the 0 location against which all other markers are measured. This image shows how to
measure between the edges of interest in ISim.
Note You cannot rename markers in ISim.
Analog Waveforms
Contact Xilinx Technical Support for more information on availability.
196
www.xilinx.com
Library Compilation
ModelSim XE Property Name
Comments
N/A
N/A
N/A
www.xilinx.com
197
Comments
Custom Do File
N/A
N/A
Comments
Runtime settings
ModelSim XE Property Name
Simulation Resolution
N/A
Comments
ISim defaults to 1ps.
Language Settings
ModelSim XE Property Name
Comments
VHDL Syntax
N/A
N/A
N/A
N/A
198
www.xilinx.com
Miscellaneous Settings
ModelSim XE Property Name
N/A
Configuration Name
N/A
N/A
www.xilinx.com
Comments
199
200
www.xilinx.com
Appendix C
Additional Resources
ISE Hardware Co-Simulation Tutorial: Processing Live Ethernet Traffic through Virtex-5
Embedded Ethernet MAC, (UG819)
www.xilinx.com
201