A Novel Interactive-Guided Differential Testing Approach for FPGA Simulation Debugger Tools

Shikai Guo, Xiaoyu Wang, Xiaochen Li, Zhihao Xu, He JiangarXiv 2025 · DOI

Abstract

FPGA simulation debuggers are essential for verifying complex hardware designs, but their interactive nature poses significant challenges for automated testing. This paper introduces DB-Hunter, the first framework designed to test FPGA debuggers through interactive-guided differential testing. By systematically mutating both Register-Transfer Level (RTL) code and user debugging actions, DB-Hunter detects inconsistencies in debugger outputs. Our evaluation on Xilinx Vivado revealed 18 new bugs, 10 of which have been confirmed by the vendor, highlighting the critical need for specialized testing tools in the hardware verification ecosystem.

The Challenge of Interactive Debugging

Field-Programmable Gate Array (FPGA) engineers rely heavily on simulation debuggers to verify logic designs before hardware implementation. A bug in the debugger itself—such as an incorrectly reported signal value or a misplaced breakpoint—can lead to misinterpreted code, security vulnerabilities, or hardware failure.

Testing these tools is difficult because they are inherently interactive. Unlike compilers, which process static input to produce output, a debugger's state depends on a sequence of user actions.

State transition model of an interactive FPGA debugging session.

As shown in the state transition model above, a debugging session moves between "Paused" and "Running" states based on actions like setting breakpoints, stepping through code, or hitting a breakpoint. Existing automated testing methods for software debuggers often fail in the hardware domain because hardware description languages (HDLs) like Verilog involve unique execution models, such as concurrency and waveform visualization, which are not present in standard software.

The DB-Hunter Framework

To address these challenges, we propose DB-Hunter, a tool that utilizes differential testing. Differential testing involves providing the same input to semantically equivalent systems and identifying discrepancies in their outputs. DB-Hunter operates through a three-stage pipeline.

Overview of the DB-Hunter architecture, showing the transformation and testing pipeline.

1. RTL Design Transformation

DB-Hunter begins by taking a seed Verilog program and generating equivalent variants. These transformations ensure the underlying logic remains the same while changing the code structure. Examples include:

  • Assignment Conversion: Swapping blocking (=) and non-blocking (<=) assignments where the final result is unaffected.
  • Bit Mutation: Inserting no-op operations like double negations (~~wire).
  • Dead Code Manipulation: Removing unreachable loops or redundant files.

2. Debug Action Transformation

This stage simulates human interaction by generating sequences of debugging actions. It tests the debugger's robustness against UI-related changes, such as:

  • Breakpoint Sliding: Verifying that breakpoints set on comments or empty lines correctly "slide" to the next valid line.
  • Code Folding: Ensuring breakpoints remain accurate when code sections are collapsed in the interface.

3. Interactive Differential Testing

Finally, DB-Hunter runs the original and mutated programs through the debugger (e.g., Xilinx Vivado). It records "traces"—including variable values, waveform states, and breakpoint hits. Any discrepancy between the traces of the original and the "equivalent" variant indicates a potential bug.

Evaluation and Results

DB-Hunter was evaluated using seed programs generated by the Verismith RTL fuzzer, targeting Xilinx Vivado versions 2022.1 and 2023.1.

Bug Discovery

Over three months of testing, DB-Hunter identified 18 previously unknown issues in Vivado. These included:

  • Crash Bugs: Critical failures where the debugger terminates unexpectedly (e.g., memory management errors).
  • Missed Simulation Bugs: Logic errors where the debugger provides incorrect data or fails to trigger a breakpoint correctly.

Of the 18 issues, 10 have been officially confirmed by Xilinx Support, and 6 have already been addressed in subsequent software updates.

Efficiency and Synergy

The research highlights that mutating both code and actions is significantly more effective than mutating either in isolation. DB-Hunter achieved a bug discovery rate of 6.41%, a substantial improvement over the 1.60% rate observed with random testing. Furthermore, the number of discovered inconsistencies typically plateaus after six iterations, suggesting an optimal depth for the iterative transformation process.

Conclusion and Future Work

DB-Hunter demonstrates that interactive-guided differential testing is a powerful approach for securing the FPGA toolchain. While currently focused on Xilinx Vivado and the Verilog language, the framework's methodology is extensible. Future work aims to automate bug deduplication and expand support to other major vendors (Intel, Lattice) and languages like VHDL and SystemVerilog, ensuring broader reliability for the global hardware engineering community.

Summary updated

BibTeX
@misc{guo2025novel,
  author = {Shikai Guo and Xiaoyu Wang and Xiaochen Li and Zhihao Xu and He Jiang},
  title = {{A Novel Interactive-Guided Differential Testing Approach for FPGA Simulation Debugger Tools}},
  year = {2025},
  eprint = {2503.01138},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.01138},
}
Figure