Re: [myhdl-list] Reusability and encapsulation
Brought to you by:
jandecaluwe
From: Henry G. <he...@ca...> - 2015-05-02 21:33:18
|
I just submitted a github issue on this. I suggest adding some to that. Please forgive me, I'm sending this from my phone so it's not easy to check the issue number. The basic problem as far as I can tell is the global state stored in simulator.py and the state that is stored on the signal itself. Possibly your ipython problems would be fixed by the patch I just submitted to clear the state on a new simulation instance. Cheers Henry. On 2 May 2015 20:40:19 BST, Juan Pablo Caram <jp...@gm...> wrote: >Hi, > >I use iPython a lot and need to launch multiple simulations of >different >models (and signals) within the same interpreter. And MyHDL does not >play >nicely with this. > >I've found a way to clean the environment in order to be able to run a >new >simulation: I import > >from myhdl import _simulator >from myhdl import _traceSignals > >in the beginning, and before every simulation (and signal tracing) I >do: > >_simulator._signals = [] >_simulator._siglist = [] >_simulator._futureEvents = [] >_simulator._time = 0 >_simulator._cosim = 0 >_simulator._tracing = 0 >_simulator._tf = None > >_traceSignals._tracing = 0 > >which is what is done upon importing the mentioned files. > >I would love if some re-structuring was done to the code providing >better >encapsulation of variables. It would alleviate a lot of problems that >arise >when trying to build upon the base myhdl library. As it stands, it's >fine >for end-user digital designers, but makes it hard to create software >that >use myhdl as a feature. > >Specifically, moving the above-mentioned variables to Simulation >instances >would be great, and in general, to not have any shared states. > >I would happily contribute towards these changes. I'd rather contribute >to >the project than be implementing my own ad-hoc fixes. > >Thanks, > >JP > > >------------------------------------------------------------------------ > >------------------------------------------------------------------------------ >One dashboard for servers and applications across >Physical-Virtual-Cloud >Widest out-of-the-box monitoring support with 50+ applications >Performance metrics, stats and reports that give you Actionable >Insights >Deep dive visibility with transaction tracing using APM Insight. >http://ad.doubleclick.net/ddm/clk/290420510;117567292;y > >------------------------------------------------------------------------ > >_______________________________________________ >myhdl-list mailing list >myh...@li... >https://lists.sourceforge.net/lists/listinfo/myhdl-list -- Sent from my Android device with K-9 Mail. Please excuse my brevity. |