Efficient Compilation and Mapping of Fixed Function Combinational Logic onto Digital Signal Processors Targeting Neural Network Inference and Utilizing High-level Synthesis

Soheil Nazar Shahsavani, Arash Fayyazi, Mahdi Nazemi, Massoud Pedram

TL;DR

This paper introduces a novel framework for accelerating neural networks on FPGAs by transforming neurons into massive Boolean functions and mapping them onto Digital Signal Processors (DSPs) rather than traditional Look-Up Tables (LUTs). By leveraging the underutilized bitwise logic capabilities and SIMD architecture of DSP blocks, the authors achieve significant speedups and overcome the resource bottlenecks that typically prevent large-scale logic-based networks from fitting on a single chip.

What Problem Does This Paper Address?

Recent research has moved toward "logic-based" neural network (NN) inference, where neurons are represented as fixed-function combinational logic (FFCL) blocks. In theory, this allows for ultra-low latency and high efficiency. However, there is a major hardware hurdle: state-of-the-art NNs like VGG16 are so complex that their equivalent Boolean expressions require hundreds of thousands of LUTs—far more than a single FPGA can provide.

While FPGAs also contain specialized DSP blocks, these are traditionally reserved for arithmetic (like multiplication). Existing High-Level Synthesis (HLS) tools often fail to exploit the dynamic programmability of DSPs for general Boolean logic. This paper addresses the "LUT explosion" by providing a systematic way to compile and map these massive Boolean functions onto the high-performance, parallel DSP blocks found in modern FPGAs.

Methods

The authors propose a three-stage framework to bridge the gap between high-level NN specifications and low-level DSP hardware:

  1. Pre-processing: The framework uses the NullaNet tool to convert a trained NN into a Verilog netlist of combinational logic. It then employs standard logic synthesis tools (like ABC and Yosys) to minimize gate count and "levelize" the circuit, determining which operations can be executed simultaneously.
  2. Compiler: The mapped netlist is decomposed into "sub-kernels." Since a single FPGA has a finite number of DSPs, the compiler schedules operations across multiple cycles. It also handles I/O assignments, determining exactly where in memory (BRAM/URAM) each input and output should reside.
  3. SDAccel Code Generator: The framework generates synthesizable C++/RTL code. Crucially, it uses a hybrid approach: HLS templates for high-level control and data movement, combined with RTL "black-boxing" to explicitly map Boolean operations to the DSP blocks.

![Fig.

  1. An overview of the proposed framework.](/figures/art_3b72a7fc98d54d1fb553dbbca4a824d2)

The hardware architecture (shown in Figure 3) utilizes a Single Instruction, Multiple Data (SIMD) scheme. Each DSP block can perform 48-bit bitwise logic operations (AND, OR, XOR, etc.) in parallel, significantly boosting throughput.

![Fig.

  1. The hardware architecture used in this paper. CU is the computational unit.](/figures/art_dfaf861b367546549dde7374d8410eb1)

Datasets

The framework was evaluated using two standard computer vision benchmarks:

  • CIFAR-10: Used to test the VGG16 network architecture.
  • MNIST: Used to test the LeNet-5 network architecture.

Key Insights and Ideas

  • DSPs as Logic Engines: The core "aha" moment is treating DSPs not just as multipliers, but as 48-bit wide bitwise logic units. This allows one DSP to replace dozens of LUTs for specific logic tasks.
  • The Pipelining Balance: The authors discovered that performance isn't just about adding more DSPs. There is a "Pareto shape" to the latency curve (see Fig. 6 in the paper). If you use too many DSPs, the cost of moving data to feed them (memory communication) starts to outweigh the computation speedup.
  • Overcoming HLS Limitations: Standard HLS tools are notoriously bad at mapping arbitrary logic to DSPs. By wrapping specialized RTL descriptions of DSPs in HLS templates, the authors get the best of both worlds: easy system-level integration and hardware-level optimization.

Key Results

The authors compared their framework, dubbed NullaDSP, against traditional MAC-based (Multiply-Accumulate) and XNOR-based FPGA accelerators:

  • Latency Reduction: For VGG16 on CIFAR-10, NullaDSP achieved a runtime of 2.99 ms, roughly a 2x speedup compared to a MAC-based accelerator using 1024 DSPs (5.72 ms).
  • Accuracy Preservation: The logic-based approximation maintained high accuracy. For VGG16, NullaDSP reached 92.26% accuracy, very close to the 93.04% achieved by full-precision MAC designs and significantly higher than the XNOR-based baseline (89.61%).
  • Resource Efficiency: The framework successfully fit the intermediate layers of VGG16 onto a single Xilinx Virtex UltraScale+ FPGA, a feat previously impossible using only LUT-based logic mapping.
  • Predictive Modeling: Their analytical model for compute cycles proved highly accurate, predicting actual hardware performance with less than 10% error.

Limitations and Future Work

  • Pessimistic Assumptions: The current analytical model assumes a "worst-case" scenario where all DSPs are used in every sub-kernel. This leads to a slight overestimation of latency.
  • Memory Bottlenecks: As the number of DSPs increases, the system becomes limited by the bandwidth of the PCIe bus and internal memory access lines. The authors suggest that more sophisticated memory partitioning could further reduce data movement overhead.
  • Sequential Layer Processing: The current implementation processes NN layers sequentially. Future work could explore inter-layer pipelining to further increase throughput.

Summary updated

BibTeX
@article{shahsavani2023efficient,
  author = {Soheil Nazar Shahsavani and Arash Fayyazi and Mahdi Nazemi and Massoud Pedram},
  title = {{Efficient Compilation and Mapping of Fixed Function Combinational Logic onto Digital Signal Processors Targeting Neural Network Inference and Utilizing High-level Synthesis}},
  journal = {ACM Trans. Reconfigurable Technol. Syst.},
  year = {2023},
  doi = {10.1145/3559543},
}
Figure