Is there an example using AXI with HLS on the PL and transferring data from the PS?

Is there an example that lets me transfer a list of data from the PS to the PL and then process it?

Essentially, I would like to use the tutorial on creating an overlay from here Create a custom PYNQ overlay for PYNQ-Z1 - FPGA Developer and the docs, but use streams or lists of data instead of a single value for inputs.

I looked at pynq.allocate which explains the PS side, but not the PL.

Thanks!

See section 4 here:

Cathal

The examples use Xlnk. The documentation says to use pynq.allocate. I was looking for an example that uses pynq.allocate. Thanks!

This should be good enough:Allocate — Python productivity for Zynq (Pynq)

The above doc explains how ot use the API. For the complete example, either use Cathal’s example, or something like: https://github.com/Xilinx/PYNQ-HelloWorld/blob/master/boards/Pynq-Z1/resizer/notebooks/resizer_PL.ipynb

You just have to replace the xlnk calls;

xlnk = Xlnk()
in_buffer = xlnk.cma_array(shape=(old_height, old_width, 3), 
                           dtype=np.uint8, cacheable=1)
out_buffer = xlnk.cma_array(shape=(new_height, new_width, 3), 
                            dtype=np.uint8, cacheable=1)

to the API mentioned at the beginning.

Thanks. Replacing the xlnk calls with allocate is straightforward. Is there a way to get feedback about the status of memory and buffer? I am looking at these calls from the Pynq workshop session 2, lab 2:

def get_kb(mmu):
return int(mmu.cma_stats()[‘CMA Memory Available’]//1024)

def get_bufcount(mmu):
return int(memmanager.cma_stats()[‘Buffer Count’])

def print_kb(mmu):
print("Available Memory (KB): " + str(get_kb(mmu)))

You can probably poke registers based on the DMA axi lite interface.

For now, you can still use Xlnk to get the CMA status, or use /proc/meminfo

!cat /proc/meminfo | grep Cma

E.g.

CmaTotal:         131072 kB
CmaFree:           57724 kB

Cathal