This paper, presented at EMSOFT 2019, introduces a framework for translating high-level real-time monitoring specifications into hardware-level logic. By compiling the RTLola specification language directly into VHDL for FPGAs, the authors provide a path for safety-critical systems—like drones and network routers—to monitor their own health with microsecond latency and minimal power consumption.
TL;DR
The authors present a compiler that transforms RTLola, a stream-based specification language, into synthesizable VHDL for FPGAs. This allows cyber-physical systems to perform complex, real-time runtime verification with high parallelism, predictable memory usage, and a power envelope of less than 2 Watts.
What Problem Does This Paper Address?
Cyber-physical systems (CPS), such as autonomous drones or medical devices, operate under strict real-time constraints and limited hardware resources. To ensure safety, these systems need "runtime monitoring"—a dedicated component that watches data streams (sensor readings, network packets) to detect failures or security breaches as they happen.
Existing software-based monitors often introduce too much overhead or rely on operating systems that can't guarantee timing. While FPGAs (Field-Programmable Gate Arrays) are ideal for this task due to their speed and parallelism, writing low-level hardware descriptions (VHDL/Verilog) for complex temporal properties is incredibly difficult and error-prone. The gap addressed here is the automated compilation from a high-level, formal specification language to efficient, parallel hardware.
Methods
The core of the approach is the translation of RTLola (Real-Time Lola) into a modular hardware architecture.
- The Language: RTLola is a stream-based language that handles both event-driven inputs (e.g., a sensor sends data whenever it wants) and periodic outputs (e.g., a monitor checks the average speed every 100ms). Crucially, RTLola allows for statically determined memory bounds, which is a prerequisite for FPGA implementation.
- Two-Tier Architecture: The generated hardware consists of two main modules:
- High-Level Controller (HLC): Acts as a scheduler. It receives external events, manages timestamps, and decides which periodic tasks are due. It uses a pipeline to ensure new events can be accepted even while previous ones are being processed.
- Low-Level Controller (LLC): The "engine room" that performs the actual math and logic. It evaluates stream expressions in parallel based on the dependencies defined in the specification.
- Sliding Window "Bucketing": To handle sliding windows (e.g., "the average altitude over the last 5 seconds") without storing an infinite number of events, the authors use a "bucketing" technique. They split the window into smaller time-chunks and pre-aggregate data, keeping memory usage constant regardless of the event frequency.
Datasets
The authors evaluated their compiler using three distinct scenarios:
- Avionics (Drone Monitoring): Used simulated sensor data from the ArduPilot Copter simulator. The monitor checked for GPS frequency drops, velocity inconsistencies, and "hover" phases.
- Network Monitoring: Used real-world traffic logs from the Mid-Atlantic Collegiate Cyber Defense Competition (MACCDC). The monitor analyzed IP traffic, TCP flags, and payload lengths to detect potential attacks.
- Synthetic Parallelization Test: A custom-designed specification used to measure the performance difference between sequential and parallel evaluation structures on the FPGA.
Key Insights and Ideas
- Static Memory is King: The most significant "aha" moment is that because RTLola enforces a static memory bound, the compiler can pre-allocate every register on the FPGA. This eliminates the risk of "out-of-memory" errors at runtime, which is a nightmare for safety-critical systems.
- Decoupling Time from Logic: By splitting the HLC and LLC, the system can handle "bursty" input data. The HLC buffers events in a queue, allowing the monitor to catch up during quieter periods without losing data.
- Parallelism by Design: Because RTLola specifications are modular, the compiler can identify independent streams and evaluate them simultaneously. This isn't just a minor optimization; it allows the FPGA to handle event rates that would overwhelm a standard CPU.
Key Results
- Performance: In the drone case study, the monitor processed events in an average of 4.28 $\mu$s. In the network study, it took only 3.2 $\mu$s.
- Power Efficiency: The entire monitoring circuit consumed less than 2W of power (approx. 1.6W during active processing), making it suitable for battery-powered devices.
- The Power of Parallelism: In stress tests, the parallelized hardware implementation processed 100% of incoming events at maximum frequency, whereas a sequential version of the same logic lost 89% of the data because it couldn't keep up.
- Resource Footprint: The monitors fit comfortably on a small, entry-level FPGA (Zynq-7000), utilizing less than 50% of available logic slices.
Limitations and Future Work
- No Floating Point (Yet): The current prototype does not support floating-point or fixed-point units due to technical incompatibilities with the specific Xilinx synthesis tools used. While theoretically possible, it would currently result in a much larger circuit.
- Aggregation Limits: The "bucketing" method for sliding windows only works for "list homomorphisms" (functions like sum, count, min, max). More complex window functions that require seeing every individual event in order (like a median) are not yet supported.
- Future Directions: The authors suggest extending the framework to support parameterized streams (monitoring many entities, like thousands of IP addresses, simultaneously) and exploring distributed monitoring across multiple FPGAs.
Summary updated