Docsity

ModelSim SE/EE 5.4 Quick Guide: Modeling and Simulation Environment Variables and Commands, Study notes of Engineering

Toggle sidebar
bg1
ModelSim SE/EE 5.4 Quick Guide
Web: www.model.com
Phone: 503-641-1340
Documentation
ModelSim Start Here: http://www.model.com/pdf/se_start.pdf
ModelSim Tutorial: http://www.model.com/pdf/se_tutor.pdf
Globetrotter FlexLM Doc: http://www.globetrotter.com/manual.htm
Web - Download the Latest Release
http://www.model.com/support/download.html
ftp://ftp.model.com/pub/ (206.103.63.81) [Fast]
ftp://support.model.com/pub/model.com/ (206.103.57.2) [Slow]
Environment Variables (see ModelSim cmd "printenv")
LM_LICENSE_FILE Required Pathname of license.dat file
DOPATH Optional Search path for ".do" files
EDITOR Optional Specifies editor for "edit" cmd
MODELSIM Optional Pathname of modelsim.ini file
MODELSIM_TCL Optional List of modelsim.tcl files
MODEL_TECH_TCL Optional Pathname to Tcl/Tk libraries
MODEL_TECH Don’t Set Used internally by ModelSim
MGC_LOCATION_MAP Optional Used as "soft" path to find files
MTI_TF_LIMIT Optional Limits Transcript file size (k)
PLIOBJS Optional Used to load PLI object files
TMPDIR Optional Us ed by VSIM for temp space
Mentor Graphics Licensing Environment Variable
MGLS_LICENSE_FILE Pathname for Mentor license file
MGLS_HOME Pathname for Mentor Licensing
PATH Environment Variable
Unix: Add /<install_dir>/modeltech/bin to $path
PC: PATH will be updated automatically during install
Starting the License Server
Unix: Copy license.dat file to /<install_dir>/modeltech/<platform>/
Run /<install_dir>/modeltech/<platform>/START_SERVER
PC: Run /<install_dir>/modeltech/win32/flexlm.cpl
Use "Setup" and "Control" tabs to configure and start server
Licensing Diagnostics
Unix: Run /<install_dir>/modeltech/< platform>/lmstat –a or lmdiag
PC: Run /<install_dir>/modeltech/win32/lmutil lmstat –a or lmutil lmdiag
Invoking ModelSim
Unix: Run /<install_dir>/modeltech/bin/vsim
PC: Start->Programs->Model Tech->ModelSim -or-
PC: Double-click on: <install_dir>/modeltech/win32/modelsim.exe
Command Where used: Description
(Sh)ell, For details on these commands refer to the
(M)odelSim> ModelSim Reference Manual
(V)SIM>
vcom Sh, M, V VHDL Compiler (see below)
vdel Sh, M, V Deletes a design unit from a specific library
vdir Sh, M, V Lists the contents of a library
vlib Sh, M, V Creates a design library
vlog Sh, M, V Verilog Compiler (see be low)
vmap Sh, M, V Defines or displays library mappings
vsim Sh, M, V VHDL and/or Verilog Simulator (see below)
add button M, V Adds a button (e.g., add button MyRun {run 5000} )
add list | wave V Add signals to the List or Wave windows
add log V Log signals to vsim.wlf file for analysis later
alias M, V Create a user defined alias (e.g., alias h "history" )
bp, bd V Set/Clear a breakpoint (see Managing Breakpoints below)
cd Sh, M, V Change directory
change V Modify a VHDL variable or Verilog register
checkpoint V Save the state of you simulation (see restore)
configure M, V Configure List or Wave window attributes
delete V Remove HDL item from List or Wave window
do M, V Execute a file of commands (e.g., do macro.do )
drivers V Display current and future value of signal or net drivers
echo M, V Display message (e.g., echo "Time is $now ns." )
edit M, V Invoke editor specified by the EDITOR env variable
environment M, V Display or change current region/signal environment
examine M, V Examine on e or more HDL items (e.g., exa /top/clk )
find V Display pathnames of matching HDL items
force V Force signals or nets (e.g., force clk 1 10, 0 20 –r 100 )
history M, V List previous commands
log M, V Same as add log above
.main clear M, V Clears the Main window transcript
noforce V Release signals or nets from force commands
notepad M, V Simple text editor
printenv M, V Display names and values of environment variables
property V Change List or Wave signal attributes (color, radix, etc.)
pwd M, V Display current path in Main transcript window
radix M, V Change the default radix in all windows
report M, V report simulator control returns all control variable va lues
report M, V report simulator state returns all state variable values
restart V Restart the simulator
restore M, V Restore the simulation state from a previous checkpoint
resume M, V Resume macro execution after a pause command
right | left V Search in wave window for next transition or –expr
run V Advance simulation time (e.g., run 1000 )
search | next V Search specified window for next item matching pattern
seetime V Scroll List or Wave window to time (e.g., seetime wave 500)
view M, V Open a ModelSim window and pop it to the top
vsource V Display HDL source file in Source window
when M, V Perform action on condition (e.g., when clk=1 { echo clk} )
where M, V Display info about the environment
write M, V Records names, window contents and preferences to a file
↑↓ M, V Toggle thru last commands
<ctrl-a> M, V Move to beginning of line
<ctrl-e> M, V Move to end of line
<ctrl-c> M, V Copy the selection in the Main transcript window
<ctrl-v> M, V Paste to the Main transcript window (see <ctrl-c> )
!! | !n M, V Repeat last command, Repeat nth command
!abc M, V Repeat cmd starting "abc"
^abc^xyz M, V Replace "abc" in previous command with "xyz"
dumplog64 Sh Dump the contents of the vsim.wlf file in a readable form
vgencomp Sh Create VHDL component from compiled Verilog module
vmake Sh Print a makefile for a l ibrary
ModelSim Editions
ModelSim-PE Personal Edition (FPGA, Basic Functionality)
ModelSim-SE/EE Special Edition / Elite Edition (ASIC signoff,
Code Coverage, Performance Analyzer)
ModelSim Products
ModelSim-VHDL VHDL Compiler, Simulator, Debugg er
ModelSim-VLOG Verilog Compiler, Simulator, Debugger
ModelSim-PLUS VHDL & Verilog Compiler, Siumlator, Debugger
ModelSim-LNL VHDL or Verilog Comp iler, Simulator, Debugger
ModelSim Definitions
LNL Language Neutral Licensing (VHDL or Verilog)
SKS Single Kernel Simulator
Quick Guide Notes
Find this document at http://www.model.com/pdf/se_guide.pdf
Commands in bold are typed at the ModelSim> or VSIM> prompts
Licensing Help
http://www.model.com/resources/licensing/licensing_help.html
Wave Window
<left mouse button> Select signal / Place cursor
<middle mouse button> Zoom In
<right mouse button> Zoom Popup Menu
<ctrl-f> Find next item
<tab> (go right) Search forward for next edge
<shift-tab> (go left) Search backward for next edge
i I or + | o O or - Zoom in | Zoom out
f or F | l or L Zoom full | Zoom Last
add wave <item> <item> Wave specific signals/nets
add wave * Wave signals/nets in scope
add wave –r /* Wave all signals/nets in design
add wave –label <name> <item> Wave and rename a signal/net
add wave abus(31:15) Wave a slice of a bus
view wave Display wave window
view wave –new Display additional wave window
.wave.tree zoomfull Zoom full
.wave.tree zoomrange <f1> <f2> Zoom Range
write wave Print wave window to file
Copyright © 2000, Model Technology Incorporated
Reproduction Permitted (and encouraged!)
Installation / Environment / Licensing Key ModelSim Commands (see Command Reference for more)
General Information - Last Updated: 03/24/00
Model Technology
A MENTOR GRAPHI CS COMPANY
pf2

Partial preview of the text

Download ModelSim SE/EE 5.4 Quick Guide: Modeling and Simulation Environment Variables and Commands and more Study notes Engineering in PDF only on Docsity!

Model Sim SE/EE 5.4 Quick Guide

Web: www.model.com

Email: [email protected]

[email protected]

Phone: 503-641-

Documentation ModelSim Start Here: http://www.model.com/pdf/se_start.pdf ModelSim Tutorial: http://www.model.com/pdf/se_tutor.pdf Globetrotter FlexLM Doc: http://www.globetrotter.com/manual.htm Web - Download the Latest Release http://www.model.com/support/download.html ftp://ftp.model.com/pub/ (206.103.63.81) [Fast] ftp://support.model.com/pub/model.com/ (206.103.57.2) [Slow] Environment Variables (see ModelSim cmd "printenv") LM_LICENSE_FILE Required Pathname of license.dat file DOPATH Optional Search path for ".do" files EDITOR Optional Specifies editor for "edit" cmd MODELSIM Optional Pathname of modelsim.ini file MODELSIM_TCL Optional List of modelsim.tcl files MODEL_TECH_TCL Optional Pathname to Tcl/Tk libraries MODEL_TECH Don’t Set Used internally by ModelSim MGC_LOCATION_MAP Optional Used as "soft" path to find files MTI_TF_LIMIT Optional Limits Transcript file size (k) PLIOBJS Optional Used to load PLI object files TMPDIR Optional Used by VSIM for temp space Mentor Graphics Licensing Environment Variable MGLS_LICENSE_FILE Pathname for Mentor license file

MGLS_HOME Pathname for Mentor Licensing

PATH Environment Variable Unix: Add /<install_dir>/modeltech/bin to $path PC: PATH will be updated automatically during install Starting the License Server Unix: Copy license.dat file to /<install_dir>/modeltech// Run /<install_dir>/modeltech//START_SERVER PC: Run /<install_dir>/modeltech/win32/flexlm.cpl Use "Setup" and "Control" tabs to configure and start server Licensing Diagnostics Unix: Run /<install_dir>/modeltech//lmstat –a or lmdiag PC: Run /<install_dir>/modeltech/win32/lmutil lmstat –a or lmutil lmdiag Invoking ModelSim Unix: Run /<install_dir>/modeltech/bin/vsim PC: Start->Programs->Model Tech->ModelSim -or- PC: Double-click on: <install_dir>/modeltech/win32/modelsim.exe

Command Where used: Description (Sh)ell, For details on these commands refer to the (M)odelSim> Model Sim Reference Manual (V)SIM>

vcom Sh, M, V VHDL Compiler (see below) vdel Sh, M, V Deletes a design unit from a specific library vdir Sh, M, V Lists the contents of a library vlib Sh, M, V Creates a design library vlog Sh, M, V Verilog Compiler (see below) vmap Sh, M, V Defines or displays library mappings vsim Sh, M, V VHDL and/or Verilog Simulator (see below)

add button M, V Adds a button (e.g., add button MyRun {run 5000} ) add list | wave V Add signals to the List or Wave windows add log V Log signals to vsim.wlf file for analysis later alias M, V Create a user defined alias (e.g., alias h "history" ) bp, bd V Set/Clear a breakpoint (see Managing Breakpoints below) cd Sh, M, V Change directory change V Modify a VHDL variable or Verilog register checkpoint V Save the state of you simulation (see restore ) configure M, V Configure List or Wave window attributes delete V Remove HDL item from List or Wave window do M, V Execute a file of commands (e.g., do macro.do ) drivers V Display current and future value of signal or net drivers echo M, V Display message (e.g., echo "Time is $now ns." ) edit M, V Invoke editor specified by the EDITOR env variable environment M, V Display or change current region/signal environment examine M, V Examine one or more HDL items (e.g., exa /top/clk ) find V Display pathnames of matching HDL items force V Force signals or nets (e.g., force clk 1 10, 0 20 – r 100 ) history M, V List previous commands log M, V Same as add log above .main clear M, V Clears the Main window transcript noforce V Release signals or nets from force commands notepad M, V Simple text editor printenv M, V Display names and values of environment variables property V Change List or Wave signal attributes (color, radix, etc.) pwd M, V Display current path in Main transcript window radix M, V Change the default radix in all windows report M, V report simulator control returns all control variable values report M, V report simulator state returns all state variable values restart V Restart the simulator restore M, V Restore the simulation state from a previous checkpoint resume M, V Resume macro execution after a pause command right | left V Search in wave window for next transition or –expr run V Advance simulation time (e.g., run 1000 ) search | next V Search specified window for next item matching pattern seetime V Scroll List or Wave window to time (e.g., seetime wave 500 ) view M, V Open a ModelSim window and pop it to the top vsource V Display HDL source file in Source window when M, V Perform action on condition (e.g., when clk=1 {echo clk} ) where M, V Display info about the environment write M, V Records names, window contents and preferences to a file

↑↓ M, V^ Toggle thru last commands

<ctrl-a> M, V Move to beginning of line <ctrl-e> M, V Move to end of line <ctrl-c> M, V Copy the selection in the Main transcript window <ctrl-v> M, V Paste to the Main transcript window (see <ctrl-c> ) !! | !n M, V Repeat last command, Repeat nth command !abc M, V Repeat cmd starting "abc" ^abc^xyz M, V Replace "abc" in previous command with "xyz" dumplog64 Sh Dump the contents of the vsim.wlf file in a readable form vgencomp Sh Create VHDL component from compiled Verilog module vmake Sh Print a makefile for a library

ModelSim Editions ModelSim-PE Personal Edition (FPGA, Basic Functionality) ModelSim-SE/EE Special Edition / Elite Edition (ASIC signoff, Code Coverage, Performance Analyzer) ModelSim Products ModelSim-VHDL VHDL Compiler, Simulator, Debugger ModelSim-VLOG Verilog Compiler, Simulator, Debugger ModelSim-PLUS VHDL & Verilog Compiler, Siumlator, Debugger ModelSim-LNL VHDL or Verilog Compiler, Simulator, Debugger ModelSim Definitions LNL Language Neutral Licensing (VHDL or Verilog) SKS Single Kernel Simulator Quick Guide Notes Find this document at http://www.model.com/pdf/se_guide.pdf Commands in bold are typed at the ModelSim> or VSIM> prompts Licensing Help http://www.model.com/resources/licensing/licensing_help.html

Wave Window

Select signal / Place cursor Zoom In Zoom Popup Menu <ctrl-f> Find next item (go right) Search forward for next edge <shift-tab> (go left) Search backward for next edge i I or + | o O or - Zoom in | Zoom out f or F | l or L Zoom full | Zoom Last add wave Wave specific signals/nets *add wave *** Wave signals/nets in scope add wave – r / Wave all signals/nets in design add wave – label Wave and rename a signal/net add wave abus(31:15) Wave a slice of a bus view wave Display wave window view wave – new Display additional wave window .wave.tree zoomfull Zoom full .wave.tree zoomrange Zoom Range write wave Print wave window to file

Copyright © 2000, Model Technology Incorporated Reproduction Permitted (and encouraged!)

Installation / Environment / Licensing Key Model Sim Commands (see Command Reference for more)

General Information - Last Updated: 03/24/

Model Technology

A M E N T O R G R A P H I C S C O M P A N Y

Key Arguments (use – help for full list) [-help] Display vlog syntax help [-version] Returns vlog version [-compat] Disable event order optimizations [-f ] Pass in arguments from file [-hazards] Enable run-time hazard checking [-nodebug] Hide internal variables & structure [-quiet] Disable loading messages [-R ] Invoke VSIM after compile [-refresh] Regenerate lib to current version [-work ] Specify work library [-v <library_file>] Specify Verilog source library <filename(s)> Verilog file(s) to be compiled Examples vlog top.v vlog – work mylib – refresh

vlog

Tcl/Tk

More Info...

Standards Supported

vcom

Key Arguments (use – help for full list) [-help] Display vsim syntax help [-version] Returns vsim version [-c ] Run in cmd line mode [-do "cmd" | ] Run cmd or file at startup [-f ] Pass in args from file [-g|G<name=value>] Set VHDL Generic values [-hazards] Enable hazard checking [-l ] Save transcript to log file [+notimingchecks] Disable timing checks [-quiet] Disable loading messages [-restore ] Restore a simulation [-sdf{min|typ|max} Apply SDF timing data e.g., =] sdfmin /top=MySDF.txt [-sdfnowarn] Disable SDF warnings [-t [] ] Time resolution (shell only) [-view ] Log file for VSIM to view [-wav ] VSIM log file to create [. Configuration, Module or | Entity/Arch to simulate | [()]] Examples vsim top vsim -lib mywork top -do commands.do

Key Arguments (use – help for full list) [-help] Display vcom syntax help [-version] Returns vcom version [-93] [-87] Choose VHDL-1993 or 1987 [-check_synthesis] Turn on synthesis checker [-debugVA] Print VITAL opt status [-explicit] Resolve ambiguous overloads [-f ] Pass in arguments from file [-nocheck] Disable run time range checks [-nodebug] Strip internal names [-novitalcheck] Disable VITAL95 checking [-nowarn <#>] Disable individual warning msg [-O0] Disable optimization [-quiet] Disable loading messages [-refresh] Regenerate library image [-work ] Specify work library <filename(s)> VHDL file(s) to be compiled Examples vcom MyDesign.vhd vcom -93 – work /lib/mylib util.vhd vcom -refresh

vsim

Managing Breakpoints

Files

modelsim.ini

modelsim.ini System Initialization or Project file; stores library locations, simulator resolution, paths, etc. modelsim.tcl Window sizes, positions, colors, etc.; user Tcl/Tk code startup.do Default name of macro executed after design is loaded See "startup=" line in modelsim.ini transcript Default filename that ModelSim transcript window activity is saved to vsim.wlf Default name of simulation log file saved by VSIM my_project.mpf Model Sim project file

Copy modelsim.ini to current directory Execute vmap -c Loading order (stops after finding first file)

  1. $MODELSIM environment variable
  2. Current directory if $MODELSIM is not set
  3. In /<install_dir>/modeltech/ directory
  4. In /<install_dir>/modeltech directory For Detailed Information see: ModelSim User’s Manual "ModelSim Variables"

modelsim.tcl

Loading order Always loads: /<install_dir>/modeltech/tcl/vsim/pref.tcl Loads the first found from:

  1. $MODELSIM_TCL if it exists (":" separated list) (all files in list are loaded)
  2. Current directory ./modelsim.tcl
  3. $HOME/modelsim.tcl

Environment Variable Examples MODELSIM_TCL #Print the string length of "Hello, World!" Online Documentation set len [string length "Hello, World!" ] Help->Tcl Help echo "Hello, World! is $len characters long!" Help->Tcl Syntax #Create a button in the wave window that does something Help->Tcl Man Pages apply_button_adder wave controls right red white SayHi {echo hi} Help->Technotes->MTI_Widgets #Display the Tcl/Tk source code to apply_button_adder Language Syntax info body apply_button_adder command arg1 arg2 arg3 … #Set the right mouse button to execute "drivers" on selected signal Language Syntax: Commands bind .signals.tree <Button-3> { set set signalnum [.signals.tree index anchor] expr set signalline [.signals.tree get2 $signalnum] exec set signalname [lindex $signalline 0] info

VHDL

IEEE 1076-

IEEE 1076-

VITAL 2.2b & ‘ 95 Verilog IEEE Std 1364- PLI 1. Timing SDF 1.0, 2.0, & 2. Value Change Dump VCD for Verilog and VHDL

Paper and Online (see docs sub-directory) Start Here se_start.pdf User’s Manual se_man.pdf Command Reference se_cmds.pdf ModelSim Tutorial se_tutor.pdf Technical Notes www.model.com/support/technote/index.html See <install_dir>/modeltech/docs/technotes Company Periodical ModelUser (req via [email protected]) ModelSim Help Pulldown Help > Release Notes Help > Tcl Man Pages Training http://www.model.com/support/training.html This Quick Guide http://www.model.com/pdf/se_guide.pdf

bp Sets a breakpoint; without arg shows all bps bd Deletes a breakpoint disablebp Turn off all breakpoints onbreak Define what to do when a breakpoint is hit during a macro (e.g., onbreak {resume}) when Perform actions under certain conditions Examples bp alu.vhd 147 {do macro.do} Set breakpoint bd alu.vhd 147 Clear breakpoint when – label when1 {clk’event and b="01100111"} { echo "Signal c is [examine – bin c]" stop } Use "when" to show the current whens.

Copyright © 2000, Model Technology Incorporated Reproduction Permitted (and encouraged!) 1020-