ELEC4200 Digital System Design

Modesim Tips & Tricks

Professor: Charles E. Stroud

Tutorial by: Jie Qin

 

1) If no time units are given in the force and run statements, the default time units will be used for simulation. However, this could be very inconvenient sometimes. Under such a circumstance, we can specify the time units in the statements. The allowed time units include

 

fs: 10-15 second
ps: 10-12 second
ns: 10-9 second
us: 10-6 second
ms: 10-3 second
s: 100 second

 

It should be noted that at least a space is required to precede the time units as listed in the following examples. In this example, the three inputs will be square waves with 50% duty cycle where Sel has a period of 40us, Din0 has a period of 80ns, and Din1 has a period of 160ns. After the 3 force statement, the run statement will ask Modelsim to run a simulation of 200 ms.

 

force Sel 0 0, 1 20 us -repeat 40 us
force Din0 0 0, 1 40 ns -repeat 80 ns
force Din1 0 0, 1 80 ns -repeat 160 ns
run 200 ms

 

2) It is often desired that the Modelsim can restart the simulation from the time 0 after that simulation has been executed for a certain time. This can be done by simply click a icon circled in the following figure.

 

 

This task can also be accomplished by a restart statment.

restart