Re: [myhdl-list] Module uses globals
Brought to you by:
jandecaluwe
From: Juan P. C. <jp...@gm...> - 2015-04-15 19:32:41
|
On Wed, Apr 15, 2015 at 1:23 PM, Christopher Felton <chr...@gm...> wrote: > On 4/11/2015 3:43 PM, Juan Pablo Caram wrote: > > Hi, > > > > I'm starting to learn the internals of MyHDL and I see it's using global > > variables everywhere. > > Those are fighting words ... > Not my intention at all. I apologize if it was perceived that way. > > > > > 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. Another is bifurcation, this is, generating a copy of a model and simulation at some time instant and comparing the two based on some asymmetry, potentially generating copies throughout the simulation and discarding them when not needed. Things like this are useful in stability analysis of non-linear mixed-signal circuits. > > > > > Would this qualify for a bug issue? > > No. > > > > > Maybe there is a bigger architectural problem? Maybe it has to do with > the > > way it uses "inspect"? > > There are all kinds of issues, each simulator instance > could not share generators, this would need to be enforced. > Without fully understanding the internals of MyHDL, my first thought is why Simulation objects have shared context and cannot be fully encapsulated in their class? Second is, wouldn't it be preferable? If so, I'd be interest in contributing towards this. If not, am I proposing something that would fully break the architecture and should better find another route? Thanks, JP |