Re: [myhdl-list] Starting with MyHDL and trying to do my Cordic Module
Brought to you by:
jandecaluwe
From: Jan C. <jen...@mu...> - 2014-07-09 10:34:45
|
On 04/07/14 13:33, Christopher Felton wrote: > . . . > > > What is the difference between assigning a value with [:] and > without it? All the intbv values need a [:] ? > > > In Python everything is a reference > > x = intbv(0, min=-4, max=4) > y = intbv(0, min=-8, max=8) > # ... > x = 2 > y[:] = 4 > assert isinstance(x, intbv) # will fail > assert isinstance(y, intbv) # will pass > > The [:] indicates you are updating the value of the intbv type > (updating all the bits). If you didn't do this you would loose > the to > intbv information, because the reference would be assigned to > will start > another type. But in our HDL we need to know the types we are > dealing with (we remove some of the dynamicism :) > > Yes, all "variable" intbv need "[:] = <new value>". Thanks, I'd completely missed this point, even though I've paid close attention to discussions about the use of signals and variables. If I had known this three years ago I might well have finished my novel processor project by now, and would not be living in a house in which all the walls are decorated with skull impressions. Jan Coombs. |