Re: [myhdl-list] List Of Constants
Brought to you by:
jandecaluwe
From: Josy B. <jos...@gm...> - 2015-03-18 16:54:39
|
> > x = [Signal(intbv(...) ...] > > b = tuple(map(int, [round(1/N*xmax) for ...])) > > > > def sop(N, x, b ): > > <at> always_seq(clock.posedge, reset=reset) > > def sop(): > > ssum = 0 > > for ii in range(N): > > ssum = ssum + x[ii] * b[ii] > > y.next = ssum > > return sop > > > > No, even with the enhancement request the above would > not be converted because the index is not constant. > For that to be convertible the loop would need to be > unrolled. > <snip> Chris, did you trick me? :) I overlooked that fact. Aren't the two codes doing the same in the end? Or perhaps the second doesn't convert? In my code a loop would, almost always, be unrolled or rather be replaced by a, probably pipelined, tree-structure so the indexes would become constants. Best regards, Josy |