Hi, I am using Pynq- Z2 with image v2.7.
I want to rebuild some projects from pynq community. But, most of them were deployed on older versions where Xlnk was there. But, now I cannot use their codes.
I got to know that now we have allocate() in place of Xlnk.
But, not sure exact syntax. Can anyone help how can I change the older code to get it working now.
xlnk = Xlnk()
self.library = library
self.xlnk = Xlnk()
def copy_array(self, x, dtype=np.int32):
“”“Copy numpy array to contiguous memory.
Input numpy array, not necessarily in contiguous memory.
dtype : type
Data type for the give numpy array.
Physically contiguous memory.
size = x.shape
data_buffer = self.xlnk.cma_array(shape=size, dtype=dtype, cacheable=self.cacheable)
np.copyto(data_buffer, x.astype(dtype), casting=“unsafe”)