Rethinking FPGA Abstraction: From Circuit Simulation to Computational Programming
FPGAs are ubiquitous today. Adrian Sampson, an assistant professor of computer science at Cornell University, has been considering whether the current trajectory of FPGA development is correct—specifically, how we can achieve a truly general-purpose FPGA.
Defining the FPGA Landscape 🏗️ #
The architectural community lacks a unified definition of what an FPGA actually is. Let’s look at three common perspectives.
Definition 1: The Nanoscale Breadboard. Some argue that an FPGA is a collection of transistors you can “wire up” to create any circuit. It is treated like a nanoscale breadboard where you buy a single chip to host various designs, trading off efficiency for flexibility.
I find this definition lacking. It fails to accurately describe how people actually use FPGAs. Technically, you aren’t “rewiring” the hardware. Instead, an FPGA is a 2D grid of Look-Up Tables (LUTs) connected via a routing network, supplemented by arithmetic units and memory. It simulates circuits much like a software simulator does. This definition oversimplifies the practical reality of FPGA usage.
Definition 2: The Cheap ASIC Alternative. In prototype design and small-batch production, an FPGA serves as a cost-effective substitute for custom silicon. If you need to build a router, you can use an off-the-shelf FPGA and program it for specific functions to avoid the massive costs of tape-out. Alternatively, if you are designing a CPU, you can use an FPGA as a prototype to build a routable system for testing and demonstration before sending the design to a foundry.
Circuit simulation is the classic use case for FPGAs. This is why they emerged in the first place. Hardware design is encoded in HDL (Hardware Description Language), and relatively cheap hardware provides results comparable to ASICs. While you cannot use identical Verilog code for an FPGA and a physical chip, the level of abstraction remains similar.
Definition 3: The Pseudo-General Purpose Compute Accelerator. Similar to GPGPUs, FPGAs excel at offloading specific types of computation. From a programming perspective, FPGAs are harder than CPUs, but from a workload perspective, they are worth the effort. A well-optimized FPGA implementation can offer orders of magnitude better performance and energy efficiency than a CPU baseline.
This is a different use case than ASIC prototyping. Compute acceleration is an emerging application for FPGAs, evidenced by Microsoft’s success in accelerating search and deep neural networks. Crucially, these compute instances do not depend on the relationship between FPGAs and physical ASICs. The Verilog code written for FPGA-based acceleration does not need to resemble the Verilog code intended for tape-out.
These two use cases differ significantly in terms of programming, compilers, and abstraction. I focus on the latter, which I call “computational FPGA programming.” My argument is that current methods for programming computational FPGAs borrow too heavily from traditional circuit simulation models. If your goal is an ASIC prototype, Verilog and VHDL are correct. If your goal is computation, we need to rethink the entire stack.
The GPU Analogy: A Shift in Paradigm 🔄 #
Let’s be direct: FPGAs are a specialized type of hardware used to efficiently execute software that describes simulated circuits. FPGA configurations require low-level software—they are programs written for an Instruction Set Architecture (ISA).
We can use GPUs as a useful analogy here. Before deep learning and blockchain took off, GPUs were primarily used for graphics. In the early 21st century, developers realized that GPUs could handle compute-intensive tasks without any graphical data. GPU designers built more general machines, and 3D rendering became just one of many applications.
Computational FPGAs are following a similar trajectory. The goal is to utilize this hardware not for circuit simulation, but to leverage computation patterns suitable for circuit execution. To put it in terms of the GPU:
“GPU is to Graphics” as “FPGA is to Circuit Simulation.”
To evolve into the data-parallel accelerators they are today, people had to redefine the concept of GPU input. We previously viewed GPUs as machines that accepted specific, high-intensity visual descriptions. We moved toward programs that run on GPUs, which unlocked their true potential. This shifted the GPU’s target from a single application domain to an entire computational domain.
I believe computational FPGAs are undergoing a similar shift:
“GPU’s massive, conventional data parallelism” is equivalent to “FPGA’s static structure and irregular parallelism.”
We currently lack a concise description for the basic computational patterns that FPGAs excel at. However, these involve potential irregular parallelism, data reuse, and mostly static data flows. Like GPUs, FPGAs need a hardware abstraction that captures these computational patterns:
“GPU’s SIMT ISA” is equivalent to “FPGA’s ____”
The missing piece is an ISA-like abstraction for software running on FPGAs.
Why RTL Fails as an ISA 🛠️ #
The problem with using Verilog for computational FPGAs is that it performs poorly as both a low-level hardware abstraction and a high-level programming abstraction. Let’s use a thought experiment to see what happens if we swap these roles.
Role 1: Verilog as a high-level programming model. Verilog is an ergonomic, high-level programming model for lower-level abstractions. In our thought experiment, the ISA for computational FPGAs sits at a lower level than the RTL abstraction—think netlists and bitstreams. Verilog is a more efficient and higher-level programming model than those.
Even RTL experts might find it hard to believe that Verilog is an efficient way to develop mainstream FPGAs. It doesn’t push programming logic into the mainstream. For a hardware hacker, RTL design feels friendly and familiar, but the productivity gap between it and software languages is immeasurable.
Role 2: Verilog as a low-level hardware abstraction. In this view, Verilog is to an FPGA what an ISA is to a CPU. It might not be easy to program, but for a high-level language compiler, it is an excellent target because it describes what is happening in the hardware directly. If you need to squeeze out the last few percentage points of performance, it is the final programming choice.
In reality, for current computational FPGAs, Verilog is the ISA. Most FPGA vendor toolchains take Verilog as input, while high-level language compilers output Verilog. Because vendors often keep bitstream formats proprietary, Verilog sits as low as possible in the abstraction hierarchy.
The problem with treating Verilog as an ISA is that it is too far removed from the hardware. The abstraction gap between RTL and FPGA hardware is massive. From a traditional standpoint, it involves synthesis, technology mapping, and place-and-route—each a complex and slow process. Consequently, the compile/edit/run cycle for RTL programming on an FPGA can take hours or days. Worse, it is unpredictable. The deep stack of the toolchain can mask changes in the RTL, which might then impact design performance or power characteristics.
A good ISA should directly reflect the true state of the underlying hardware without modification. Like assembly language, it doesn’t need to be easy to program. However, like assembly, its compilation must be fast and the results must be predictable. To build higher-level abstractions and compilers, you need a low-level target that doesn’t produce surprises. RTL is not that target.
The Search for a New Abstraction 🔍 #
I am unsure what specific abstraction should replace RTL in the computational FPGA stack. As long as FPGA vendors keep their low-level abstractions and sub-RTL toolchains proprietary, Verilog remains difficult to replace. Perhaps a long-term solution will only emerge as hardware evolves, similar to how GPUs evolved.
“GPU and GPGPU” is equivalent to “FPGA and ____”
If computational FPGAs are to be accelerators for specific algorithmic patterns, current FPGAs may not be the ideal hardware to achieve this goal. A new type of hardware that can outperform FPGAs in this specific game might be the only way to introduce a completely new abstraction layer. A new software stack should discard the legacy issues of FPGA circuit simulation and the limitations of the RTL abstraction.
For those interested in how hardware abstraction impacts real-time systems, you can explore more about VxWorks’ approach to hardware abstraction.