Hello, I am new to the PYNQ board and I am following a tutorial to send data to the PYNQ board.
In the tutorial, it has initialized random number to insert into the input buffer as an input but I want to initialize a 300 cross-sectional vector Vector1 =[1,2,3…300] into an input buffer. But not sure how can I do that? Here it few lines of code.
from pynq import Overlay
ol = Overlay("./dma_tutorial.bit")
ol.ip_dict
ol.axi_dma
dma = ol.axi_dma
dma_send = ol.axi_dma.sendchannel
dma_recv = ol.axi_dma.recvchannel
from pynq import allocate
import numpy as np
data_size = 300
input_buffer = allocate(shape=(data_size,), dtype=np.uint32)
Initialize the buffer with random values
for i in range(data_size):
input_buffer[i] = i + 0xcafe0000
Please guide me how can I change the buffer initial values into a real vector values?
pynq.allocate returns a pynq.Buffer. This buffer is a numpy array for use with other Python libraries. Any array that you can generate with numpy can be used to fill the pynq.Buffer.