The S2MM code (s2mm.cpp) is simple and as follows:
void s2mm(ap_int<32>* mem, hls::stream<ap_axis<32, 0, 0, 0> >& s, int size) {
for(int i = 0; i < size; i++) {
ap_axis<32, 0, 0, 0> x = s.read();
mem[i] = x.data;
}
The “s” is the AXI-Stream input to HLS kernel and “mem” is the AXI-MM output from the kernel. “for” loop input the data AXI-Stream data and generates AXI-MM data.
To compile the above code, we will use v++ -c –mode hls command:
v++ -c --mode hls --platform $(PLATFORM) --config s2mm.cfg
The above command will generate a HLS kernel s2mm.xo.
Next Chapter: Create a host application using AMD VCK190 platform
Copyright © 2020–2025 Advanced Micro Devices, Inc.