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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

UM-78 4 - VHDL simulation<br />

Simulating VHDL designs<br />

Simulator resolution limit<br />

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

After compiling the design units, you simulate your designs with vsim (CR-373). This<br />

section discusses simulation from the UNIX or Windows/DOS comm<strong>and</strong> line. You can<br />

also use a project to simulate (see "Getting started with projects" (UM-40)) or the Simulate<br />

dialog box (see "Start Simulation dialog" (GR-76)).<br />

For VHDL invoke vsim (CR-373) with the name of the configuration, or entity/architecture<br />

pair. Note that if you specify a configuration you may not specify an architecture.<br />

This example invokes vsim (CR-373) on the entity my_asic <strong>and</strong> the architecture structure:<br />

vsim my_asic structure<br />

vsim (CR-373) is capable of annotating a design using VITAL compliant models with timing<br />

data from an SDF file. You can specify the min:typ:max delay by invoking vsim with the<br />

-sdfmin, -sdftyp, or -sdfmax option. Using the SDF file f1.sdf in the current work<br />

directory, the following invocation of vsim annotates maximum timing values for the<br />

design unit my_asic:<br />

vsim -sdfmax /my_asic=f1.sdf my_asic<br />

By default, the timing checks within VITAL models are enabled. They can be disabled with<br />

the +notimingchecks option. For example:<br />

vsim +notimingchecks topmod<br />

The simulator internally represents time as a 64-bit integer in units equivalent to the<br />

smallest unit of simulation time, also known as the simulator resolution limit. The default<br />

resolution limit is set to the value specified by the Resolution (UM-533) variable in the<br />

modelsim.ini file. You can view the current resolution by invoking the report comm<strong>and</strong><br />

(CR-244) with the simulator state option.<br />

Overriding the resolution<br />

You can override <strong>ModelSim</strong>’s default resolution by specifying the -t option on the<br />

comm<strong>and</strong> line or by selecting a different Simulator Resolution in the Simulate dialog box.<br />

Available resolutions are: 1x, 10x, or 100x of fs, ps, ns, us, ms, or sec.<br />

For example this comm<strong>and</strong> chooses 10 ps resolution:<br />

vsim -t 10ps topmod<br />

Clearly you need to be careful when doing this type of operation. If the resolution set by -t<br />

is larger than a delay value in your design, the delay values in that design unit are rounded<br />

to the closest multiple of the resolution. In the example above, a delay of 4 ps would be<br />

rounded to 0 ps.<br />

Choosing the resolution<br />

You should choose the coarsest resolution limit possible that does not result in undesired<br />

rounding of your delays. The time precision should not be unnecessarily small because it<br />

will limit the maximum simulation time limit, <strong>and</strong> it will degrade performance in some<br />

cases.

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

Saved successfully!

Ooh no, something went wrong!