I am trying to implement compression in Vivado HLS and am struggling to get the right data flow model. The pseudo-code is something like
read (input_stream, frame); // Read an input stream into a frame buffer
process (hist, symbols, frame); // Compute, buffer and histogram the symbols
// to be compressed.
// The histograms are the basis of the
// compression tables.
NFrames += 1;
if (NFrames == 1024)
compress(output_stream, hist, symbols) // Every 1024 frames, do the compression
The reading and processing happens every new frame. (A frame is 128 channels of 12-bit ADCs.) I need the reading and processing to overlap via a #pragma HLS DATAFLOW, whereas the compression stage only happens every 1024th frame and it must overlap the reading and processing.
Doing the naive thing, I wind up with what looks like frame, symbols, and hist all being ping-ponged on each read of a frame. What I want is the frame to be ping-ponged on every read of a frame, but the symbol buffer and the histogram only ping-ponged every 1024th frame.
Is there an HLS example out there that comes close to this pattern? This seems like it should be common. (Experimenting is hard. I've had the synthesis take anywhere from 10 minutes to 10 hours. It is kind Russian Roulette.)