Re: [myhdl-list] AttributeError in 0.8-dev but not in 0.7
Brought to you by:
jandecaluwe
From: Per K. <bas...@gm...> - 2013-01-24 11:50:19
|
Hi! I have dug a little deeper, and it has to do with using Signal(bool(False)) and Signal(intbv(0)[1:0]). If I use only the latter and make all comparisons explicit ("if flag==1" instead of just "if flag") the AttributeError goes away. I have also seen that even if I don't get the attribute error there are simulation mismatches between the verilog and the myhdl when intbv and bool are mixed. I've seen this discussed on the boards before, and I think it is obvious that we need to support "if not flag:"-like syntax. It makes the code easier to read, and it works in both python and verilog. /Per On Wed, Jan 23, 2013 at 11:15 PM, Per Karlsson <bas...@gm...>wrote: > Hi! > There is probably something fishy about the lines 184-192 in _Signal.py in > 0.8dev > With 0.8-dev I get: > File [...]/_Signal.py", line 195, in _update > self._val._val = next._val > AttributeError: 'bool' object has no attribute '_val' > With 0.7 it works fine. Also toVerilog works fine in both 0.7 and 0.8-dev > and iverilog cosimulation passes. > > I have not been (immediately) able to reproduce the error outside of the > project (which I'm afraid I can't show you), but I have pinpointed the > lines that cause the error. They are perfectly ordinary. (if b==0: a.next = > 1 basically) > > When I debug I see that 'next' is a bool and val is an 'intbv', whereas > normally both are 'intbv'. > > I know this is a bit vague, but perhaps Jan can recall what he was doing > in May 2011 and figure it out. :) > /Per > > ps. Anyone got any general tips for myhdl debugging? > |