Exact simulation time in ModelSim

J

Jaco Naude

Hi there,

Does anybody know how to measure the exact runtime of a simulation in
ModelSim PE? Also is it possible to measure the time ModelSim takes to
compile a VHDL file?

Thanks for any help
Jaco
 
J

Jonathan Bromley

Hi there,

Does anybody know how to measure the exact runtime of a simulation in
ModelSim PE? Also is it possible to measure the time ModelSim takes to
compile a VHDL file?

Thanks for any help
Jaco

Use the Tcl [time] command to launch your activity
from a ModelSim command prompt, in either command-line
or GUI mode:

set compiletime [time {vcom myfile.vhd}]
set runtime [time {vsim -do "run -all" my_toplevel}]

The resulting strings $compiletime and $runtime will
be of the form

286738 microseconds per iteration

The "per iteration" part is because Tcl's [time] command
allows you to run the command in question more than once,
to get a better estimate: try this at the ModelSim
command line...

time {puts hello} 5

But, for long-running activity like compile and sim,
it will be sufficient to run the command just once.

Of course you can easily massage the result string
using standard Tcl to get the values you want:

regexp {\d+} $compiletime ct_microsecs
set ct_secs [expr {$ct_microsecs / 1000000.0}]
puts [format "Compilation time was %6.4f seconds" $ct_secs]

and so on, ad nauseam.
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
(e-mail address removed)
http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 
H

HT-Lab

Jaco Naude said:
Hi there,

Does anybody know how to measure the exact runtime of a simulation in
ModelSim PE? Also is it possible to measure the time ModelSim takes to
compile a VHDL file?

Hi Jaco,

For simulation use the simstats command which gives you the real cpu time,
you can also use "vsim -printsimstats" which gives the same results. If you
are using Linux/Cygwin then you can also use "time vsim -c ..." or if you
want something more complex looking :)

vsim -c -do "exec ps -ef | grep vsim; run -a; exec ps -ef | grep vsim;
quit -f"

Hans.
www.ht-lab.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top