Introduction
Field-Programmable Gate Arrays (FPGAs) provide a platform for massive parallelism, yet the complexity of hardware description languages (HDLs) like Verilog remains a significant barrier to entry. High-Level Synthesis (HLS) tools address this by compiling C/C++ code into hardware. However, standard HLS tools typically produce a "Finite State Machine with Datapath" (FSMD) architecture. This rigid structure executes in lockstep; if a single memory access stalls due to a cache miss, the entire compute engine stops. Consequently, HLS-generated hardware often struggles with memory jitter, sometimes performing worse than a general-purpose CPU.
The Dataflow Architectural Template
To overcome the limitations of FSMD, this research proposes a novel HLS flow that maps programs onto a Dataflow Architectural Template. Instead of a single monolithic block, the compiler partitions the program's Control Data Flow Graph (CDFG) into multiple independent stages connected by FIFO buffers.
The partitioning process follows three primary heuristics:
- Preserve Recurrences: Strongly Connected Components (SCCs) are kept within a single stage to maintain loop initiation intervals.
- Isolate Memory: Memory operations are separated from long-latency compute operations (e.g., floating-point math).
- Localize Stalls: The number of memory operations per stage is minimized to prevent a single stall from propagating immediately across the entire system.
Each resulting subgraph is converted into synthesizable C code and processed by standard HLS tools like Xilinx Vivado HLS. The asynchronous nature of the FIFO-connected stages allows the system to continue processing even when specific stages are waiting on memory.
Hiding Memory Latency
The core advantage of this decoupled architecture is its ability to "hide" memory latency. In a traditional static schedule, a cache miss creates a bubble that halts all subsequent operations. In the dataflow template, while a "fetch" stage might be stalled waiting for DRAM, a downstream "compute" stage can continue working on data already present in its input FIFO.
As shown in the execution schedule comparison, the dataflow architecture effectively "shadows" stalls. For throughput-oriented kernels like Sparse Matrix-Vector Multiply (SpMV), the long latency of floating-point operations provides a buffer that absorbs memory jitter, provided the average memory bandwidth remains sufficient.
Experimental Results
The authors evaluated the flow using four kernels: SpMV, Knapsack, Floyd-Warshall, and Depth First Search (DFS). The accelerators were implemented on a Xilinx Zynq-7000 SoC.
- Performance Gains: For kernels with significant memory-compute decoupling potential (SpMV, Knapsack, Floyd-Warshall), the dataflow accelerators achieved an average 8.4x speedup over conventional HLS-generated hardware.
- CPU Comparison: The proposed flow produced hardware 2.3x faster than the onboard ARM Cortex-A9 processor. Standard HLS tools, by contrast, often produced hardware slower than the CPU for these memory-intensive tasks.
- Limitations: The approach did not yield gains for DFS. The "pointer-chasing" nature of DFS creates tight dependency cycles through memory, preventing effective decoupling and highlighting that the template is best suited for streaming or throughput-oriented tasks.
Conclusion
By introducing an intermediate dataflow mapping step, this HLS flow significantly improves the resilience of FPGA hardware to memory latency. While it introduces some area overhead due to FIFO buffers and additional controllers, the resulting performance boost—averaging 5.6x across suitable benchmarks—makes it a compelling alternative to traditional FSMD-based synthesis for memory-intensive applications.
Summary updated