Download ModelSim SE User`s Manual
Transcript
SystemC Simulation
SystemC Object and Type Display
reset = 1;
<-------- Executed only if
run 100 ns or more is issued
from batch or GUI prompt.
sc_start(100, SC_NS);
<-------- Yield to the kernel for another
100 ns
return 1;
<-------- Executed only if
the simulation in run for
more than 200 ns.
}
sc_start(-1) in the OSCI simulator means that the simulation is run until the time it is
halted by sc_stop(), or because there were no future events scheduled at that time. The
sc_start(-1) in means that sc_main() is yielding to the ModelSim simulator until the
current simulation session finishes.
•
Avoid sc_main() going out of scope — Since sc_main() is run as a thread, it must not go
out of scope or delete any simulation objects while the current simulation session is
running. The current simulation session is active unless a quit, restart, sc_stop, $finish,
or assert is executed, or a new design is loaded. To avoid sc_main() from going out of
scope or deleting any simulation objects, sc_main() must yield control to the ModelSim
simulation kernel before calling any delete and before returning from sc_main. In
ModelSim, sc_start(-1) gives control to the ModelSim kernel until the current
simulation session is exited. Any code after the sc_start(-1) is executed when the current
simulation ends.
int
sc_main(int, char*[])
{
top t1("t1");
top* t2 = new top("t2");
sc_signal<int> reset("reset");
t1.reset(reset);
t2->reset(reset);
sc_start(100, SC_NS); <-------- 1st part executed during
construction. yield to the kernel
for 100 ns.
reset = 1;
sc_start(100, SC_NS);
<-------- Will be executed only if
run 100 ns or more is issued
from batch or GUI prompt.
<-------- Yield to the kernel for another 100 ns
sc_start(-1);
<-------- Will cause sc_main() to
suspend until the end of
the current simulation session
delete t2;
<-------- Will be executed at the
end of the current simulation
session.
return 1;
}
314
ModelSim SE User’s Manual, v6.3h
July 2008
Related documents
ModelSim SE User's Manual
ModelSim User's Manual
ModelSim SE User`s Manual
ModelSim User`s Manual
ModelSim SE Reference Manual
ModelSim User's Manual - Electronics and Computer Science
ModelSim SE User`s Manual
ModelSim SE User`s Manual - Electrical and Computer Engineering
ModelSim PE Reference Manual
Command - Electrical and Computer Engineering
ModelSim Reference Manual
Wave Window