Re: [myhdl-list] Shadow signals
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2009-06-24 13:19:22
|
On Tue, Jun 23, 2009 at 3:47 AM, Jan Decaluwe <ja...@ja...> wrote: > > Basically I tried to address the problem that some of > you have struggled with: the inflexibility of MyHDL signals. > For example, the fact that signal slices don't behave > as signals. > > It's all documented here: > > http://www.myhdl.org/doku.php/meps:mep-105 > > Feedback welcome! > > Jan I pulled the latest code from the repository this morning and was unable to check if a variable was a "Signal". It looks like the "Signal" changed from a class to a function? What would be the correct approach now to check a variable type (see example below)? Would old code be converted to check type myhdl._Signal versus myhdl.Signal? This change (which is good) would not be backward compatible? My "use case", I have used this in modeling modules. A module might be used outside myhdl environment and will except basic inputs. The same module is used in a testbench and thus the module is flexible to use a Signal or not. Example code that previously was valid. >>> from myhdl import Signal, intbv >>> x = Signal(intbv(0)) >>> isinstance(x, Signal) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types Thanks Chris |