[myhdl-list] Re: shadowing error
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2005-11-21 14:02:41
|
George Pantazopoulos wrote: > Hi Jan, > > I had a module Foo, where I accidentally re-created the signal in_a even > though it was already there as an input. As a result, it used the > "local" in_a which was fixed to 0, and this resulted in incorrect > simulation results. I spent a lot of time debugging before I found my > stupid mistake. It would be nice if myHDL gave an error in this situation. > > def Foo(clk, in_a): > in_a = Signal(bool(0)) # should not be here! > > INST_0 = Bar(clk, in_a, ... ) > return INST_0 > > > Thanks, > George I had expected that pychecker would report this case, where a local assignment shadows a function argument. But unfortunately, it doesn't. If feel this is a general Python code issue, so the best way may be to try to get it into pychecker. toVerilog does flag this case as an error. See also my comments on MyHDL code checking in another thread: very useful, but it will take a while before I can spent time on it personally. Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Losbergenlaan 16, B-3010 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |