docs/simulator: improve explanation for resetting the simulation.
This commit is contained in:
parent
6a2e789333
commit
86fdaba2db
|
@ -57,11 +57,8 @@ class Simulator:
|
|||
|
||||
.. note::
|
||||
|
||||
Resetting the simulator can also be used to amortize the startup cost while validating
|
||||
a large design with many short test. In this case, instead of adding new testbenches,
|
||||
the behavior of the already added testbenches would be modified for each of the tests.
|
||||
|
||||
It can also be used to capture waveforms only for simulations that encounter an error.
|
||||
Resetting the simulator can also be used to amortize the startup cost of repeatedly
|
||||
simulating a large design.
|
||||
|
||||
Arguments
|
||||
---------
|
||||
|
|
|
@ -88,6 +88,17 @@ The captured data is saved to a :abbr:`VCD` file :file:`example1.vcd`, which can
|
|||
]
|
||||
}
|
||||
|
||||
The :meth:`Simulator.reset` method reverts the simulation to its initial state. It can be used to speed up tests by capturing the waveforms only when the simulation is known to encounter an error:
|
||||
|
||||
.. testcode::
|
||||
|
||||
try:
|
||||
sim.run()
|
||||
except:
|
||||
sim.reset()
|
||||
with sim.write_vcd("example1_error.vcd"):
|
||||
sim.run()
|
||||
|
||||
|
||||
Testing synchronous circuits
|
||||
++++++++++++++++++++++++++++
|
||||
|
|
Loading…
Reference in a new issue