Connect SODA stencil node with FIFO channels in VHLS backend
Closed this issue · 2 comments
hecmay commented
Problem Description
The .stencil()
primitive generates a Stencil
IR node in HCL program, which will later be handled SODA compiler to generate high performance stencil kernels with optimized dataflow architecture. Here is an example of usage:
def jacobi(input_image, output_image):
def jacobi_kernel(y, x):
return (input_image[y+1, x-1] +
input_image[y , x ] +
input_image[y+1, x ] +
input_image[y+1, x+1] +
input_image[y+2, x ]) / 5
return hcl.update(output_image, jacobi_kernel, name=output_image.name)
s = hcl.create_schedule([input_image, output_image], jacobi)
s[jacobi.output].stencil()
The generated HLS code:
void default_function(float input[480][640], float output[480][640]) {
#include "soda_stencil.h"
soda_input_output_kernel(input, output);
}
Right now, stencil kernel takes arrays as input arguments by default. The goal to generate stencil kernel with hls::stream input and outputs when .stencil()
primitive is used along with to()
for the stencil stage.
Target
Expected input program
s = hcl.create_schedule([input_image, output_image], jacobi)
s[jacobi.output].stencil()
s.to(x, s[jacobi.output])
s.to(jacobi.output.y, output)
Expected output
void default_function(hls::stream<float>& input, hls::stream<float> &output) {
#include "soda_stencil.h"
soda_input_output_kernel(input, output);
}