Hey
So I am using vivado/vitis 2022.2, and have been messing around with a project which I thought would extend this example a little, since the original works very nicely (for me):
The idea is it will just add two vectors together pairwise.
#include "ap_axi_sdata.h"
#include "hls_stream.h"
typedef ap_axiu<32, 0, 0, 0> trans_pkt;
void ssmul(hls::stream< trans_pkt > &INPUT0, hls::stream< trans_pkt > &INPUT1, hls::stream< trans_pkt > &OUTPUT)
{
#pragma HLS INTERFACE axis port=INPUT0
#pragma HLS INTERFACE axis port=INPUT1
#pragma HLS INTERFACE axis port=OUTPUT
trans_pkt data_p;
trans_pkt data_q;
trans_pkt data_r;
INPUT0.read(data_p);
INPUT1.read(data_q);
data_r.data = data_p.data + data_q.data;
OUTPUT.write(data_r);
}
And for the design, my plan was to run automation on the following config:
It compiles nicely all the way through, but stalls in jupyter
This is the notebook:
import time, random, numpy
from pynq import Overlay, allocate, MMIO
import pynq.lib.dma
ol = Overlay('./design_1.bit')
ol.download()
dma0 = ol.axi_dma_0
dma1 = ol.axi_dma_1
length = 10
in_buffer0 = allocate(shape=(length,), dtype=numpy.int32)
in_buffer1 = allocate(shape=(length,), dtype=numpy.int32)
out_buffer = allocate(shape=(length,), dtype=numpy.int32)
samples = random.sample(range(0, length), length)
numpy.copyto(in_buffer0, samples)
numpy.copyto(in_buffer1, samples)
numpy.copyto(out_buffer, samples)
t_start = time.time()
dma0.sendchannel.transfer(in_buffer0)
dma1.sendchannel.transfer(in_buffer1)
dma0.recvchannel.transfer(out_buffer)
dma0.sendchannel.wait()
dma1.sendchannel.wait()
dma0.recvchannel.wait()
t_stop = time.time()
in_buffer0.close()
in_buffer1.close()
out_buffer.close()
print(t_start - t_stop)
Any one got any ideas?