Re: [myhdl-list] Conversion error: Type mismatch with earlier assignment
Brought to you by:
jandecaluwe
From: Josy B. <jos...@gm...> - 2015-09-07 19:36:32
|
Hi Guy, I studied this a bit deeper and went looking for some 'variable' examples in the MyHDL doc and found this one: def bin2gray(B, G, width): """ Gray encoder. B -- input intbv signal, binary encoded G -- output intbv signal, gray encoded width -- bit width """ @always_comb def logic(): Bext = intbv(0)[width+1:] Bext[:] = B for i in range(width): G.next[i] = Bext[i+1] ^ Bext[i] return logic And to my surprise it uses the [:] ... So it may not be a bug, as it is actually _documented_ behaviour ... But I maintain that it is inconsistent because e.g.: if I change count_v = count_v + 1 into: count_v += 1 the conversion will pass without errors. Regards, Josy |