Re: [myhdl-list] Simulation control
Brought to you by:
jandecaluwe
From: Juan P. C. <jp...@gm...> - 2015-04-05 22:23:18
|
I don't have a clear idea for the architecture yet, but I suspect it is not that simple (or maybe it is)... This is what I understand you are referring to: def myADC(value): @always(clk.posedge) def logic(): value.next = do_things() And then in do_things() control the spice simulator. In this case, the spice simulator runs "behind" the digital simulation, this is, when myhdl gets to t=ti, stop and sun spice until t=ti. The problem is that I might need to stop for different signals, and having them all call do_things() makes having a centralized control of the mixed-signal simulation environment very complicated. On top of this, how can I know them "time" at which the signal toggle inside the "logic()" function"? I would need that to determine for how long to run the analog simulation. Even worse, what if "clk" came from the analog simulation... I would have to wait for each analog run complete to know when to toggle it, and then manually toggle it. Here, the myhdl simulation would run "behind". For short, I don't think I can implement the control of the whole system from a single "do_things()" function. What do you think? Thanks, JP On Sun, Apr 5, 2015 at 5:43 PM, Henry Gomersall <he...@ca...> wrote: > On 05/04/15 21:06, Juan Pablo Caram wrote: > > I would like to be able to simulate until signal X toggles or changes, > > get the time, run spice until this time is reached, update signals in > > myhdl and spice, resume myhdl simulation, etc. > > > > You can always have your own MyHDL generator instance that does > programmatic control. In each call, it just checks some IO and does > something suitable. Remember, you have the full power of Python > available to the running code. > > So, you just run the simulator forever, handling state changes from > whatever external source you want inside the running code, and then when > you want to stop, raise StopSimulation. It could even be a real physical > source if you wanted :) > > If anything, programmatic control is much easier, since that's what > programming languages are for! > > cheers, > Henry > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, > sponsored > by Intel and developed in partnership with Slashdot Media, is your hub for > all > things parallel software development, from weekly thought leadership blogs > to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list > |