[myhdl-list] Re: Suspending/Resuming/Stopping a simulation
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2004-09-14 20:54:03
|
bedros wrote: > you could raise a SuspendSimulation exception and use > "try" in the top level to catch it, fix it, and then > resume the simulation by executing "run" method again. (Sorry for the delayed response.) It's more complicated. First, the run method catches this exception itself. Moreover, it's not intended for users to raise it. The simulation has both "real" time steps and delta time steps. When you suspend, and then continue, no events should be missed. Simply allowing suspends at any moment makes this complicated. For that reason the actual suspend occurs at a well defined moment: at the end of a timestep, after delta cycle convergence, right before real time is increased. Probably the exception should be renamed _SuspendSimulation to make this clear. This also explains why this exception is not documented - you shouldn't use it. The desired functionality could be implemented by introducing a function, e.g. called suspend(), that a user could call. This would set some global variable, and at the right time the run method could then raise an exception that a user could catch. In fact, we would need an exception that a user would not be able to raise, only catch ... and this would have to enforced by code to avoid mistakes. No idea whether this is possible. Doesn't seem obvious, but this is Python :-) Regards, Jan > > > > --- Frank Palazzolo <pal...@co...> wrote: > >>>I couldn't find anything about SuspendSimulation, >> >>not >> >>>even in MyHDL 0.4 documents. Where did you find it? >> >>I just looked in the code...the beauty of open >>source :) >> >>-Frank >> >> >> >> >> > > ------------------------------------------------------- > >>This SF.Net email sponsored by Black Hat Briefings & >>Training. >>Attend Black Hat Briefings & Training, Las Vegas >>July 24-29 - >>digital self defense, top technical experts, no >>vendor pitches, >>unmatched networking opportunities. Visit >>www.blackhat.com >>_______________________________________________ >>myhdl-list mailing list >>myh...@li... >> > > https://lists.sourceforge.net/lists/listinfo/myhdl-list > > > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com -- Jan Decaluwe - Resources bvba - http://jandecaluwe.com Losbergenlaan 16, B-3010 Leuven, Belgium Python is fun, and now you can design hardware with it: http://jandecaluwe.com/Tools/MyHDL/Overview.html |