TL;DR
EPOCH is the first vendor-independent framework that brings CPU-style "preemption" to FPGAs in multi-tenant cloud environments. It allows the system to pause a running FPGA task at any clock cycle, save its entire state (context) to off-chip memory, and resume it later without losing progress or requiring extra hardware logic on the FPGA fabric.
What Problem Does This Paper Address?
In modern cloud computing, FPGAs are increasingly shared among multiple users (tenants). While Operating Systems have long used preemption to swap tasks on a CPU—pausing a low-priority task to let a high-priority one run—doing this on an FPGA is notoriously difficult.
FPGAs are "stateful" hardware; their logic is spread across Look-Up Tables (LUTs), Flip-Flops (FFs), Block RAMs (BRAMs), and DSP units. To pause and resume a task, you must capture the exact value of every single one of these elements. Existing solutions usually require "scan-chains" (which eat up valuable hardware space) or rely on proprietary vendor tools that don't offer the fine-grained control needed for seamless context switching. The authors address this by creating a method to "snapshot" the FPGA's internal state using the configuration interface, all while keeping the hardware overhead at zero.
Methods
The authors developed EPOCH, which utilizes several clever techniques to manage state:
- Bitstream Reverse Engineering: The team reverse-engineered the Xilinx 7-Series bitstream format to identify exactly where the "active" state of LUTs and FFs is stored within configuration frames.
- PCAP-Based Extraction: Instead of using the internal ICAP (which requires FPGA resources), EPOCH uses the Processor Configuration Access Port (PCAP) from the CPU side (Processing System). This allows the CPU to read and write the FPGA's configuration memory directly.
- Flexible Clock Gating: To prevent state corruption during a snapshot, EPOCH uses the PS-side clock to "freeze" the FPGA logic at a specific cycle.
- BRAM Correction: They discovered that BRAM readback through the configuration port systematically flips certain bits to '1'. They developed a specific bit-flipping algorithm (Equation 1 in the paper) to revert these bits and restore BRAM content accurately.
- Zero-Area Overhead: Because the logic resides on the CPU and uses existing configuration ports, it requires zero additional logic gates on the programmable fabric.
Datasets
To evaluate EPOCH, the authors developed a custom benchmark suite designed to test heterogeneous FPGA resources. They integrated EPOCH with a RISC-V (CV32E40X) soft-processor core to simulate real-world application complexity.
The benchmarks include:
- Cryptography: AES-128, SHA-256, and FALCON (Digital Signatures).
- Machine Learning: GEMM (General Matrix Multiplication).
- Database Operations: Breadth-First Search (BFS) and Sorting.
- Pattern Recognition: KMP and NW algorithms.
- Standard Benchmarks: Dhrystone and Coremark.
Key Insights and Ideas
- The "Active" Bitstream: Most people view the FPGA bitstream as a static "map" of the hardware. EPOCH treats it as a dynamic memory space where the current values of registers and memories are hidden.
- Vendor Independence: By bypassing high-level vendor tools and working directly with the configuration frames, EPOCH provides a blueprint that can be adapted to different FPGA families (like moving from 7-Series to UltraScale) with only minor modifications to word counts.
- The BRAM "Aha" Moment: One of the most interesting findings was the deterministic bit-flipping in BRAM readback. Without identifying this quirk, context restoration would result in corrupted memory, causing the resumed task to crash.
- Hardware-Software Co-design: By moving the "intelligence" of the preemption to the CPU (PS), the authors ensure that the FPGA (PL) remains 100% available for the user's actual workload.
Key Results
- Speed: On a Zynq-XC7Z020 SoC, EPOCH achieves context save and restore operations in 62.2 $\mu$s and 67.4 $\mu$s per frame, respectively.
- Complex Task Performance: For a full RISC-V system running complex benchmarks (like AES or GEMM), the total context save time was approximately 3.1 to 3.2 milliseconds.
- Resource Efficiency: The framework achieved zero area overhead on the reconfigurable fabric.
- Reliability: The authors successfully demonstrated pausing a 4-bit up-counter and a 4-bit down-counter, saving their state, resetting the FPGA, and resuming them exactly where they left off.
Limitations and Future Work
- PCAP Frequency Limits: While the PCAP theoretically supports 100MHz, the authors found that reading consecutive frames at this speed could freeze the reconfiguration fabric. They currently operate at 50MHz to ensure stability.
- Multi-Clock Domains: Pausing designs with multiple, interconnected clock domains can lead to "loop-like" feedback issues. The authors suggest a handshake mechanism is needed to identify the "optimal moment" to halt the clock.
- Device Migration: While the methodology is portable, the specific "map" of the bitstream changes between FPGA generations (e.g., 7-Series to UltraScale+). Future work involves automating the discovery of these maps for newer architectures.
- Security: The paper notes that while they provide isolation between "slots," memory content security and encrypted bitstreams are orthogonal challenges not fully addressed in this specific framework.
Summary updated