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.

`timescale, -t, <strong>and</strong> rounding<br />

Simulating Verilog designs UM-131<br />

The optional vsim argument -t sets the simulator resolution limit for the overall simulation.<br />

If the resolution set by -t is larger than the precision set in a module, the time values in that<br />

module are rounded up. If the resolution set by -t is smaller than the precision of the<br />

module, the precision of that module remains whatever is specified by the `timescale<br />

directive. Consider the following code:<br />

`timescale 1 ns / 100 ps<br />

module foo;<br />

initial<br />

#12.536 $display<br />

The list below shows three possibilities for -t <strong>and</strong> how the delays in the module would be<br />

h<strong>and</strong>led in each case:<br />

-t not set<br />

The delay will be rounded to 12.5 as directed by the module’s ‘timescale directive.<br />

-t is set to 1 fs<br />

The delay will be rounded to 12.5. Again, the module’s precision is determined by the<br />

‘timescale directive. <strong>ModelSim</strong> does not override the module’s precision.<br />

-t is set to 1 ns<br />

The delay will be rounded to 12. The module’s precision is determined by the -t setting.<br />

<strong>ModelSim</strong> has no choice but to round the module’s time values because the entire<br />

simulation is operating at 1 ns.<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.<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!