How to insert vector shape in a buffer using PYNQ board Z1

Hi @Abdul_Wahab,

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.

https://pynq.readthedocs.io/en/latest/pynq_libraries/allocate.html#allocate

So, you can assign a numpy array to the input_buffer, for instance the code below will generate integers from 0 to 299

 input_buffer[:] = numpy.arange(0, 300, dtype=numpy.uint32)

You should be able to find plenty of documentation about numpy on the web.

Mario

2 Likes