[myhdl-list] always_comb problem
Brought to you by:
jandecaluwe
From: David B. <dav...@fr...> - 2004-10-21 15:00:42
|
Hello, In the following code: -------------------------------------------------------------------------= - from myhdl import intbv, Signal, Simulation, instances, delay, always_com= b def test(a, b): c =3D intbv(2) def testFunc(): b.next =3D a.val + c print b.val, a.val return always_comb(testFunc) def a_gen(a): while 1: yield delay(10) a.next =3D a.val + 1 def top(): a =3D Signal(intbv(0)) b =3D Signal(intbv()) test_i =3D test(a, b) a_gen_i =3D a_gen(a) return instances() top_inst =3D top() sim =3D Simulation(top_inst) sim.run(100) -------------------------------------------------------------------------= - It seems that the "always_comb" function doesn't like the "print" in the = "test" function. If I use the "while 1 - yield" structure it works fine, but it = would be nice to be able to use "always_comb" and still be able to insert debug functions inside the code. Regards, David. |