Re: [myhdl-list] Newbie problem with instances()
Brought to you by:
jandecaluwe
|
From: Jan D. <ja...@ja...> - 2009-03-31 17:18:15
|
Georg Acher wrote:
> Hi,
> I'm trying to run the Turbo-decoder-project from opencores unter MyHDL 0.6
> (on Unbuntu 8.04).
>
> If I understand the docs correctly, instances() should return a list of all
> generated instances. So in the example I expect [ instance_0 ] to be returned.
>
> But:
>
> # python main.py
> instance0 = <generator object at 0xb7cf9a0c>
> instances = []
> subunit = []
> <class 'myhdl.StopSimulation'>: No more events
>
> When returning instance_0 in subunit, it works as expected and j/k is
> printed.
>
> The empty instances()-list seems to be the root cause for the failure of the
> turbo decoder...
>
> Am I missing something important here?
You have hit a backwards incompatibility:
http://www.myhdl.org/doc/0.6/whatsnew/0.6.html#instances-function
Only generators produced by MyHDL decorators are now considered by instances().
MyHDL decorators are used as a way to discriminate between "MyHDL generators"
and regular ones. In particular, this makes it possible to use regular
generators in MyHDL models for different purposes. (Users had reported
problems when instances() didn't make this difference.)
That having said, I personally don't like instances() that much. I tend
to return generators explicitly.
Regards,
Jan
--
Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com
Python as an HDL: http://www.myhdl.org
VHDL development, the modern way: http://www.sigasi.com
Analog design automation: http://www.mephisto-da.com
World-class digital design: http://www.easics.com
|