24.03.2013 Views

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ModelSim</strong> modes of operation<br />

<strong>ModelSim</strong> modes of operation UM-27<br />

Many users run <strong>ModelSim</strong> interactively–pushing buttons <strong>and</strong>/or pulling down menus in a<br />

series of windows in the GUI (graphical user interface). But there are really three modes of<br />

<strong>ModelSim</strong> operation, the characteristics of which are outlined in the following table.:<br />

<strong>ModelSim</strong> use mode Characteristics How <strong>ModelSim</strong> is invoked<br />

GUI interactive; has graphical<br />

windows, push-buttons,<br />

menus, <strong>and</strong> a comm<strong>and</strong> line in<br />

the transcript.<br />

Default mode.<br />

Comm<strong>and</strong>-line interactive comm<strong>and</strong> line; no<br />

GUI.<br />

Batch non-interactive batch script;<br />

no windows or interactive<br />

comm<strong>and</strong> line.<br />

Comm<strong>and</strong>-line mode<br />

The <strong>ModelSim</strong> User’s <strong>Manual</strong> focuses primarily on the GUI mode of operation. However,<br />

this section provides an introduction to the Comm<strong>and</strong>-line <strong>and</strong> Batch modes.<br />

In comm<strong>and</strong>-line mode <strong>ModelSim</strong> executes any startup comm<strong>and</strong> specified by the Startup<br />

(UM-534) variable in the modelsim.ini file. If vsim (CR-373) is invoked with the -do<br />

"comm<strong>and</strong>_string" option, a DO file (macro) is called. A DO file executed in this manner<br />

will override any startup comm<strong>and</strong> in the modelsim.ini file.<br />

During simulation a transcript file is created containing any messages to stdout. A transcript<br />

file created in comm<strong>and</strong>-line mode may be used as a DO file if you invoke the transcript<br />

on comm<strong>and</strong> (CR-286) after the design loads (see the example below). The transcript on<br />

comm<strong>and</strong> writes all of the comm<strong>and</strong>s you invoke to the transcript file. For example, the<br />

following series of comm<strong>and</strong>s results in a transcript file that can be used for comm<strong>and</strong> input<br />

if top is re-simulated (remove the quit -f comm<strong>and</strong> from the transcript file if you want to<br />

remain in the simulator).<br />

vsim -c top<br />

library <strong>and</strong> design loading messages... then execute:<br />

transcript on<br />

force clk 1 50, 0 100 -repeat 100<br />

run 500<br />

run @5000<br />

quit -f<br />

via a desktop icon or from the OS comm<strong>and</strong> shell<br />

prompt. Example:<br />

OS> vsim<br />

with -c argument at the OS comm<strong>and</strong> prompt. Example:<br />

OS> vsim -c<br />

at OS comm<strong>and</strong> shell prompt using "here document"<br />

technique or redirection of st<strong>and</strong>ard input. Example:<br />

C:\ vsim vfiles.v outfile<br />

Rename transcript files that you intend to use as DO files. They will be overwritten the next<br />

time you run vsim if you don’t rename them. Also, simulator messages are already<br />

commented out, but any messages generated from your design (<strong>and</strong> subsequently written<br />

to the transcript file) will cause the simulator to pause. A transcript file that contains only<br />

valid simulator comm<strong>and</strong>s will work fine; comment out anything else with a "#".<br />

<strong>ModelSim</strong> <strong>SE</strong> User’s <strong>Manual</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!