- board : pynq z1
I have a file “input.npy” which have size of 100x100, and type of np.float32.
this file can be uploaded on dram using buffer write like below.
input_file = np.load('input.npy')
input_dram = allocate(shape=(100, 100), dtype=np.float32)
for i in range(100):
for j in range(100):
input_dram[i][j] = input_file[i][j]
However, this way takes a lot of time if data size gets bigger.
I must use attribute “physical_address” in pynq.buffer.
These two ways delete “physical_address” of “input_dram” when executed.
# way 1
input_dram = allocate(shape=(100, 100), dtype=np.float32)
input_dram = np.load('input.npy')
# way 2
input_file = np.load('input.npy')
input_dram = allocate(shape=(100, 100), dtype=np.float32)
input_dram = input_file.copy()
When printing physical address, the error message said AttributeError: ‘numpy.ndarray’ object has no attribute ‘physical_address’
Is there another way directly upload numpy file on pynq dram?