Re: [myhdl-list] multidimensional arrays
Brought to you by:
jandecaluwe
|
From: Thomas T. <tho...@de...> - 2008-07-04 08:06:03
|
David wrote:
> I was also wondering, if MyHDL can handle multidimensional arrays
> within Python that will be generated into Verilog?
I am afraid it is not possible directly.
Below is a short test piece. It works for one dimensional arrays but not
for twodimensional.
So for your multidimensional FFT you have to use an big array and deal
with the pointers correspondingly, e.g.
globalptr = ptr + array_no * array_size.
That should be no problem, especially if your array sizes are 2**N. Then
you can use bitshift for the multiplication.
-----------
from myhdl import *
def Arraytest():
a = [[Signal(intbv(i*j)[8:]) for i in range(16)] for j in range(16)]
#a = [Signal(intbv(i)[8:]) for i in range(16)]
#@always(a[0])
@always(a[0][0])
def printer():
print a
return printer
arraytest = Arraytest()
toVerilog(Arraytest)
|