Re: [myhdl-list] Module uses globals
Brought to you by:
jandecaluwe
From: Henry G. <he...@ca...> - 2015-04-20 20:50:04
|
On 19/04/15 16:36, Christopher Felton wrote: > On 4/16/15 3:11 AM, Henry Gomersall wrote: >> >On 15/04/15 21:29, Christopher Felton wrote: >>> >><snip> >>>>>>>>> >>>>>>>> >>>>>>>>> >>>>>>>>This totally defeats the beauty of object orientation in Python. For >>>>>>>>> >>>>>>>>example you cannot have two instances of a Simulation() at the same time. >>>>>>> >>>>>> >>>>>>> >>>>>>What is the rationale for more than one simulation >>>>>>> >>>>>>running at a time? Why have two simulators running? >>>>>>> >>>>>> >>>>> >>>> >>>>> >>>>What is great about having a HDL simulation within a full blown language >>>>> >>>>like Python is the possibility of doing unconventional things. Some that I >>>>> >>>>can think of are, first, running a same model in delayed and asynchronous >>>>> >>>>versions, with a controlled, time varying delay and comparing states. >>> >>Sure, folks have experiment with aysnc simulations before >>> >>but did not require two simulation instances. >>> >> >> > >> >One thing that is quite hard to do is making blocking calls without >> >pausing the simulator. It is always possible to run the blocking code in >> >its own thread with polling on every tick, but there is plausibly a neat >> >model with separate simulations representing entities that are not >> >synchronous to one another. > In my opinion, you would not want to make "blocking" > calls because you are mixing the thread scheduling and > the simulator scheduling - bad idea. Sometimes (as in the example given of interacting with a spice simulator), one's approach might be limited. Cheers, Henry |