Thread: [myhdl-list] Suspending/Resuming/Stopping a simulation
Brought to you by:
jandecaluwe
From: Frank P. <pal...@co...> - 2004-07-12 20:27:52
|
Hello, I'm interested in suspending a simulation after a certain event, and = then resuming again, or possibly stopping. The Simulation.run() call works = for a fixed number of cycles. Is there a way that I can use exceptions to do this? I noticed that myhdl uses SuspendSimulation and StopSimulation internally to do this. This might be a nice feature in general. One could write a testbed = which changes based on the simulation results. :) =20 Thanks, Frank |
From: bedros <be...@ya...> - 2004-07-12 20:42:17
|
I use StopSimulation exception frequently if there's an invalid condition in my simulation such as reading from an empty FIFO. eg: if ready_sig and FIFO.empty: raise StopSimulation, "ERROR: reading from empty fifo" I couldn't find anything about SuspendSimulation, not even in MyHDL 0.4 documents. Where did you find it? -Bedros --- Frank Palazzolo <pal...@co...> wrote: > > Hello, > > I'm interested in suspending a simulation after a > certain event, and then > resuming again, or possibly stopping. The > Simulation.run() call works for a > fixed number of cycles. Is there a way that I can > use exceptions to do > this? I noticed that myhdl uses SuspendSimulation > and StopSimulation > internally to do this. > > This might be a nice feature in general. One could > write a testbed which > changes based on the simulation results. :) > > Thanks, > 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 > |
From: Frank P. <pal...@co...> - 2004-07-12 21:10:42
|
>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 |
From: bedros <be...@ya...> - 2004-07-12 21:34:14
|
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. --- 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 > |
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 |