A Novel Mutation Based Method for Detecting FPGA Logic Synthesis Tool Bugs

Yi Zhang, He Jiang, Xiaochen Li, Shikai Guo, Peiyu Zou, Zun WangarXiv 2025 · DOI

Abstract

FPGA logic synthesis tools are critical components of the hardware design flow, yet their complex optimization passes are prone to subtle bugs. Existing bug-finding tools often fail to generate the intricate semantic logic required to trigger these defects. This paper presents VERMEI, a novel mutation-based fuzzer that identifies "zombie logic"—code segments that are structurally present but behaviorally inactive—and performs equivalence-preserving mutations. By injecting complex, real-world logic fragments selected via Bayesian sampling, VERMEI discovered 15 unique bugs in industry-standard tools like Xilinx Vivado and Intel Quartus, significantly outperforming state-of-the-art fuzzers in both efficiency and code coverage.

Introduction

FPGA logic synthesis tools (e.g., Xilinx Vivado, Intel Quartus) serve as the essential "translators" of the hardware world, converting high-level Verilog code into gate-level netlists. If these tools contain bugs, the resulting hardware may exhibit unpredictable behavior, leading to system failures or security vulnerabilities.

The primary challenge in testing these tools is Insufficient Semantic Logical Complexity. Current fuzzers typically generate random Verilog code based on simple grammar rules. While effective for finding "low-hanging fruit," these tools fail to replicate the intricate, nested logic found in industrial designs. Consequently, the sophisticated optimization passes within synthesis tools—where the most critical bugs often reside—remain largely untested.

The VERMEI Methodology

To address this gap, the researchers developed VERMEI (VERilog Mutation based on Equivalent Input). The tool utilizes a three-stage pipeline to maximize logical complexity while ensuring functional equivalence.

The three-stage pipeline of VERMEI: Preprocessing, Equivalence Mutation, and Bug Identification.

1. Preprocessing and Zombie Logic Identification

VERMEI begins by simulating a "seed" Verilog program to identify Zombie Logic. Unlike dead code, which can never be executed, zombie logic is code that is structurally valid but currently inactive under specific simulation inputs. Because this logic does not affect the circuit's output, it can be safely mutated without changing the intended functionality.

Example of Verilog code and testbench used to identify 'zombie logic' (highlighted in red).

2. Equivalent Mutation via Bayesian Sampling

The core innovation of VERMEI is its mutation strategy. Instead of generating random noise, it pulls logic fragments from a library of over 24,000 real-world Verilog designs. A Bayesian sampling mechanism selects fragments that introduce complex control flows (e.g., loops, nested conditionals) to mimic industrial code. These fragments are inserted into the identified zombie regions, ensuring the mutated program remains logically equivalent to the original.

3. Bug Identification

VERMEI employs differential testing by synthesizing both the original seed and the mutated variant. Since the mutations occurred in zombie areas, the hardware's output should remain identical. If the outputs differ, or if the tool crashes or hangs during synthesis, a bug has been successfully triggered.

Key Results and Discussion

VERMEI was evaluated against the latest versions of Yosys (R0.40), Xilinx Vivado (R2023.2), and Intel Quartus Prime (R23.1).

  • Bug Discovery: In a five-month experiment, VERMEI reported 15 unique bugs, 9 of which were confirmed by vendors as brand-new defects. These included critical "Synthesis Mismatches" where the tool produced logically incorrect hardware.
  • Superiority over State-of-the-Art: VERMEI achieved a 100% improvement in bug detection effectiveness compared to Verismith and a 60% improvement over EvoHDL.
  • Efficiency: VERMEI detected an average of 2.5 bugs within just 100 seconds of fuzzing, whereas previous methods required significantly more time to achieve similar results.
  • Higher Coverage: The tool reached significantly higher line, condition, and branch coverage metrics, proving its ability to explore deeper corner cases in synthesis optimization passes.

Conclusion

VERMEI demonstrates that targeting zombie logic with real-world code snippets is a powerful strategy for uncovering deep-seated bugs in FPGA synthesis tools. By bridging the gap between simple grammar-based fuzzing and complex industrial design patterns, VERMEI provides a robust framework for hardening the hardware design toolchain. Future work will explore expanding mutation types and diversifying the search space beyond strictly zombie regions.

Summary updated

BibTeX
@misc{zhang2025novel,
  author = {Yi Zhang and He Jiang and Xiaochen Li and Shikai Guo and Peiyu Zou and Zun Wang},
  title = {{A Novel Mutation Based Method for Detecting FPGA Logic Synthesis Tool Bugs}},
  year = {2025},
  eprint = {2508.15536},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.15536},
}
Figure