Re: [myhdl-list] Simulation control
Brought to you by:
jandecaluwe
From: Henry G. <he...@ca...> - 2015-04-06 07:47:12
|
On 05/04/15 23:22, Juan Pablo Caram wrote: > 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? It's not totally clear to me what you're trying to do, but I'm yet to be convinced it isn't possible, and certainly yet to be convinced that having programmatic access to a debugging layer would be better than doing it all inside MyHDL. You have a stateful spice simulator in a myhdl simulator. The myhdl code flips signals as desired until it needs to wait on the simulator doing something, then it blocks until the spice simulator reaches a suitable state and allows it to continue (let's say, when the virtual ADC flips a bit). Presumably you have inputs and outputs to your spice model? At some point, surely, you need virtual ADCs and DACs, so you're pretty limited in terms of directionality? In which case, you can set inputs as you wish and then block on outputs (or output sets). I don't see the problem with clk - in your clock driver, you just block until the spice simulator has moved to the correct state. Are you trying to do your myhdl logic in an asynchronous way? Or do you want sub-cycle times to be somehow meaningful between spice and myhdl (I don't have any idea what this could be)? If you need to run the spice model and the myhdl simulation concurrently, you can do so in different threads. cheers, Henry |