Re: [myhdl-list] Reusability and encapsulation
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2015-05-06 18:06:16
|
On 5/6/2015 12:58 PM, Juan Pablo Caram wrote: > Oh, sorry, I didn't actually run your notebook. I just didn't (and still > don't) see the difference between my code and yours. > > I'm not explicitly using _SuspendSimulation or StopSimulation. I don't know > why the simulation "stops" with _SuspendSimulation instead of > StopSimulation. It's stopping at the end of the specified time in > sim.run(stoptime). Understand, _SuspendSimulation and StopSimulation are the internal exceptions (state) for the simulator. When you run the simulator for a specific period of time: sim = Simulation(tb()) sim.run(100) The simulator suspends so that it can resume: sim.run(100) In my example I did not define a number of simulation steps to run (the argument to run). When no duration is specified the simulation runs until there are no more events or StopSimulation is raised. Restarting the simulator in the second condition works fine but restarting in the first has an issue. > > Okay, now I see it. At the completion of simulation time _SuspendSimulation > is raised to exit (this is the bug?). You explicitly use StopSimulation. The raising of _SuspendSimulation is not the bug, the bug is when a new simulation instance is created after a suspend. Regards, Chris |