ModelSim EE/SE Command Reference Version 5.
ModelSim /VHDL, ModelSim /VLOG, ModelSim /LNL, and ModelSim /PLUS are produced by Model Technology Incorporated. Unauthorized copying, duplication, or other reproduction is prohibited without the written consent of Model Technology. The information in this manual is subject to change without notice and does not represent a commitment on the part of Model Technology.
Software License Agreement This is a legal agreement between you, the end user, and Model Technology Incorporated (MTI). By opening the sealed package you are agreeing to be bound by the terms of this agreement. If you do not agree to the terms of this agreement, promptly return the unopened package and all accompanying items to the place you obtained them for a full refund. Model Technology Software License 1. LICENSE.
from MTI. All copies of the SOFTWARE, whether provided by MTI or made by you, shall remain the property of MTI or its licensors. You will maintain a record of the number and location of all copies of the SOFTWARE made, including copes that have been merged with other software, and will make those records available to MTI or its applicable licensor upon request. 5. TRADE SECRET. The source code of the SOFTWARE is trade secret or confidential information of MTI or its licensors.
Limited Warranty LIMITED WARRANTY. MTI warrants that the SOFTWARE will perform substantially in accordance with the accompanying written materials for a period of 30 days from the date of receipt. Any implied warranties on the SOFTWARE are limited to 30 days. Some states do not allow limitations on duration of an implied warranty, so the above limitation may not apply to you. CUSTOMER REMEDIES.
Table of Contents ModelSim Commands (CR-9) coverage report CR-61 delete CR-62 Command reference table CR-10 describe CR-63 abort CR-19 disablebp CR-64 add button CR-20 disable_menu CR-65 add list CR-22 disable_menuitem CR-66 add_menu CR-26 do CR-67 add_menucb CR-28 down | up CR-70 add_menuitem CR-30 drivers CR-73 add_separator CR-31 dumplog64 CR-74 add_submenu CR-32 echo CR-75 add wave CR-33 edit CR-76 alias CR-37 enablebp CR-77 batch_mode CR-38 enable_menu CR-78 bd CR-39 enable_m
nolog CR-102 run CR-139 notepad CR-104 search and next CR-141 nowhen CR-105 searchLog CR-144 onbreak CR-106 seetime CR-146 onElabError CR-107 shift CR-147 onerror CR-108 show CR-148 pause CR-109 splitio CR-149 play CR-110 status CR-150 power add CR-111 step CR-151 power report CR-112 stop CR-152 power reset CR-113 tb CR-153 printenv CR-114 toggle add CR-154 profile clear CR-115 toggle reset CR-155 profile interval CR-116 toggle report CR-156 profile off CR-117 transcribe CR-157
virtual expand CR-183 write list CR-232 virtual function CR-184 write preferences CR-233 virtual hide|nohide CR-188 write report CR-234 virtual log|nolog CR-189 write transcript CR-235 virtual region CR-190 write tssi CR-236 virtual save CR-191 write wave CR-238 virtual show|count CR-192 virtual signal CR-193 virtual type CR-196 vlib CR-198 vlog CR-199 Command Syntax and Conventions (CR-241) Syntax conventions CR-242 vmake CR-205 Comments in argument files loaded with -f CR-242 vm
C R ModelSim Commands Chapter contents Command reference table . . . . . . . . . . . . . . . . . 10 ModelSim Commands . . . . . . . . . . . . . . . . . . 19 The simulator commands used to control the ModelSim simulator are described in this chapter. These commands are only valid after loading a design with the vsim command (CR-208) or via the ModelSim graphical interface. The commands here are entered either in macro files or on the command line of the Main window.
Command reference table Command reference table The following table provides a brief description of each ModelSim command. Command details, arguments and examples can be found at the page numbers given in the Command name column. Command name Action .main clear (CR-99) clears the Main window (10-158) transcript .wave.tree zoomfull (CR-221) redraws the display to show the entire simulation from time 0 to the current simulation time .wave.
Command reference table Command name Action batch_mode (CR-38) returns a 1 if VSIM is operating in batch mode, otherwise returns a 0 bd (CR-39) deletes a breakpoint bp (CR-40) sets a breakpoint cd (CR-42) changes the VSIM local directory to the specified directory change (CR-43) modifies the value of a VHDL variable or Verilog register variable change_menu_cmd (CR-44) changes the command to be executed for a specified menu item label, in the specified menu, in the specified window check conte
Command reference table Command name Action disable_menu (CR-65) disables the specified menu within the specified window disable_menuitem (CR-66) disables a specified menu item within the specified menu_path of the specified window disablebp (CR-64) temporarily turns off all existing breakpoints do (CR-67) executes commands contained in a macro file down | up (CR-70) searches for signal transitions or values in the specified List window drivers (CR-73) displays in the Main window the current v
Command reference table Command name Action log (CR-93) creates a logfile containing simulation data for all HDL items whose names match the provided specifications lshift (CR-95) takes a Tcl list as argument and shifts it in-place one place to the left, eliminating the 0th element lsublist (CR-96) returns a sublist of the specified Tcl list that matches the specified Tcl glob pattern macro_option (CR-97) controls the speed and delay of macro (DO file) playback, plus the level of debugging feedbac
Command reference table Command name Action power reset (CR-113) selectively resets power information to zero for the signals or nets specified with the power add command (CR-111) printenv (CR-114) echoes to the Transcript window the current names and values of all environment variables profile clear (CR-115) clear any data that has been gathered during previous run commands profile interval (CR-116) select the frequency with which the profiler collects samples during a run command profile off (C
Command reference table Command name Action restore (CR-134) restores the state of a simulation that was saved with a checkpoint command (CR-53) during the current invocation of VSIM resume (CR-135) resume execution of a macro file after a pause command (CR-109), or a breakpoint right | left (CR-136) searches right (next) or left (previous) for signal transitions or values in the specified Wave window run (CR-139) advances the simulation by the specified number of timesteps search and next (CR-14
Command reference table Command name Action transcribe (CR-157) displays a command in the Main window, then executes the command transcript (CR-158) controls echoing of commands executed in a macro file; also works at top level in batch mode tssi2mti (CR-159) converts a vector file in Summit Design Standard Events Format into a sequence of VSIM force (CR-87) and run (CR-139) commands vcd add (CR-160) adds the specified items to the VCD file vcd checkpoint (CR-161) dumps the current values of all
Command reference table Command name Action virtual function (CR-184) creates a new signal that consists of logical operations on existing signals and simulation time virtual hide|nohide (CR-188) hide sets a flag in the specified real or virtual signals so that the signals do not appear in the Signals window; nohide resets the flag virtual log|nolog (CR-189) log causes the sim-mode dependent signals of the specified virtual signals to be logged by the kernel; nolog causes the specified virtual signa
Command reference table Command name Action write format (CR-231) records the names and display options of the HDL items currently being displayed in the List or Wave window write list (CR-232) records the contents of the most recently opened, or specified List window in a list output file write preferences (CR-233) saves the current GUI preference settings to a Tcl preference file write report (CR-234) prints a summary of the design being simulated write transcript (CR-235) writes the contents
abort ModelSim Commands abort The abort command halts the execution of a macro file interrupted by a breakpoint or error. When macros are nested, you may choose to abort the last macro only, abort a specified number of nesting levels, or abort all macros. The abort command may be used within a macro to return early. Syntax abort [ | all] Arguments None. | all An integer giving the number of nested macro levels to abort; all aborts all levels. Optional. Default is 1.
add button add button The add button command adds a user-defined button to the Main window button bar. New buttons are added to the right end of the bar. You can also add buttons with a ModelSim tool: "The Button Adder" (10-265). Returns the path name of the button widget created. Syntax add button [Disable | NoDisable] [{option value ...}] Arguments The label to appear on the face of the button. Required.
add button Note: Because the arguments are positional, a Disable | NoDisable option must be specified in order to use the options argument. Examples add button pwd {transcribe pwd} NoDisable Creates a button labeled "pwd" that invokes the transcribe command (CR-157) with the pwd Tcl command, and echoes the command and its results to the Main window. The button remains active during a run. The pwd button example is available in the following DO file: / modeltech/examples/ addbutton.do.
add list add list The add list command lists VHDL variables, and Verilog nets and registers, and their values in the List window. If no port mode is specified, all interface items and internal items are listed. Without arguments, the command displays the List window. The add list command also allows specification of user-defined buses.
add list -in For use with wild card searches. Specifies that the scope of the search is to include ports of mode IN if they match the item_name specification. Optional. -out For use with wild card searches. Specifies that the scope of the search is to include ports of mode OUT if they match the item_name specification. Optional. -inout For use with wild card searches. Specifies that the scope of the search is to include ports of mode INOUT if they match the item_name specification. Optional.
add list -label Specifies an alternative signal name to be displayed as a column heading in the listing. Optional. This alternative name is not valid in a force (CR-87) or examine (CR-81) command, however. It can optionally be used in a search and next command (CR-141) with the list option. Specifies the name of the item to be listed. Optional. Wildcard characters are allowed. Variables may be added if preceded by the process name.
add list add list -hex {mybus {msb opcode(8 downto 1) data}} Creates a user-defined bus named "mybus" consisting of three signals; the bus is displayed in hex. add list vec1 -hex vec2 -dec vec3 vec4 Lists the item vec1 using symbolic values, lists vec2 in hexadecimal, and lists vec3 and vec4 in decimal.
add_menu add_menu The add_menu command adds a menu to the menu bar of the specified window, using the specified menu name. The menu may be justified to the left or right side of the menu bar. Use the add_menuitem (CR-30), add_separator (CR-31), add_menucb (CR-28), and add_submenu (CR-32) commands to complete the menu. Returns the full Tk pathname of the new menu. Color and other Tk properties of the menu may be changed, after creating the menu, using the Tk menu widget configure command.
add_menu global myglobalvar set cmd1 "echo my_own_thing $wname" set cmd2 "echo my_to_upper $wname" set cmd3 "echo my_to_lower $wname" # # add_menu add_menuitem add_separator add_submenu add_menuitem add_menuitem add_submenu add_menucb WindowName ---------$wname $wname $wname $wname $wname $wname $wname $wname Menu MenuItem label Command ----------------------- ------mine 0;# 0th letter (M) is underlined mine "Do My Own Thing..." $cmd1 mine ;#---------------------------mine changeCase mine.
add_menucb add_menucb The add_menucb command creates a checkbox within the specified menu of the specified window. A checkbox is a small box with a label. Clicking on the box will toggle the state, from on to off or the reverse. When the box is "on", the Tcl global variable is set to . When the box is "off", the global variable is set to . Also, if something else changes the global variable, its current state is reflected in the state of the checkbox. Returns nothing.
add_menucb Examples add_menucb $wname mine.vars "Feature One" -variable myglobalvar($wname:one) \ -onvalue 1 -offvalue 0 -indicatoron 1 See also add_menu command (CR-26), add_menuitem command (CR-30), add_separator command (CR-31), add_submenu command (CR-32), and the change_menu_cmd command (CR-44) The add_menucb command is also used as part of the add_menu (CR-26) example.
add_menuitem add_menuitem The add_menuitem command creates a menu item within the specified menu of the specified window. May be used within a submenu. Returns nothing. Syntax add_menuitem [] Arguments Tk path of the window containing the menu. Required. Name of the Tk menu widget plus submenu path. Required. Text to be displayed. Required.
add_separator add_separator The add_separator command adds a separator as the next item in the specified menu path in the specified window. Returns nothing. Syntax add_separator Arguments Tk path of the window containing the menu. Required. Name of the Tk menu widget plus submenu path. Required.
add_submenu add_submenu The add_submenu command creates a cascading submenu within the specified menu_path of the specified window. May be used within a submenu. Returns the full Tk path to the new submenu widget. Syntax add_submenu [] Arguments Tk path of the window containing the menu. Required. Name of the Tk menu widget plus submenu path. Required. Name to be displayed on the submenu. Required.
add wave add wave The add wave command adds VHDL signals, and Verilog nets and registers to the Wave window. It also allows specification of user defined buses. Syntax add wave [-window ] [-expand ] [-expandall ] [-recursive] [-in] [-out] [-inout] [-internal] [-ports] [-] [-] [-height ] [-color ] [-offset ] [-scale ] [-label ] [ | { [-flatten] {sig1 sig2 sig3 ...}}] ...] ...
add wave -inout For use with wild card searches. Specifies that the scope of the search is to include ports of mode INOUT if they match the item_name specification. Optional. -internal For use with wild card searches. Specifies that the scope of the search is to include internal items if they match the item_name specification. Optional. -ports For use with wild card searches. Specifies that the scope of the listing is to include ports of modes IN, OUT, or INOUT. Optional.
add wave -height Specifies the height (in pixels) of the waveform. Optional. -color Specifies the color used to display a waveform. Optional. These are the standard X Window color names, or rgb value (e.g., #357f77); enclose 2-word names (“light blue”) in quotes. -offset Modifies an analog waveform’s position on the display. Optional. The offset value is part of the wave positioning equation (see -scale below). -scale Scales analog waveforms. Optional.
add wave individual elements. Gives greater flexibility in the types of elements that can be combined, but loses the original element names. Without the -flatten option, all items must be either all scalars or all arrays of the same size. With -flatten, specified items may be either scalars or various sized arrays as long as they have the same element enumeration type. Note: You can use the Edit > Combine selection from the "Wave window" (10-212) menu to create a userdefined bus.
alias alias The alias command creates a new Tcl procedure that evaluates the specified commands. Used to create a user-defined alias. Any arguments passed on invocation of the alias will be passed through to the specified commands. Returns nothing. Syntax alias "" Arguments Specifies the new procedure name to be used when invoking the commands. Required. "" Specifies the command or commands to be evaluated when the alias is invoked. Required. Examples alias myquit "write list .
batch_mode batch_mode The batch_mode command returns a 1 if VSIM is operating in batch mode, otherwise returns a 0. It is typically used as a condition in an if statement. Examples Some GUI commands do not exist in batch mode. If you want to write a script that will work in or out of batch mode you can also use the batch_mode command to determine which command to use.
bd bd The bd command deletes a breakpoint. Syntax bd Arguments Specifies the name of the source file in which the breakpoint is to be deleted. Required. The filename must match the one used to previously set the breakpoint, including whether a full pathname or a relative name was used. Specifies the line number of the breakpoint to be deleted. Required. Examples bd alu.vhd 127 Deletes the breakpoint at line 127 in the source file named alu.vhd.
bp bp The bp or breakpoint command sets a breakpoint. If the source file name and line number are omitted, or the -query option is used, this command lists all the breakpoints that are currently set. Otherwise, the command sets a breakpoint in the specified file at the specified line. Once set, the breakpoint affects every instance in the design. Syntax bp [-query ] [] [ [{...}]] Arguments -query Returns a list of the currently set breakpoints.
bp Examples bp Lists all existing breakpoints in the design, together with the source file names and any commands that have been assigned to breakpoints. bp -query testadd.vhd Lists the line number of all breakpoints in testadd.vhd. bp alu.vhd 147 Sets a breakpoint in the source file alu.vhd at line 147. bp alu.vhd 147 {do macro.do} Executes the macro.do macro file after the breakpoint. bp test.vhd 22 {echo [exa var1]; echo [exa var2]} Sets a breakpoint at line 22 of the file test.
cd cd The Tcl cd command changes the VSIM local directory to the specified directory. See the Tcl man pages (Main window: Help > Tcl Man Pages) for any cd command options. Returns nothing. Syntax cd
Description After you change the directory with cd, VSIM continues to write the vsim.wav file in the directory where the first add wave (CR-33), add list (CR-22) or log (CR-93) command was executed.change change The change command modifies the value of a VHDL variable or Verilog register variable. The simulator must be at a breakpoint or paused after a step command (CR-151) to change a VHDL variable. Syntax change Arguments Specifies the name of a variable. Required. The variable name must specify a scalar type or a one-dimensional array of character enumeration.
change_menu_cmd change_menu_cmd The change_menu_cmd command changes the command to be executed for a specified menu item label, in the specified menu, in the specified window. The menu_path and label must already exist for this command to function. Returns nothing. Syntax change_menu_cmd
check contention add check contention add The check contention add command enables contention checking for the specified nodes. The allowed nodes are Verilog nets and VHDL signals of std_logic and std_logic_vector. Any other node types and nodes that don’t have multiple drivers are silently ignored by the command. Syntax check contention add [-r] [-in] [-out] [-inout] [-internal] [-ports] Arguments -r Specifies that contention checking is enabled recursively into subregions.
check contention config check contention config The check contention config command allow you to write checking messages to a file (default displays the message on your screen). You may also configure the contention time limit. Syntax check contention config [-file ] [-time ] Arguments -file Specifies a file to write contention messages to. Optional. If this option is selected, the messages are not displayed to the screen.
check contention off check contention off The check contention off command disables contention checking for the specified nodes. Syntax check contention off [-all] [-r] [-in] [-out] [-inout] [-internal] [-ports] Arguments -all Disables contention checking for all nodes that have checking enabled. Optional. -r Specifies that contention checking is disabled recursively into subregions. Optional; if omitted, contention check disabling is limited to the current region.
check float add check float add The check float add command enables float checking for the specified nodes. The allowed nodes are Verilog nets and VHDL signals of type std_logic and std_logic_vector (other types are silently ignored). Syntax check float add [-r] [-in] [-out] [-inout] [-internal] [-ports] Arguments -r Specifies that float checking is enabled recursively into subregions. Optional; if omitted, float check enabling is limited to the current region.
check float config check float config The check float config command allows you to write checking messages to a file (default displays the message on your screen). You may also configure the float time limit. Syntax check float config [-file ] [-time ] Arguments -file Specifies a file to write float messages to. Optional. If this option is selected, the messages are not displayed to the screen. -time Specifies a time limit that a node may be floating. Optional.
check float off check float off The check float off command disables float checking for the specified nodes. Syntax check float off [-all] [-r] [-in] [-out] [-inout] [-internal] [-ports] Arguments -all Disables float checking for all nodes that have checking enabled. Optional. -r Specifies that float checking is disabled recursively into subregions. Optional; if omitted, float check disabling is limited to the current region. -in Disables checking on nodes of mode IN. Optional.
check stable on check stable on The check stable on command enables stability checking on the entire design. Design stability checking detects when circuit activity has not settled within a user-defined period for synchronous designs. Syntax check stable on [-file ] [-period
check stable off check stable off The check stable off command disables stability checking. You may later enable it with check stable on (CR-51), and meanwhile, the clock cycle numbers and boundaries are still tracked. See the check stable on command (CR-51). Syntax check stable off Arguments None.
checkpoint checkpoint The checkpoint command saves the state of your simulation. The checkpoint command saves the simulation kernel state, the vsim.wav file, the list of the HDL items shown in the List and Wave windows, the file pointer positions for files opened under VHDL and the Verilog $fopen system task, and the states of foreign architectures.
configure configure The configure (config) command invokes the List or Wave widget configure command for the current default List or Wave window. To change the default window, use the view command (CR-180). Returns the values of all attributes if no options, or the value of one attribute when one option and no value.
configure -font Specifies the font used in the widget. Optional. -height Specifies the height in pixels of each row. Optional. Arguments, List window only -delta [all | collapse | none] The all option displays a new line for each time step on which items change, collapse displays the final value for each time unit, and none turns off the display of the delta column. To use -delta, -usesignaltriggers must be set to 1 (on). Optional.
configure Arguments, Wave window only -timecolor Specifies the time axis color; the default is green. Optional. -vectorcolor Specifies the vector waveform color; the default is yellow. Optional. -gridcolor Specifies the background grid color; the default is grey50. Optional.
configure # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #d9dfff } {-bd borderWidth} {-bg background} {-borderwidth borderWidth BorderWidth 2 2} { -cursor cursor Cursor {} {} } {-busycursor busycursor BusyCursor watch watch} {-delta delta Delta all all} { -timeunits timeunits TimeUnits {} ns } {-fastload fastload FastLoad 0 0} {-fastscroll fastscroll FastScroll 0 0} {-foreground foreground Foreground black Black} {-fg foreground} {-fixwidth fixwidth Width
configure # { # -yscrollcommand yscrollcommand Command {} {.list.yscroll set} # } # } VSIM 47> Examples config list -strobeperiod Displays the current value of the strobeperiod attribute. config list -strobeperiod {50 ns} -strobestart 0 -usestrobe 1 Sets the strobe waveform and turns it on. config wave -vectorcolor blue Sets the wave vector color to blue.
coverage clear coverage clear The coverage clear command is used to clear all coverage data obtained during previous run commands. After this command is executed all line number execution count data will be reset. Syntax coverage clear Arguments None.
coverage reload coverage reload The coverage reload command is used to seed the coverage statistics with the output of a previous coverage report command. This allows you (for example) to gather statistics from multiple simulation runs into a single report. Syntax coverage reload [ -keep ] Arguments Specifies the file containing data to reload. Required. This file should be the output of a previous COVERAGE REPORT -lines command.
coverage report coverage report The coverage report command is used to produce a textual output of the coverage statistics that have been gathered up to this point. (The View > Other > Source Coverage menu pick allows you to view this data more interactively.) Syntax coverage report [ -file ] [ -lines ] Arguments -file Specifies a file name for the report. Optional. Default is to write report to the Transcript Window.
delete delete The delete command removes HDL items from either the List or Wave window. Syntax delete list | wave [-window ] Arguments list | wave Specifies the target window for the delete command. Required. -window Specifies the name of the List or Wave window to target for the delete command (the view command (CR-180) allows you to create more than one List or Wave window). Optional.
describe describe The describe command displays information about the specified HDL item. The description is displayed in the Main window (10-158). The following kinds of items can be described: • VHDL signals, variables, and constants • Verilog nets and registers All but VHDL variables and constants may be specified as hierarchical names.
disablebp disablebp The disablebp command temporarily turns off all existing breakpoints. To turn the breakpoints back on again, use the enablebp command (CR-77). Syntax disablebp Arguments None.
disable_menu disable_menu The disable_menu command disables the specified menu within the specified window. The disabled menu will become grayed-out, and nonresponsive. Returns nothing. Syntax disable_menu Arguments Tk path of the window containing the menu. Required. Note that the path for the Main window may be expressed as main or "". All other window pathnames begin with a period (.) as shown in the example below. Name of the Tk menu-widget path.
disable_menuitem disable_menuitem The disable_menuitem command disables a specified menu item within the specified menu_path of the specified window. The menu item will become grayed-out, and nonresponsive. Returns nothing. Syntax disable_menuitem
do do The do command executes commands contained in a macro file. A macro file can have any name and extension. An error encountered during the execution of a macro file causes its execution to be interrupted, unless an onerror command (CR108), or onbreak command (CR-106) has specified the resume command (CR-135). Syntax do [] Arguments Specifies the name of the macro file to be executed. Required. The name can be a pathname or a relative file name.
do Using other VSIM commands with macros If you are executing a macro (DO file) when your simulation hits a breakpoint or causes a run-time error, VSIM interrupts the macro and returns control to the command line, where the following commands may be useful. (Any other legal command may be executed as well.
do See also VSIM can search for DO files based on the path list specified by the DOPATH (B391). A DO file can also be called by modelsim.ini at startup, see "Using a startup file" (B-404). The Main transcript can be saved as a macro, see the write transcript command (CR-235).
down | up down | up The down | up command searches for signal transitions or values in the specified List window. It executes the search on signals currently selected in the window, starting at the time of the active cursor. A condition to search for may also be identified by an expression using the -expr command option. The active cursor moves to the found location.
down | up -value Specify a value of the signal to match. Optional. Must be specified in the same radix that the selected signal is displayed. Case is ignored, but otherwise must be an exact string match -- don’t-care bits are not yet implemented. -window Use this option to specify an instance of the List window that is not the default. Optional. Otherwise, the default List window is used. Use the view command (CR180) to change the default window. Specifies to find the nth match.
down | up 23 and 54 microseconds, and clock just changed from low to high and signal mode is enumeration writing.
drivers drivers The drivers command displays in the Main window the current value and scheduled future values for all the drivers of a specified VHDL signal or Verilog net. The driver list is expressed relative to the top most design signal/net connected to the specified signal/net. If the signal/net is a record or array, each sub-element is displayed individually. This command reveals the operation of transport and inertial delays and assists in debugging models.
dumplog64 dumplog64 The dumplog64 command dumps the contents of the vsim.wav file in a readable format. Syntax dumplog64 Arguments The name of the dump file created. Required.
echo echo The echo command displays a specified message in the Main window. Syntax echo Arguments Specifies the message text to be displayed. Required. If the text string is surrounded by quotes, blank spaces are displayed as entered. If quotes are omitted, two or more adjacent blank spaces are compressed into one space. Examples echo “The time is $now ns.” If the current time is 1000 ns, this command produces the message: The time is 1000 ns.
edit edit The edit command invokes the editor specified by the EDITOR environment variable. Syntax edit [] Arguments Specifies the name of the file to edit. Optional. If the is omitted, the editor opens the current source file.
enablebp enablebp The enablebp command turns on all breakpoints turned off by the disablebp command (CR-64). Syntax enablebp Arguments None.
enable_menu enable_menu The enable_menu command enables a previously-disabled menu. The menu will be changed from grayed-out to normal, and will become responsive. Returns nothing. Syntax enable_menu Arguments Tk path of the window containing the menu. Required. Note that the path for the Main window may be expressed as main or "". All other window pathnames begin with a period (.) as shown in the example below. Name of the Tk menu-widget path.
enable_menuitem enable_menuitem The enable_menuitem command enables a previously-disabled menu item. The menu item will be changed from grayed-out to normal, and will become responsive. Returns nothing. Syntax enable_menuitem Arguments Tk path of the window containing the menu. Required. Note that the path for the Main window may be expressed as main or "". All other window pathnames begin with a period (.) as shown in the example below.
environment The environment, or env command, allows you to display or change the current region/signal environment. Syntax environment [-dataset] [-nodataset] [] Arguments -dataset Displays the specified environment pathname with a dataset prefix. Optional. Dataset prefixes are displayed by default if more than one dataset is open during a simulation session. -nodataset Displays the specified environment pathname without a dataset prefix. Optional.
examine examine The examine, or exa command, examines one or more HDL items, and displays current values (or the values at a specified previous time) in the Main window (10158). It optionally can compute the value of an expression of one or more items.
examine -delta Specifies a simulation cycle at the specified time from which to fetch the value. The default is to use the last delta of the time step. Optional. -env Specifies a path to look for signal name. Optional. -expr An expression to be evaluated. Optional. If the -time argument is present, the expression will be evaluated at the specified time, otherwise it will be evaluated at the current simulation time.
examine exa line__36/i Examples examine -time {3450 us} -expr {/top/bus and $bit_mask} In this example the -expr option specifies a signal path from the List window and userdefined Tcl variable. The expression will be evaluated at 3450us. examine -expr {clk’event && (/top/xyz == 16’hffae)} Because -time is not specified, this expression will be evaluated at the current simulation time. Note the signal attribute and array constant specified in the expression.
exit exit The exit command exits the simulator and the ModelSim application. Syntax exit [-force] Argument -force Quits without asking for confirmation. Optional; if this argument is omitted, ModelSim asks you for confirmation before exiting. Note: If you want to stop the simulation using a when command (CR-226), you must use a stop command within your when statement. DO NOT use an exit commad or a quit command (CR-128). The stop command acts like a breakpoint at the time it is evaluated.
find find The find command displays the full pathnames of all HDL items in the design whose names match the name specification you provide. If no port mode is specified, all interface items and internal items are found (that is, all items of modes IN, OUT, INOUT, and INTERNAL). Syntax find [-recursive] [-in] [-out] [-inout] [-internal] [-ports] ... Arguments -recursive Specifies that the scope of the search is to descend recursively into subregions.
find Examples find -r /* Finds all items in the entire design. find * Displays the names of all items in the current region. Additional search options To search for HDL items within a specific display window, use the search and next (CR-141) or the menu sequence: Edit > Find ....
force force The force command allows you to apply stimulus to VHDL signals and Verilog nets interactively. Since force commands (like all VSIM commands) can be included in a macro file, it is possible to create complex sequences of stimuli. Forcing of Virtual signals (9-145) is supported if the number of bits correspond to the signal value; forcing of virtual functions is not supported.
force -repeat Repeats the force command, where is the amount of time of the repeat period. A repeating force command will force a value before other non-repeating force commands that occur in the same time step. Optional. Specifies the name of the HDL item to be forced. Required. A wildcard is permitted only if it matches one item. See "HDL item pathnames" (CR-245) for the full syntax of an item name.
force If the time units are not specified, then the default is the resolution units selected at simulation start-up. Optional. A zero-delay force command causes the change to occur in the current (rather than the next) simulation delta cycle. Examples force input1 0 Forces input1 to 0 at the current simulator time. force bus1 01XZ 100 ns Forces bus1 to 01XZ at 100 nanoseconds after the current simulator time.
getactivecursortime getactivecursortime The getactivecursortime command gets the time of the active cursor in the Wave window. Returns the time value. Syntax getactivecursortime [-window ] Arguments -window Use this option to specify an instance of the Wave window that is not the default. Otherwise, the default Wave window is used. Optional. Use the view command (CR-180) to change the default window.
getactivemarkertime getactivemarkertime The getactivemarkertime command gets the time of the active marker in the List window. Returns the time value. If -delta is specified, returns time and delta. Syntax getactivemarkertime [-window ] [-delta] Arguments -window Use this option to specify an instance of the List window that is not the default. Otherwise, the default List window is used. Optional. Use the view command (CR180) to change the default window.
lecho lecho The lecho command takes one or more Tcl lists as arguments and pretty-prints them to the Transcript window. Returns nothing. Syntax lecho ... Arguments ... Any Tcl list created by a VSIM command or user procedure. Examples lecho [configure wave] Prints the Wave window configuration list to the Transcript window.
log log The log command creates a logfile containing simulation data for all HDL items whose names match the provided specifications. Items (VHDL variables, and Verilog nets and registers) that are displayed using the add list (CR-22) and add wave (CR-33) commands are automatically recorded in the logfile. If no port mode is specified, the logfile contains data for all items in the selected region whose names match the item name specification.
log -howmany Returns an integer indicating the number of signals found. Optional. Specifies the item name which you want to log. Required. Multiple item names may be specified. Wildcard characters are allowed. Examples log -r /* Logs all items in the design. log -out * Logs all output ports in the current design unit.
lshift lshift The lshift command takes a Tcl list as argument and shifts it in-place one place to the left, eliminating the 0th element. The number of shift places may also be specified. Returns nothing. Syntax lshift [] Arguments Specifies the Tcl list to target with lshift. Required. Specifies more than one place to shift. Optional. Default is 1. Examples proc myfunc args { # throws away the first two arguments lshift args 2 ...
lsublist lsublist The lsublist command returns a sublist of the specified Tcl list that matches the specified Tcl glob pattern. Syntax lsublist Arguments Specifies the Tcl list to target with lsublist. Required. Specifies the pattern to match within the using Tcl glob-style matching. Required. Examples In the example below, variable ‘t’ returns "structure signals source".
macro_option macro_option This command is available for UNIX only. The macro_option command controls the speed and delay of macro (DO file) playback, plus the level of debugging feedback. If invoked without any options macro_option returns all current settings; returns a specific setting if invoked with an option and no argument. Syntax macro_option [speed fast | demo] | [delay ] | [debug ] Arguments speed fast | demo Set the macro playback speed to fast or demo. Optional.
modelsim modelsim The modelsim command starts the ModelSim GUI without prompting you to load a design. This command is valid only for Windows platforms, and may be invoked in one of three ways: from the DOS prompt from a ModelSim shortcut from the Windows Start > Run menu To use modelsim arguments with a shortcut, add them to the target line of the shortcut’s properties. (Arguments work on the DOS command line too, of course.
.main clear .main clear The .main clear command clears the Main window (10-158) transcript. The behavior is the same as the Main window File > Clear Transcript menu selection. Syntax .main clear Arguments None.
next next See "search and next" (CR-141) for information on the next command.
noforce noforce The noforce command removes the effect of any active force (CR-87) commands on the selected HDL items. The noforce command also causes the item’s value to be re-evaluated. Syntax noforce ... Arguments Specifies the name of a item. Required. Must match the item name used in the force command (CR-87). Multiple item names may be specified. Wildcard characters are allowed.
nolog nolog The nolog command suspends writing of data to the logfile for the specified signals. A flag is written into the logfile for each signal turned off, and the gui displays question marks for the signal until logging (for the signal) is turned back on. Logging can be turned back on by issuing another log command (CR-93) or by doing a nolog -reset.
nolog -internal Specifies that the logfile is to exclude data for internal items whose names match the specification. Optional. -howmany Returns an integer indicating the number of signals found. Optional. Specifies the item name which you want to unlog. Required. Multiple item names may be specified. Wildcard characters are allowed. Examples nolog -r /* Unlogs all items in the design. nolog -out * Unlogs all output ports in the current design unit.
notepad notepad The notepad command is a simple text editor. It may be used to view and edit ascii files or create new files. When a file is specified on the command line, the editor will initially come up in read-only mode. This mode can be changed from the Notepad Edit menu. See "Editing the command line, the current source file, and notepads" (10-167) for a list of editing shortcuts. Returns nothing. Syntax notepad [-r | -edit] Arguments Name of the file to be displayed.
nowhen nowhen The nowhen command deactivates selected when (CR-226) commands. Syntax nowhen [] Arguments Used to identify individual when commands. Optional. Examples when -label 99 b {echo “b changed”} … nowhen 99 This nowhen command deactivates the when (CR-226) command labeled 99. nowhen * This nowhen command deactivates all when (CR-226) commands.
onbreak onbreak The onbreak command is used within a macro; it specifies a command to be executed when running a macro that encounters a breakpoint in the source code. Using the onbreak command without arguments will return the current onbreak command string. Use an empty string to change the onbreak command back to its default behavior (i.e., onbreak ""). In that case, the macro will be interrupted after a breakpoint occurs (after any associated bp command (CR-40) string is executed).
onElabError onElabError The onElabError command specifies one or more commands to be executed when an error is encountered during elaboration. The command is used by placing it within the modelsim.tcl file or a macro. During initial design load onElabError may be invoked from within the modelsim.tcl file; during a simulation restart onElabError may be invoked from a macro. Use the onElabError command without arguments to return to a prompt. Syntax onElabError {[ [; ] ...
onerror onerror The onerror command is used within a macro; it specifies one or more commands to be executed when a running macro encounters an error. Using the onerror command without arguments will return the current onerror command string. Use an empty string to change the onerror command back to its default behavior (i.e., onbreak ""). Use onerror with a resume command (CR-135) to allow an error message to be printed without halting the execution of the macro file.
pause pause The pause command placed within a macro interrupts the execution of that macro. Syntax pause Arguments None. Description When you execute a macro and that macro gets interrupted, the prompt will change to: VSIM (pause)7> This “pause” prompt reminds you that a macro has been interrupted. When a macro is paused, you may invoke another macro, and if that one gets interrupted, you may even invoke another — up to a nesting level of 50 macros.
play play This command is available for UNIX only. The play command replays a sequence of keyboard and mouse actions, which were previously saved to a file with the record command (CR-130). Returns nothing. Note: Play returns immediately; the playback proceeds in the background. Caution must be used when putting play commands in do (macro) files. Syntax play Arguments Specifies the recorded file to replay. Required.
power add power add The power add command is used prior to the power report command (CR-112). Data produced by these commands can be translated (by a Synopsys utility) to drive the Synopsys power analysis tools. This command specifies the signals or nets to track for power information. Returns nothing. Syntax power add [-in] [-out] [-internal] [-internal] [-r] ... Arguments -in Select only inputs. Optional. -out Select only outputs. Optional.
power report power report The power report command is used subsequent to the power add command (CR111). Data produced by these commands can be translated (by a Synopsys utility) to drive the Synopsys power analysis tools. This command writes out the power information for the specified signals or nets. The report can be written to a file or to the Transcript window. Returns nothing. Syntax power report [-all] [-noheader] [-file ] Arguments -all Writes information on all items logged. Optional.
power reset power reset The power reset command selectively resets power information to zero for the signals or nets specified with the power add command (CR-111). Returns nothing. Syntax power reset [-in] [-out] [-internal] [-internal] [-r] ... Arguments -in Reset only inputs. Optional. -out Reset only outputs. Optional. -internal Reset only design internal signals or nets. Optional. -ports Reset only design ports. Optional. -r Do the wildcard search recursively. Optional.
printenv printenv The printenv command echoes to the Transcript window the current names and values of all environment variables. If variable names are given as arguments, prints only the names and values of the specified variables. Returns nothing. All results go to the Transcript window. Syntax printenv [...] Arguments ... Specifies the name(s) of the environment variable to print. Optional.
profile clear profile clear The profile clear command is used to clear any data that has been gathered during previous run commands. After this command is executed, all profiling data will be reset. This command has no effect on the current profiling session. The last profile on or profile off command will still be in effect.
profile interval profile interval The profile interval command allows you to select the frequency with which the profiler collects samples during a run command. Syntax profile interval [sample-frequency] Arguments sample-frequency An integer value from 1 to 999 that represents how many milliseconds to wait between each sample collected during a profiled simulation run. Default is 10 ms. If the sample-frequency is not supplied, the profile interval command returns the current sample frequency.
profile off profile off The profile off command is used to discontinue runtime profiling.
profile on The profile on command is used to enable runtime analysis of where your simulation is spending its time. After this command is executed, every subsequent run command will be profiled.
profile option profile option The profile option command allows various profiling options to be changed. Syntax profile option [collapse_sections] [raw_data] Arguments collapse_sections By default all profiling data is reported on a per line basis. This option allows you to group the data by section. A section consists of regions of code such as VHDL processes, functions or Verilog always blocks. By specifying this option the current setting is toggled. The default is to not collapse sections.
profile report profile report The profile report command is used to produce a textual output of the profiling statistics that have been gathered up to this point. (The View > Other > Hierarchical Profile and View > Other > Ranked Profile menu picks allow you to view this data more interactively.) Syntax profile report [ -hierarchical | -ranked ] [ -file ] [ -cutoff ] Arguments -hierarchical Report a hierarchical listing (Default). Optional. -ranked Report a ranked listing.
project project The project command is used to perform common operations on new projects. The command is to be used outside of a simulation session. Syntax project [history] [compile] [close] [env] [save] [copy ] [new ] [delete [-force]] [open ] Arguments history Lists a history of manipulated projects. new Creates a new project under a specified home directory with a specified name.
project Examples The following commands make a copy of /user/georges/design/test3 project at / user/georges/design/test4. vsim> project history # 0 /user/george/design/test3/test3.mpf # 1 /user/george/design/test2/test2.mpf # 2 /user/george/design/test1/test1.mpf # 3 /home/prod/release/5.3/modeltech/examples/projects/mixed/mixed.mpf # 4 /home/prod/release/5.3/modeltech/examples/projects/verilog/verilog.mpf # 5 /home/prod/release/5.3/modeltech/examples/projects/vhdl/vhdl.
property list property list The property list command changes one or more properties of the specified signal, net or register in the List window (10-174). The properties correspond to those than can be specified using the List window Prop > Display Props menu selection. At least one argument must be used.
property wave property wave The property wave command changes one or more properties of the specified signal, net or register in the Wave window (10-212). The properties correspond to those than can be specified using the Wave window Prop > Display Props menu selection. At least one argument must be used.
property wave -radix The can be expressed as: Symbolic, Bin, Oct, Dec or Hex. Choosing symbolic means that item values are not translated. Optional. -scale Specifies the waveform scale relative to the unscaled size value of 1. Valid only when -format is specified as analog. Optional. Specifies a name or wildcard pattern to match the full path names of the signals, nets or registers for which you are defining the property change. Required.
pwd pwd The Tcl pwd command displays the current directory path in the Main transcript window. Returns nothing. Syntax pwd Arguments None.
quietly quietly The quietly command turns off transcript echoing for the specified command. Syntax quietly Arguments Specifies the command for which to disable transcript echoing. Required. Any results normally echoed by the specified command will not be written to the Main window transcript. To disable echoing for all commands use the transcript command (CR-158) with the -quietly option.
quit quit The quit command exits the simulator. Syntax quit [-f or -force] [-sim] Arguments -f or -force Quits without asking for confirmation. Optional; if this argument is omitted, VSIM asks you for confirmation before exiting. (The -f and -force arguments are equivalent.) -sim Unloads the current design in the simulator without exiting ModelSim. All files opened by the simulation will be closed including the logfile (vsim.wav).
radix radix The radix command specifies the default radix to be used. The command can be used at any time. The specified radix is used for all commands (force (CR-87), examine (CR-81), change (CR-43), etc.) as well as for displayed values in the Signals, Variables, Dataflow, List, and Wave windows. Syntax radix [-symbolic | -binary | -octal | -decimal | -hexadecimal | -unsigned | -ascii] Arguments Entries may be truncated to any length, for example, -symbolic could be expressed as -s or -sy, etc.
record record This command is available for UNIX only. The record command starts recording a replayable trace of all keyboard and mouse actions. Record and play operations may also be run from the macro-helper menu item of the macro menu. Returns nothing. Syntax record [] Arguments Specifies the file for the saved recording. If is not specified, the recording terminates.
report report The report command displays the value of all simulator control variables, or the value of any simulator state variables relevant to the current simulation. Syntax report simulator control | simulator state Arguments simulator control Displays the current values for all simulator control variables. simulator state Displays the simulator state variables relevant to the current simulation. Examples report simulator control Displays all simulator control variables.
report report simulator state Displays all simulator state variables. Only the variables that relate to the design being simulated are displayed: # now = 0.0 # delta = 0 # library = work # entity = type_clocks # architecture = full # resolution = 1ns Viewing preference variables Preference variables have more to do with the way things look (but not entirely) rather then controlling the simulator. You can view preference variables from the Preferences dialog box.
restart restart The restart command reloads the design elements and resets the simulation time to zero. Only design elements that have changed are reloaded. Syntax restart [-force] [-nobreakpoint] [-nolist] [-nolog] [-nowave] Arguments -force Specifies that the simulation will be restarted without requiring confirmation in a popup window. Optional (unless being used in a macro file). -nobreakpoint Specifies that all breakpoints will be removed when the simulation is restarted. Optional.
restore restore The restore command restores the state of a simulation that was saved with a checkpoint command (CR-53) during the current invocation of VSIM (called a "warm restore"). The items restored are: simulation kernel state, vsim.wav file, HDL items listed in the List and Wave windows, file pointer positions for files opened under VHDL and under Verilog $fopen, and the saved state of foreign architectures. If you want to restore while running VSIM, use this command.
resume resume The resume command is used to resume execution of a macro file after a pause command (CR-109), or a breakpoint. It may be input manually or placed in an onbreak (CR-106) command string. (Placing a resume command in a bp (CR-40) command string does not have this effect.) The resume command can also be used in an onerror (CR-108) command string to allow an error message to be printed without halting the execution of the macro file. Syntax resume Arguments None.
right | left right | left The right | left command searches right (next) or left (previous) for signal transitions or values in the specified Wave window. It executes the search on signals currently selected in the window, starting at the time of the active cursor. A condition to search for may also be identified by an expression using the -expr command option. The active cursor moves to the found location.
right | left -rising Searches for a rising edge on the specified signal if that signal is a scalar signal. If it is not a scalar signal, the option will be ignored. Optional. -value Specify a value of the signal to match. Must be specified in the same radix that the selected waveform is displayed. Case is ignored, but otherwise must be an exact string match -- don’t-care bits are not yet implemented. Only one signal may be selected, but that signal may be an array. Optional.
right | left right -expr {((NOW > 23 us) && (NOW < 54 us)) && clk’rising && (mode == writing)} Searches right for an expression that evaluates to a boolean 1 when logfile time is between 23 and 54 microseconds, and clock just changed from low to high and signal mode is enumeration writing. Note: Wave window keyboard shortcuts (10-237) are also available for next and previous edge searches. Tab searches right (next) and shift-tab searches left (previous).
run run The run command advances the simulation by the specified number of timesteps. Syntax run [ []]| -all | -continue | -next | -step | -stepover] Arguments [] Specifies the number of timesteps for the simulation to run. The number may be fractional. Optional.
run Examples run 1000 Advances the simulator 1000 timesteps. run 10.4 ms Advances the simulator the appropriate number of timesteps corresponding to 10.4 milliseconds. run @8000 Advances the simulator to timestep 8000.
search and next search and next The search and next commands search the specified window for one or more items matching the specified pattern(s). The search starts at the item currently selected, if any; otherwise starts at the window top. Default action is to search downward until the first match, then move the selection to the item found, and return the index of the item found. The search can be continued using the next command. Returns the index of a single match, or list of matching indices.
search and next -field Selects different fields to test, depending on the window type: Window n=1 n=2 n=3 default structure instance ent/mod [arch] instance signals name - cur. value name process status label fullpath fullpath variables name - cur. value name wave name - cur. value name list label fullname - label Default behavior for the List window is to attempt to match the label and if that fails, try to match the full signal name.
search and next Description With the -all option, the entire window is searched, the last item matching the pattern is selected, and a Tcl list of all corresponding indices is returned. With the -toggle option, items found are selected in addition to the current selection. For the List window, the search is done on the names of the items listed, that is, across the header. To search for values of signals in the List window, use the down | up command (CR-70).
searchLog searchLog The searchLog command searches one or more of the currently open logfiles for a specified condition. It can be used to search for rising or falling edges, for signals equal to a specified value, or for when a generalized expression becomes true.
searchLog -count Specifies to search for the -th occurrence of the match condition, where is a positive integer. Optional. -startDelta Indicates a simulation delta cycle on which to start. Optional. -env Provides a design region to look for the signal names. Optional. Specifies the simulation time at which to start the search. Required.
seetime seetime The seetime command scrolls the List or Wave window to make the specified time visible. For the List window, a delta can be optionally specified as well. Returns: nothing Syntax seetime list|wave [-window ] [-select] [-delta ] Arguments list|wave Specifies the target window type. Required. -window Use this option to specify an instance of the Wave or List window that is not the default. Optional. Otherwise, the default wave or List window is used.
shift shift The shift command shifts macro parameter values down one place, so that the value of parameter $2 is assigned to parameter $1, the value of parameter $3 is assigned to $2, etc. The previous value of $1 is discarded. The shift command and macro parameters are used in macro files. If a macro file requires more than nine parameters, they can accessed using the shift command. To determine the current number of macro parameters, use the argc (B-420). Syntax shift Arguments None.
show show The show command lists HDL items and subregions visible from the current environment. The items listed include: • VHDL signals, and instances • Verilog nets, registers, tasks, functions, instances and memories The show command returns its results as a formatted Tcl string; to eliminate formatting, use the Show command. Syntax show [-all] [] Arguments -all Display all names at and below the specified path recursively. Optional.
splitio splitio The splitio command operates on a VHDL inout or out port to create a new signal having the same name as the port suffixed with "__o". The new signal mirrors the output driving contribution of the port. Syntax splitio [-outalso | -outonly] [-r] ... Arguments -outalso Allows splitio to work on out ports as well as inout ports. Optional. -outonly Allows splitio to work only on out ports. Optional. -r Specifies that the port selection occurs recursively into subregions.
status status The status command lists all current interrupted macros. The listing shows the name of the interrupted macro, the line number at which it was interrupted, and prints the command itself. It also displays any onbreak (CR-106) or onerror (CR108) commands that have been defined for each interrupted macro. Syntax status Arguments None. Examples The transcript below contains examples of resume (CR-135), and status commands. VSIM (pause) 4> status # Macro resume_test.
step step The step command steps to the next HDL statement. Current values of local variables may be observed at this time using the variables window. VHDL procedures, functions and Verilog tasks can optionally be skipped over. When a wait statement or end of process is encountered, time advances to the next scheduled activity. The Process and Source windows will then be updated to reflect the next activity.
stop stop The stop command is used with the when command (CR-226) to stop simulation in batch files. The stop command has the same effect as hitting a breakpoint. The stop command may be placed anywhere within the body of the when command. Syntax stop Arguments None. Note: Use the run command (CR-139) with the -continue option to continue the simulation run, or the resume command (CR-135) to continue macro execution.
tb tb The tb (traceback) command displays a stack trace for the current process in the Main transcript window. This lists the sequence of HDL function calls that have been entered to arrive at the current state for the active process. Syntax tb Arguments None.
toggle add toggle add The toggle add command enables collection of toggle statistics for the specified nodes. The allowed nodes are Verilog nets and VHDL signals of type bit, bit_vector, std_logic, and std_logic_vector (other types are silently ignored). Syntax toggle add [-r] [-in] [-out] [-inout] [-internal] [-ports] Arguments -r Specifies that toggle statistic collection is enabled recursively into subregions.
toggle reset toggle reset The toggle reset command resets the toggle counts to zero for the specified nodes. Syntax toggle reset [-all] [-r] [-in] [-out] [-inout] [-internal] [-ports] Arguments -all Resets toggle statistic collection for all nodes that have toggle checking enabled. Optional. -r Specifies that toggle statistic collection is reset recursively into subregions. Optional; if omitted, the reset is limited to the current region.
toggle report toggle report By default the toggle report command displays to the screen a list of all nodes that have not transitioned to both 0 and 1 at least once. Also displayed is a summary of the number of nodes checked, the number that toggled, the number that didn’t toggle, and a percentage that toggled. Syntax toggle report [-file ] [-summary] [-all] Arguments -file Specifies a file to write the report to. If this option is selected, the report is not displayed to the screen.
transcribe transcribe The transcribe command displays a command in the Main window, then executes the command. Transcribe directs commands to the Main window transcript from an external event such as a menu pick or button selection, it may not be used from the command line or a macro. The add button (CR-20) and add_menuitem (CR30) commands can utilize transcribe. Returns nothing. Syntax transcribe Arguments Specifies the command to execute. Required.
transcript transcript The transcript command controls echoing of commands executed in a macro file; also works at top level in batch mode. If no option is specified, the current setting is reported. Syntax transcript [on | off | -q | quietly] Arguments on Specifies that commands in a macro file will be echoed to the Transcript window as they are executed. Optional. off Specifies that commands in a macro file will not be echoed to the Transcript window as they are executed. Optional.
tssi2mti tssi2mti The tssi2mti command is used to convert a vector file in Summit Design Standard Events Format into a sequence of VSIM force (CR-87) and run (CR-139) commands. The stimulus is written to the standard output. The source code for tssi2mti is provided in the file tssi2mti.c in the examples directory.
vcd add vcd add The vcd add command adds the specified items to the VCD file. The allowed items are Verilog nets and variables and VHDL signals of type bit, bit_vector, std_logic, and std_logic_vector (other types are silently ignored). All vcd add commands must be executed at the same simulation time. The specified items are added to the VCD header and their subsequent value changes are recorded in the VCD file.
vcd checkpoint vcd checkpoint The vcd checkpoint command dumps the current values of all VCD variables to the VCD file. While simulating, only value changes are dumped. Related Verilog task: $dumpall Syntax vcd checkpoint Arguments None. See also See Chapter 13 - Value Change Dump (VCD) Files for more information on VCD files.
vcd comment vcd comment The vcd comment command inserts the specified comment in the VCD file. Syntax vcd comment Arguments Comment to be included in the VCD file. Required. Must be quoted by double quotation marks or curly brackets. See also See Chapter 13 - Value Change Dump (VCD) Files for more information on VCD files.
vcd file vcd file The vcd file command specifies the filename and state mapping for the VCD file created by a vcd add command (CR-160). The vcd file command is optional. If used, it must be issued before any vcd add commands. Related Verilog task: $dumpfile Syntax vcd file [] [-nomap] [-map ] [-direction] [-dumpports] Arguments Specifies the name of the VCD file that is created (the default is dump.vcd). Optional.
vcd file -map Affects only VHDL signals of type std_logic. Optional. It allows you to override the default mappings. The mapping is specified as a list of character pairs. The first character in a pair must be one of the std_logic characters UX01ZWLH- and the second character is the character you wish to be recorded in the VCD file.
vcd flush vcd flush The vcd flush command flushes the contents of the VCD file buffer to the VCD file. Related Verilog task: $dumpflush Syntax vcd flush Arguments None. See also See Chapter 13 - Value Change Dump (VCD) Files for more information on VCD files. Verilog tasks are documented in the IEEE 1364 standard.
vcd limit vcd limit The vcd limit command specifies the maximum size of the VCD file (by default, limited to available disk space). When the size of the file exceeds the limit, a comment is appended to the file and VCD dumping is disabled. Related Verilog task: $dumplimit Syntax vcd limit Arguments Specifies the maximum VCD file size in bytes. Required. See also See Chapter 13 - Value Change Dump (VCD) Files for more information on VCD files.
vcd off vcd off The vcd off command turns off VCD dumping and records all VCD variable values as x. Related Verilog task: $dumpoff Syntax vcd off Arguments None. See also See Chapter 13 - Value Change Dump (VCD) Files for more information on VCD files. Verilog tasks are documented in the IEEE 1364 standard.
vcd on vcd on The vcd on command turns on VCD dumping and records the current values of all VCD variables. By default, vcd on is automatically performed at the end of the simulation time that the vcd add (CR-160) commands are performed. Related Verilog task: $dumpon Syntax vcd on Arguments None. See also See Chapter 13 - Value Change Dump (VCD) Files for more information on VCD files. Verilog system tasks are documented in the IEEE 1364 standard.
vcom vcom The vcom command is used to invoke VCOM, the Model Technology VHDL compiler. Use VCOM to compile VHDL source code into a specified working library (or to the work library by default). This command may be invoked from within ModelSim or from the operating system command prompt. This command may also be invoked during simulation.
vcom -f Specifies a file with more command line arguments. Allows complex arguments to be reused without retyping. Optional. -just eapbc Directs the compiler to “just” include: e - entities a - architectures p - packages b - bodies c - configurations Any combination in any order can be used, but one choice is required if you use this optional switch.
vcom -nodebug[=ports] Hides the internal data of the compiled design unit. Optional. The design unit’s source code, internal structure, signals, processes, and variables will not display in ModelSim’s windows. In addition, none of the hidden objects may be accessed through the Dataflow window or with VSIM commands. This also means that you cannot set breakpoints or single step within this code. Don’t compile with this switch until you’re done debugging.
vcom The warning message numbers are: 1 2 3 4 5 6 7 = = = = = = = unbound component process without a wait statement null range no space in time literal multiple drivers on unresolved signal compliance checks optimization messages -O0 | -O1 | -O4 | -O5 Lower the optimization to a minimum with -O0 (capital oh zero). Optional. Use this to work around bugs, increase your debugging visibility on a specific cell, or when you want to place breakpoints on source lines that have been optimized out.
vcom the work library. The specified pathname overrides the pathname specified for work in the project file. Specifies the name of a file containing the VHDL source to be compiled. One filename is required; multiple filenames can be entered separated by spaces or wildcards may be used, i.e., “*.vhd”. No switches can appear after filename(s) on the command line. Examples vcom example.vhd The example compiles the VHDL source code contained in the file example.vhd.
vcom package. All enumeration data types in VHDL get an “implicit” definition for the = operator. So while there is no explicit = operator, there is an implicit one. This implicit declaration can be hidden by an explicit declaration of = in the same package (LRM Section 10.3). However, if another version of the = operator is declared in a different package than that containing the enumeration declaration, and both operators become visible through use clauses, neither can be used without explicit naming, i.
vdel vdel The vdel command deletes a design unit from a specified library. Syntax vdel [-help] [-verbose] [-lib ] [-all | [] Arguments -help Displays the command’s options and arguments. Optional. -verbose Displays progress message. Optional. -lib Specifies the logical name or pathname of the library that holds the design unit to be deleted. Optional; by default, the design unit is deleted from the work library. -all Deletes an entire library.
vdel Examples vdel -all Deletes the work library. vdel -lib synopsys -all Deletes the synopsys library. vdel xor Deletes the entity named xor and all its architectures from the work library. vdel xor behavior Deletes the architecture named behavior of the entity xor from the work library. vdel base Deletes the package named base from the work library.
vdir vdir The vdir command selectively lists the contents of a design library. Syntax vdir [-help] [-l] [-lib ] [] Arguments -help Displays the command’s options and arguments. Optional. -l Prints the version of vcom or vlog that each design unit was compiled under. Also prints the object-code version number that indicates which versions of vcom/vlog and ModelSim are compatible.
vgencomp vgencomp Once a Verilog module is compiled into a library, you can use the vgencomp command to write its equivalent VHDL component declaration to standard output. Optional switches allow you to generate bit or vl_logic port types; std_logic port types are generated by default. Syntax vgencomp [-help] [-] [-b] [-s] [-v] Arguments -help Displays the command’s options and arguments. Optional. - Specifies the pathname of the working library.
vgencomp Examples This example uses a Verilog module that is compiled into the work library. The module begins as Verilog source code: module top(i1, o1, o2, io1); parameter width = 8; parameter delay = 4.5; parameter filename = "file.
view view The view command will open a ModelSim window and bring that window to the front of the display. If multiple instances of a window exist, view will change the default window of that type to the specified window. Using the -new option, view will create an additional instance of the specified window type and set it to be the default window for that type.
view -new Creates a new instance of the window type specified with the option. New window names are created by appending an integer to the window type, starting with 1, then incrementing the integer. ... Specifies the ModelSim window type to view. Multiple window types may be used; at least one type (or wildcard) is required.
virtual delete|describe|define virtual delete|describe|define The virtual delete command removes the matching virtuals. The virtual describe command prints to the transcript window a complete description of the data type of one or more virtual signals. Similar to the existing describe command. The virtual define command prints to the transcript window the definition of the virtual signal or function in the form of a command that can be used to re-create the object.
virtual expand virtual expand The virtual expand command produces a list of all the non-virtual objects contained in the virtual signal(s). This can be used to create a list of arguments for a command that does not accept or understand virtual signals. Syntax virtual expand [-base] [|]+ Arguments -base Causes the root signal parent to be output in place of a subelement. Optional.
virtual function virtual function The virtual function command creates a new signal, known only by the GUI (not the kernel), that consists of logical operations on existing signals and simulation time, as described in . It can handle bit selects and slices of Verilog registers. The virtual function will show up in the wave and signals window as an expandible object if it references more than a single scalar signal. The children correspond to the inputs of the virtual function.
virtual function The name you define for the virtual signal. Required. Case is ignored unless installed in a Verilog region. It is recommended to use alpha, numeric and underscore characters only. Or, use VHDL extended identifier notation, in which case needs to be quoted with double quotes or with curly braces. Examples virtual function { not /chip/section1/clk } clk_n Creates a signal /chip/section1/clk_n which is the inverse of /chip/section1/clk.
virtual function a_01, a_00} } a virtual function { | (gate:/chip/a XOR rtl:/chip/a) } a_err virtual function { | (gate:/chip/b XOR rtl:/chip/b) } b_err ... virtual function { a_err OR b_err OR c_err .... } any_error To find the differences, you can do any of the following: a) Add "any_error" to the wave window and tab to the transitions b) Use the "searchLog" command to print out the time/delta of the first error: searchLog {0 ns} any_error (See the "searchLog" command description below.
virtual function Commands not currently compatible with virtual functions force (CR-87) check contention add (CR-45) check contention config (CR-46) check contention off (CR-47) check float add (CR-48) check float config (CR-49) check float off (CR-50) check stable on (CR-51) check stable off (CR-52) drivers (CR-73) noforce (CR-101) power add (CR-111) power report (CR-112) power reset (CR-113) toggle add (CR-154) toggle reset (CR-155) toggle report (CR-156) vcd add (CR-160) when (CR-226)
virtual hide|nohide virtual hide|nohide The virtual hide command sets a flag in the specified real or virtual signals so that the signals do not appear in the Signals window. This is used when you want to replace a bit-blasted buss with a user-defined bus. The virtual nohide command resets the flag in the specified signal objects. Syntax virtual hide|nohide [-kind ]|[-region ] | Arguments -kind Used to limit the scope to a particular kind of virtuals.
virtual log|nolog virtual log|nolog The virtual log command causes the sim-mode dependent signals of the specified virtual signals to be logged by the kernel. If wildcard patterns are used, it will also log any normal signals found, unless the -only option is used. The virtual nolog command causes the sim-mode dependent signals of the specified virtual signals to be un-logged by the kernel. If wildcard patterns are used, it will also log any normal signals found, unless the -only option is used.
virtual region virtual region The virtual region command creates a new user-defined design hierarchy region. Syntax virtual region Arguments The full path to the region that will become the parent of the new region. Required. The name you give to the new region.
virtual save virtual save The virtual save command saves the definitions of virtuals to a file. Syntax virtual save [-kind ] [-append] [] Arguments -kind Specifies a subset of virtuals to save. Optional. -append Specifies to save ONLY THOSE VIRTUALS that are neither already saved nor those that were read in from a macro file. These unsaved virtuals are then appended to the specified or default file. Optional. Used for writing the virtual definitions. Optional.
virtual show|count virtual show|count The virtual show command lists the full path names of all the virtuals explicitly defined. The virtual count command counts the number of explicitly declared virtuals that have not been saved and that were not read in using a macro file. These are virtuals that probably need to be saved before ModelSim quits. Syntax virtual show|count [-kind ] Arguments -kind Specifies a subset of virtuals to look at. Optional.
virtual signal virtual signal The virtual signal command creates a new signal, known only by the GUI (not the kernel), that consists of concatenations of signals and subelements as specified in . It cannot handle bit selects and slices of Verilog registers. Syntax virtual signal [-env ] [-install ] [-implicit] {} Arguments -env Specifies a hierarchical context for the signal names in so they don’t all have to be full paths.
virtual signal & a_00) } a This command reconstructs a bus "sim:/chip/alu/a(4 downto 0)", using VHDL notation, assuming that a_ii are scalars all of the same type. virtual signal -env sim:chip.alu { (range 4:0)&{a_04, a_03, a_02, a_01, a_00} } a This command reconstructs a bus "sim:chip.alu.a[4:0]", using Verilog notation. Note that the concatenation notation starts with "&{" rather than "{".
virtual signal Commands compatible with virtual signals using [virtual expand ] check contention add (CR-45) check contention config (CR-46) check contention off (CR-47) check float add (CR-48) check float config (CR-49) check float off (CR-50) check stable on (CR-51) check stable off (CR-52) drivers (CR-73) power add (CR-111) power report (CR-112) power reset (CR-113) toggle add (CR-154) toggle reset (CR-155) toggle report (CR-156) vcd add (CR-160) Commands not currently compatible
virtual type virtual type The virtual type command creates a new enumerated type, known only by the GUI, not the kernel. Virtual types are used to convert signal values to character strings. Syntax virtual type {} Arguments {} A space-separated list of character strings. Required. Each string is associated with an enumeration index, starting at zero and increasing by one in the positive direction.
virtual type When picking out a slice and converting the slice, it works best to do it in two steps -- first define the slice, then convert the slice signal to the enumerated type.
vlib vlib The vlib command creates a design library. Syntax vlib [-help] [-dos| -short] [-unix | -long] Arguments -help Displays the command’s options and arguments. Optional. -dos Specifies that subdirectories in a library have names that are compatible with DOS. Not recommended if you use the vmake (CR-205) utility. Optional. Default for ModelSim PE. -short Interchangeable with the -dos argument. Optional.
vlog vlog The vlog command is used to invoke VLOG, the Model Technology Verilog compiler. Use vdel (CR-175) to compile Verilog source code into a specified working library (or to the work library by default). The vlog command is used just like vdel (CR-175), except that you do not need to compile a module before it is referenced (unless the module is referenced from VHDL). This command may be invoked from within ModelSim or from the operating system command prompt.
vlog +delay_mode_unit Set non-zero structural delays to one. Optional. +delay_mode_zero Set structural delays to zero. Optional. -f Specifies a file with more command line arguments. Allows complex arguments to be reused without retyping. Optional. -hazards Enables the run-time hazard checking code. Optional. +incdir+ Search directory for files included with the ‘include filename compiler directive. Optional. -incr Performs incremental compile. Optional.
vlog cannot set breakpoints or single step within this code. Don’t compile with this switch until you’re done debugging. Note that this is not a speed switch like the “nodebug” option on many other products. The optional =ports switch hides the ports for the lower levels of your design; it should only be used to compile the lower levels of the design. If you hide the ports of the top level you will not be able to simulate the design.
vlog -R Causes VSIM to be invoked on the top-level Verilog modules immediately following compilation. VSIM is invoked with the arguments specified by (any arguments available for vsim (CR-208)). -refresh Regenerates a library image. Optional. By default, the work library is updated; use -work to update a different library. See vlog examples for more information.
vlog -93 Specifies that the VHDL interface to Verilog modules shall use VHDL 1076-93 extended identifiers to preserve case in Verilog identifiers that contain uppercase letters. Specifies the name of the Verilog source code file to compile. One filename is required. Multiple filenames can be entered separated by spaces. Examples vlog example.vlg The example compiles the Verilog source code contained in the file example.vlg. vlog -nodebug example.v Hides the internal data of example.v.
vlog vlog top.v -v und1 After compiling top.v, vlog will scan the file und1 for modules or primitives referenced but undefined in top.v. Only referenced definitions will be compiled. vlog top.v +libext+.v+.u -y vlog_lib After compiling top.v, vlog will scan the vlog_lib library for files with modules with the same name as primitives referenced, but undefined in top.v. The use of +libext+.v+.u implies filenames with a .v or .u suffix (any combination of suffixes may be used).
vmake vmake The vmake utility allows you to use a UNIX or Windows MAKE program to maintain libraries. The vmake utility is run on a compiled design library, and outputs a makefile that can be used to reconstruct the library. The resulting makefile can then be run with a version of MAKE (not supplied with ModelSim); a MAKE program is included with Microsoft’s Visual C/C++, as well as many other program development environments.
vmake Examples To produce a makefile for the work library: vmake >makefile You can also run vmake on libraries other than work: vmake mylib >mylib.mak To rebuild mylib, specify its makefile when you run MAKE: make -f mylib.
vmap vmap The vmap command defines a mapping between a logical library name and a directory by modifying the modelsim.ini file. With no arguments, reads the appropriate modelsim.ini file(s) and prints the current VHDL logical library to physical directory mappings. Returns nothing. Syntax vmap [-help] [-c] [-del] [] [] Arguments -help Displays the command’s options and arguments. Optional. -c Copies the default modelsim.
vsim vsim The vsim command is used to invoke the VSIM simulator, or to view the results of a previous simulation run (when invoked with the -view switch). You can specify a configuration, an entity/architecture pair, or a module for simulation. If a configuration is specified, it is invalid to specify an architecture. With no options, vsim brings up the Load Design dialog box, allowing you to specify the design and options; the Load Design dialog box will not be presented if you specify any options.
vsim VSIM arguments are grouped alphabetically by language: • Arguments, VHDL and Verilog (CR-209) • Arguments, VHDL (CR-213) • Arguments, Verilog (CR-216) • Arguments, design-unit (CR-217) Arguments, VHDL and Verilog -c Specifies that the simulator is to be run in command line mode. Optional. If used, must be the first argument. Also see "Running command-line and batch-mode simulations" (E-440) for more information. -coverage Allows line number execution statistics to be kept by the simulator.
vsim -keepstdout For use with foreign programs. Instructs the simulator to not redirect the stdout stream to the Main transcript window. Optional. -l Saves the contents of the "Main window" (10-158) to . Optional. Default is transcript. Can also be specified using the .ini (see "Creating a transcript file" (B-404)) file or the .tcl preference file. Restricts the search of the license manager. Optional. Use one of the following options.
vsim +no_tchk_msg Disables timing constraint error messages. Optional. +notimingchecks Disables Verilog and VITAL timing checks for faster simulation. Optional. By default, Verilog timing check system tasks ($setup, $hold,...) in specify blocks are enabled. For VITAL, the timing check default is controlled by the ASIC or FPGA vendor, but most default to enabled. -quiet Disable ’loading’ messages during batch-mode simulation. Optional.
vsim ‘timescale directives are found, the minimum time precision will be used; must be one of: fs, ps, ns, us, ms, or sec, min, or hr The default is 1ns; the optional may be 1, 10 or 100. Once you’ve begun simulation, you can determine the current simulator resolution by invoking the report command (CR-131) with the simulator state option. -tag Specify a string tag to append to foreign trace filenames. Optional; used with the -trace_foreign option.
vsim -wavslim Specifies a size restriction in megabytes for the event portion of the WLF logfile. Optional. The default is infinite size (0). The must be an integer. Note that a logfile contains an event, header, and symbol portion. The size restriction is placed on the event portion only. When ModelSim exits, the entire header and symbol portion of the WLF file is written. Consequently, the resulting file will be larger than the size specified with -wavslim.
vsim -g ... Note there is no space between -g and . Specifies a value for all generics in the design with the given name that have not received explicit values in generic maps (such as top-level generics and generics that would otherwise receive their default value). Optional. Name is the name of the generic parameter, exactly as it appears in the VHDL source (case is ignored). Value is an appropriate value for the declared data type of the generic parameter.
vsim Note: Make sure the Value you specify is appropriate for the declared data type. Type mismatches will cause the specification to be ignored (including no error messages). No spaces are allowed anywhere in the specification, except within quotes when specifying a string value. Multiple -G options are allowed, one for each generic parameter. Name may be prefixed with a relative or absolute hierarchical path to select generics in an instance-specific manner.
vsim -strictvital Exactly match the VITAL package ordering for messages and delta cycles. Optional. Useful for eliminating delta cycle differences caused by optimizations not addressed in the VITAL LRM. Using this will reduce simulator performance. -vcdread Simulates theVHDL top-level design from the specified VCD file. Optional. The VCD file must have been created in a previous simulation using the vcd file command (CR-163) with the -nomap and -direction options. -vital2.
vsim +nowarn Disables warning messages in the category specified by . Optional. Warnings that can be disabled include the name in square brackets in the warning message. For example the code for charge decay warnings is DECAY, so use +nowarnDECAY to disable them. -pli "
vsim [()] Specifies the name of the top-level entity to be simulated. Optional. The entity may have an architecture optionally specified; if omitted the last architecture compiled for the specified entity is simulated. An entity is not valid if a configuration is specified. Note: Most UNIX shells require arguments containing () to be single-quoted to prevent special parsing by the shell. See the examples below. Examples vsim -gedge=”low high” -gVCC=4.
vsim vsim The vsim commands return information about the current VSIM executable. vsimDate Returns the date the executable was built, such as "Apr 10 1997". vsimId Returns the identifying string, such as "ModelSim 5.1". vsimVersion Returns the version as used by the licensing tools, such as "1997.04".
vsource vsource The vsource command displays an HDL source file in the VSIM Source window. This command is used in order to set a breakpoint in a file other than the one currently displayed in the Source window (10-200). Syntax vsource [] Arguments Specifies a relative or full pathname. Optional. If filename is omitted the source file for the current design context is displayed. Examples vsource design.vhd vsource /old/design.
.wave.tree zoomfull .wave.tree zoomfull The .wave.tree zoomfull command redraws the display to show the entire simulation from time 0 to the current simulation time. The behavior is the same as Wave window (10-212) Zoom > Zoom Full menu selection. Syntax .wave.tree zoomfull Arguments None.
.wave.tree zoomrange .wave.tree zoomrange The .wave.tree zoomrange command allows you to enter the beginning and ending times for a range of time units to be displayed. The behavior is the same as Wave window (10-212) Zoom > Zoom Range menu selection. Syntax .wave.tree zoomrange f1 f2 Arguments f1 f2 Sets the waveform display to zoom from time f1 to f2, where f1 and f2 are floating point numbers. Required. Either range number may include an optional VHDL resolution time-unit.
wlf2log wlf2log The wlf2log command translates a ModelSim logfile (vsim.wlf) to a QuickSim II logfile. The command reads the vsim.wlf logfile generated by the add list, add wave, or log commands in the simulator and converts it to the QuickSim II logfile format. You must exit ModelSim before running wlf2log because vsim.wlf (or other userspecified wave files) are updated dynamically. Syntax wlf2log -inout [-help] [-input] [-output] [-inout] [-internal] [-l ] [-4.1] [-4.
wlf2log -4.3 Reads intermediate version (4.2 and 4.3) .wav files. Optional. -quiet Disables error message reporting. Optional. -o Directs the output to be written to the file specified by . Optional. The default destination for the logfile is standard out. Specifies the ModelSim logfile that you are converting. Required. Additional information for QuickSim II users In some cases your original QuickHDL/ModelSim simulation results (in your vsim.
wlf2log 3 Do a connect_wdb (either through the pulldown menus, the "Connect WDB" pallette icon under "Stimulus", or a function invocation). You specify the name of the WDB that you originally loaded logfile into (in this case, "fred"). At this point you can issue the "run" command and the stimulus in the converted logfile will be applied. Before exiting the simulation you should save the new WDB ("fred") as a WDB or logfile so that it can be loaded again in the future.
when when The when command allows you to instruct VSIM to perform actions when the specified conditions are met. For example, you can use the when command to break on a signal value or at a specific simulator time (see "Time-based breakpoints" (CR-229)) . Conditions can include the following HDL items: VHDL signals, and Verilog nets and registers. Use the nowhen command (CR-105) to deactivate when commands. The when command uses a when_condition_expression to determine whether or not to perform the action.
when Name Operator OR ||, OR The operands may be item names, signame’event, or constants. Subexpressions in parentheses are permitted. The command will be executed when the expression is evaluated as TRUE or 1.
when Examples The when command below instructs the simulator to display the value of item c in binary format when there is a clock event, the clock is 1, and the value of b is 01100111, and then to stop. when -label when1 {clk’event and clk=’1’ and b = “01100111”} { echo “Signal c is [exa -bin c]" stop} The when command below is labeled “a” and will cause VSIM to echo the message “b changed” whenever the value of the item b changes.
when Time-based breakpoints You can build time-based breakpoints into a when statement with the following syntax. For absolute time (indicated by @) use: when {$now = @1750ns} {stop} You can also use: when {errorFlag = ’1’ OR $now = 2ms} {stop} This example adds 2ms to simulation time at which the when statement is first evaluated, then stops.
where where The where command displays information about the system environment. This command is useful for debugging problems where VSIM cannot find the required libraries or support files. Syntax where Arguments None. Description The where command displays three important system settings: current directory This is the current directory that VSIM was invoked from, or was specified on the VSIM command line. Once in VSIM the current directory cannot be changed.
write format write format The write format command records the names and display options of the HDL items currently being displayed in the List or Wave window. The file created is comprised of a file of add list (CR-22), add wave (CR-33), and configure (CR-54) commands. This file may be invoked with the do command (CR-67) to recreate the List or Wave window format on a subsequent simulation run.
write list write list The write list command records the contents of the most recently opened, or specified List window in a list output file. This file contains simulation data for all HDL items displayed in the List window: VHDL signals - and Verilog nets and registers. Syntax write list [-events] [-window ] Arguments -events Specifies to write print-on-change format. Optional. Default is tabular format. -window Specifies a List window using the full Tk path. Optional.
write preferences write preferences The write preferences command saves the current GUI preference settings to a Tcl preference file. Settings saved include the current window location and size. Syntax write preferences Arguments Specify the name for the preference file. Optional. If the file is named modelsim.tcl, ModelSim will read the file each time VSIM is invoked. To use a preference file other than modelsim.
write report write report The write report command prints a summary of the design being simulated including a list of all design units (VHDL configurations, entities, and packages and Verilog modules) with the names of their source files. Syntax write report [] Arguments Specifies the name of the output file where the data is to be written. Optional. If the is omitted, the report is written to the Transcript window. Examples write report alu.
write transcript write transcript The write transcript command writes the contents of the Main window transcript to the specified file. The resulting file can be used to replay the transcribed commands as a DO file (macro). Syntax write transcript [] Arguments Specifies the name of the output file where the data is to be written. Optional. If the is omitted, the transcript is written to a file named transcript.
write tssi write tssi The write tssi command records the contents of the default or specified List window in a “TSSI format” file. The file contains simulation data for all HDL items displayed in the List window that can be converted to TSSI format (VHDL signals and Verilog nets). A signal definition file is also generated. The List window needs to be using symbolic radix in order for write tssi to produce useful output.
write tssi std_ulogic State Characters SEF State Characters Input Output Bidirectional U N X ? X N X ? 0 D L 0 1 U H 1 Z Z T F W N X ? L D L 0 H U H 1 - N X ? Bidirectional logic values are not converted because only the resolved value is available. The TSSI ASCII In Converter and ASCII Out Converter can be used to resolve the directionality of the signal and to determine the proper forcing or expected value on the port.
write wave write wave The write wave command records the contents of the most currently opened, or specified Wave window in PostScript format. The output file can then be printed on a PostScript printer. Syntax write wave [-window ] [-width ] [-height ] [-margin ] [-start ] [-end ] [-perpage ] [-pagecount ] [-landscape] [-portrait] Arguments -window Specifies a Wave window using the full Tcl path. Optional.
write wave Specifies the name of the PostScript output file. Required. Examples write wave alu.ps Saves the current data in the Wave window in a file named alu.ps. write wave -win .wave2 group2.ps Saves the current data in window ‘wave2’ in a file named group2.ps. write wave -start 600ns -end 800ns -perpage 100ns top.ps Writes two separate pages to top.
CR-240 ModelSim Commands ModelSim EE/SE Command Reference
C R Command Syntax and Conventions Chapter contents Syntax conventions . . . . . . . . . . . . . . . . . . 242 Command return values . . . . . . . . . . . . . . . . . 243 Command shortcuts . . . . . . . . . . . . . . . . . 243 Command history shortcuts . . . . . . . . . . . . . . . . 243 Numbering conventions . . . . . . . . . . . . . . . . . 244 HDL item pathnames . . . . . . . . . . . . . . . . .
Syntax conventions Syntax conventions These syntax elements are used within all ModelSim command documentation: Syntax notation Description < > angled brackets surrounding a syntax item indicate a user-defined argument; do not enter the brackets in commands [ ] square brackets indicate an optional item; if the brackets surround several words, all must be entered as a group; the brackets are not entered ...
Command return values Command return values All simulator commands are invoked using Tcl. For most commands that write information to the Main window, that information is also available as a Tcl result. By using command substitution the results can be made available to another command or assigned to a Tcl variable. For example: set aluinputs [find -in alu/*] sets variable "aluinputs" to the result of the find command (CR-85). Command shortcuts You may abbreviate command syntax, but there’s a catch.
Numbering conventions Numbering conventions Numbers in ModelSim /PLUS can be expressed in either VHDL or Verilog style. Two styles can be used for VHDL numbers, one for Verilog.
HDL item pathnames Verilog numbering conventions Verilog numbers are expressed in the style: [ - ] [ size ] [ base ] value Element Description - indicates a negative number; optional size the number of bits in the number; optional base specifies the base; binary: ‘b or ‘B, octal: ‘o or ‘O, decimal: ‘d or ‘D, hex: ‘h or ‘H; optional value specifies digits in appropriate base with optional underscore separators; default is decimal, required Examples ‘b11111110 8‘b11111110 ‘Hffca23 21‘H1fca23 -2374
HDL item pathnames Absolute path names Absolute path names begin with the path separator character. The first name in the path should be the name of a top-level entity or module, but if you leave it off then the first top-level entity or module will be assumed. VHDL designs only have one top-level, so it doesn’t matter if it is included in the pathname.
HDL item pathnames Names in VSIM commands are case sensitive when matched against case sensitive identifiers, otherwise they are not case sensitive. Extended identifiers The following are supported formats for extended identifiers for any command that takes an identifier. {\ext ident!\ } # Note trailing space. Compatible with 5.2 \\ext\ ident\!\\ # All non-alpha characters escaped Naming fields in VHDL signals Fields in VHDL record signals can be specified using the form: signal_name.
Wildcard characters Wildcard characters Wildcard characters can be used in HDL item names in some simulator commands.
Simulation time units preference variables and user-defined variables. Note that case is significant in variable names. See Chapter B - ModelSim Variables for a complete listing of ModelSim variables. Variable settings report The report command (CR-131) returns a list of current settings for either the simulator state, or simulator control variables.
GUI_expression_format The GUI_expression_format is an option of several simulator commands that operate within ModelSim’s GUI environment. The expressions allow the use of criteria to locate and examine HDL items within the List and Wave windows.
GUI_expression_format either UNSIGNED or SIGNED, as in the IEEE std_logic_arith package. Normally, referencing a signal array causes it to be treated as UNSIGNED by the expression evaluator; to cause it to be treated as SIGNED, use casting as described below. Numeric operations supported on arrays are performed by the expression evaluator via ModelSim’s built-in numeric_standard (and similar) package routines.
GUI_expression_format &{, , ... } &{{}, , ... } &{{}, , ...}, ... } The concatenation directive (as illustrated below) can be used to constrain the resulting array range of a concatenation or influence how compound objects are treated. By default, the concatenation will be created with descending index range from (n-1) to 0, where n is the number of elements in the array.
GUI_expression_format Saving expressions Expressions created in the expression builder dialog box can be saved for future use by pressing the SAVE button. You will be prompted for the name of a globallevel Tcl variable, to be assigned the expression string. After entering the variable name, the expression will be saved. Regardless of whether you enter a Tcl variable name or not, the expression will also be saved in the entry box drop-down cache.
GUI_expression_format Array constants, expressed in any of the following formats Type Values VHDL # notation #[#] Example: 16#abc123# VHDL bitstring "(U|X|0|1|Z|L|H|W|-)*" Example: "11010X11" VLOG notation [-][]’(b|B|o|O|d|D|h|H) (where includes 0-9, a-f, A-F and ’-’) Example: 12’hc91 (This is the preferred notation because it removes the ambiguity about the number of bits.
GUI_expression_format Operators Operator Description Operator Description && boolean and sll/SLL shift left logical || boolean or sla/SLA shift left arithmetic ! boolean not srl/SRL shift right logical == equal sra/SRA shift right arithmetic != not equal ror/ROR rotate right === exact equal rol/ROL rotate left !== exact not equal + arithmetic add < less than - arithmetic subtract <= less than or equal * arithmetic multiply > greater than / arithmetic divide >= g
GUI_expression_format Casting Casting Description (bool) convert to boolean (boolean) convert to boolean (int) convert to integer (integer) convert to integer (real) convert to real (time) 64 bit integer (std_logic) convert to a-state signal value (signed) convert to signed vector (unsigned) convert to unsigned vector (std_logic_vector) convert to unsigned vector Examples /top/bus and $bit_mask This expression takes the bitwise and function of signal /top/bus and the array constant c
Index A abort simulator command CR-19 Absolute time, see time add button simulator command CR-20 add list simulator command CR-22 add wave simulator command add_menu simulator command CR-26 add_menucb simulator command CR-28 add_menuitem simulator command CR-30 add_separator simulator command CR-31 add_submenu simulator command CR-32 alias simulator command CR-37 Arrays indexes CR-246 slices CR-246 B batch_mode simulator command CR-38 bd simulator command CR-39 bp simulator command CR-40 Break on signal v
describe simulator command CR-63 Design units adding Verilog units to a library CR-199 report of units simulated CR-234 Directories mapping libraries CR-207 disable_menu simulator command CR-65 disable_menuitem simulator command CR-66 disablebp simulator command CR-64 Do files, see macros CR-67 do simulator command CR-67 down | up simulator command CR-70 drivers simulator command CR-73 dumplog64 ModelSim command CR-74 G Generics assigning or overriding values with -g and -G CR214 examining generic values C
forcing signals or nets CR-87 passing parameters to CR-67 relative directories CR-67 shifting parameter values CR-147 using VSIM commands with macros CR-68 main clear simulator command CR-99 Messages echoing CR-75 ModelSim commands ??–CR-224 comments in commands CR-242 dumplog64 CR-74 modelsim CR-98 vcom CR-169 vdel CR-175 vdir CR-177 vgencomp CR-178 vlib CR-198 vlog CR-199 vmake CR-205 vsim CR-208 wlf2log CR-223 modelsim ModelSim command CR-98 N Name case sensitivity for VHDL and Verilog CR-246 Names alte
of signals in Wave window CR-34 to examine CR-82 radix simulator command CR-129 record simulator command CR-130 Refreshing library images CR-172, CR-202 report simulator command CR-131 resolution, simulator time CR-211 restart simulator command CR-133 restore simulator command CR-134 resume simulator command CR-135 right | left simulator command CR-136 run simulator command CR-139 S search simulator command CR-141 Searching List window signal values, transitions, and names CR-70, CR-250 next and previous e
see write tssi command CR-236 V Values describe HDL items CR-63 examine HDL item values CR-81 Variable settings report CR-249 Variables, HDL changing value of on command line CR-43 describing CR-63 examining values CR-81 Variables, Tcl CR-248 vcd add simulator command CR-160 vcd checkpoint simulator command CR-161 vcd comment simulator command CR-162 vcd file simulator command CR-163 VCD files adding items to the file CR-160 dumping variable values CR-161 flushing the buffer contents CR-165 inserting comme
check float config CR-49 check float off CR-50 check stable off CR-52 check stable on CR-51 checkpoint see also checkpoint/restore configure CR-54 coverage clear CR-59 coverage reload CR-60 coverage report CR-61 delete CR-62 describe CR-63 disable_menu CR-65 disable_menuitem CR-66 disablebp CR-64 do CR-67 down | up CR-70 drivers CR-73 echo CR-75 edit CR-76 enable_menu CR-78 enable_menuitem CR-79 enablebp CR-77 environment CR-80 examine CR-81 exit CR-84 find CR-85 force CR-87 format list, see write format fo
tb (traceback) CR-153 toggle add CR-154 toggle report CR-156 toggle reset CR-155 transcribe CR-157 transcript CR-158 vcd add CR-160 vcd checkpoint CR-161 vcd comment CR-162 vcd file CR-163 vcd flush CR-165 vcd limit CR-166 vcd off CR-167 vcd on CR-168 view CR-180 virtual count CR-192 virtual define CR-182 virtual delete CR-182 virtual describe CR-182 virtual expand CR-183 virtual function CR-184 virtual hide CR-188 virtual log CR-189 virtual nohide CR-188 virtual nolog CR-189 virtual region CR-190 virtual s
Thank you for purchasing ModelSim! Model Technology A M E N T O R G R A P H I C S C O M P A N Y www.model.