Re: [myhdl-list] Conversion error: Type mismatch with earlier assignment
Brought to you by:
jandecaluwe
From: Josy B. <jos...@gm...> - 2015-09-08 12:07:40
|
Hi Guy, > I believe this has something to do with how name assignment works in Python. There's a section about this in the manual at http://docs.myhdl.org/en/stable/manual/conversion.html#intbv-objects > > > My only criticism is that if you do it wrong (e.g. forget the "[:]"), you get an error message that is of little help to debug the issue. > Thanks for pointing this out. I guess the error code could be extended to include "Did you forget [:]?" Assuming this error code only applies to exactly this case (it probably does). I experimented a bit and found out I was wandering astray somewhat. Using an intbv assignment without the [:] would bind the name to another object. Using [:] avoids this and updates the actual intbv object itself. Now I still am struggling a bit with the idea of having to use [:] on the LHS of the assignment especially as you don't have to when using an Augmented Assign (e.g. +=). I now also understand/recall avoiding this error by converting the arguments into integers in my code. Regards, Josy |