The design follows a typical image processing pipeline:
ReadFromMem: Reads image data and filter coefficients from global memory.
Window2D: Constructs a sliding window of pixels for convolution.
Filter2D: Applies the convolution filter to each window.
WriteToMem: Writes the processed pixels back to global memory.
flowchart LR
M[Global Memory] --> R[ReadFromMem]
R -->|coeff_stream| C[Window2D]
R -->|pixel_stream| C
C -->|window_stream| F[Filter2D]
F -->|output_stream| W[WriteToMem]
W --> M
The top-level function Filter2DKernel orchestrates the pipeline stages. To improve throughput, the design is organized using #pragma HLS dataflow, which decomposes the computation into producer–consumer tasks connected by streams/FIFOs so that different stages can run concurrently (downstream stages can begin as soon as upstream data becomes available). At this point, dataflow is enabled, but the design does not yet apply any performance pragma. For dataflow region coding style and best practices, see UG1399.