[myhdl-list] Newbie problem with instances()
Brought to you by:
jandecaluwe
|
From: Georg A. <ac...@in...> - 2009-03-30 17:04:44
|
Hi,
I'm trying to run the Turbo-decoder-project from opencores unter MyHDL 0.6
(on Unbuntu 8.04).
But it simply doesn't produce any data, because all the internal instances
are not running. Although not very familiar with MyHDL (nor Python) I
simplified the code down to this:
from myhdl import *
def clkGen(clk, duration_1 = 10, duration_2 = 10):
print "clkgen start"
while 1:
yield delay(duration_1)
print "j"
clk.next = not clk.val
yield delay(duration_2)
print "k"
clk.next = not clk.val
def subunit():
clk = Signal(bool(0))
instance_0=clkGen(clk)
print "instance0 = ",instance_0
i=instances()
print "instances = ",i
return i
x=subunit();
print "subunit = ",x
sim = Simulation(x)
sim.run(100)
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?
--
Georg Acher, ac...@in...
http://www.lrr.in.tum.de/~acher
"Oh no, not again !" The bowl of petunias
|