The question is how to use a hls function’s input and output variables that are pointers from a Pynq/Jupyter.
I know how to perform the exercise with non-pointers.
I’ve built the xilinx example interface_axi_lite.
#include <stdio.h>
void example(char *a, char *b, char *c)
{
#pragma HLS INTERFACE s_axilite port=a bundle=BUS_A
#pragma HLS INTERFACE s_axilite port=b bundle=BUS_A
#pragma HLS INTERFACE s_axilite port=c bundle=BUS_A
#pragma HLS INTERFACE s_axilite port=return bundle=BUS_A
*c += *a + *b;
}
In Vivado, I added it to a block design (named it add_to_self, built the bitfile and the .hwh file, uploaded to a PYNQ-Z2
I created a Jupyter book and loaded the bitfile:
Loading the bitfile works, and the registers for the add_to_self function show:
overlay=Overlay("adder.bit")
add_to_self_ip=overlay.add_to_self
add_to_self_ip.register_map
Output:
RegisterMap {
CTRL = Register(AP_START=0, AP_DONE=0, AP_IDLE=1, AP_READY=0, RESERVED_1=0, AUTO_RESTART=0, RESERVED_2=0),
GIER = Register(Enable=0, RESERVED=0),
IP_IER = Register(CHAN0_INT_EN=0, CHAN1_INT_EN=0, RESERVED=0),
IP_ISR = Register(CHAN0_INT_ST=0, CHAN1_INT_ST=0, RESERVED=0),
a = Register(a=0, RESERVED=0),
b = Register(b=0, RESERVED=0),
c_i = Register(c_i=0, RESERVED=0),
c_o = Register(c_o=0, RESERVED=0),
c_o_ctrl = Register(c_o_ap_vld=0, RESERVED=0
Now my question: how do I execute this function where a, b, c_i and c_o are pointers, from python/Jupyther?