跳转至

字典引导的变异算子:用于自动化 HDL 修复

文章背景与核心概要

硬件描述语言(HDL)设计的自动化修复由于巨大的搜索空间以及严格的句法和语义语法规则,一直以来都异常困难。传统的变异策略经常产生句法上无效的候选方案,从而浪费宝贵的编译和仿真预算,而基于综合的方法则缺乏可移植性。

本文介绍了一种新颖的字典引导的 HDL 修复系统,该系统结合了:1. 源自 ANTLR 的 DUT(被测设计)特定变异词汇表(用于通过正则表达式进行类别约束的标记替换、插入和删除,无需进行 AST 操作或综合);2. 仿真散度故障定位(FL)模块(可通过单次仿真运行识别发散的输出连线,并根据结构接近度对源代码行进行评分,以指导变异搜索)。在涵盖六个 DUT 系列的 CirFix 基准测试套件上的评估表明,该方法成功生成了针对 14 种漏洞变体的正确 oracle 验证修复。值得注意的是,它成功解决了一个 CirFix 无法修复的复杂的 6 处修改多漏洞实例,并在两处修改的基准变体上实现了较 CirFix 18 倍的加速。


📌 Summary

Automated repair of Hardware Description Language (HDL) designs is notoriously difficult due to massive search spaces and strict syntactic/semantic grammar rules. Traditional mutation strategies frequently produce syntactically invalid candidates that waste valuable compilation and simulation budgets, while synthesis-driven methods lack portability.

This paper introduces a novel dictionary-guided HDL repair system that combines: 1. ANTLR-derived DUT-specific mutation vocabularies (for category-constrained token substitutions, insertions, and deletions via regex, bypassing AST manipulation or synthesis). 2. A simulation-divergence fault localization (FL) module (which identifies diverging output wires from a single simulation run, scoring source lines by structural proximity to direct the mutation search).

Evaluated on the CirFix benchmark suite across six design under test (DUT) families, the proposed approach successfully generated correct oracle-passing repairs for 14 bug variants. Notably, it successfully solved a complex 6-edit multi-bug instance that CirFix cannot repair, and achieved an 18x speedup over CirFix on a two-edit benchmark variant.


📝 Abstract

Automated repair of Hardware Description Language (HDL) designs remains challenging due to the large search space of candidate repairs and the strict syntactic and semantic constraints imposed by HDL grammars. Generic mutation strategies overwhelmingly generate syntactically invalid candidates that waste compilation and simulation budget, while synthesis-driven and template-based approaches impose their own constraints on generality and portability. In this paper, we propose a dictionary-guided HDL repair system that combines ANTLR-derived DUT-specific mutation vocabularies with a simulation-divergence fault localization (FL) module. The mutation operator applies category-constrained token substitutions, insertions, and deletions directly to Verilog source via regex-based matching, without requiring AST manipulation or synthesis. The FL module identifies diverging output wires from a single simulation run and scores source lines by structural proximity to those signals, directing the mutation search toward high-suspicion regions. A deterministic targeted sweep exhausts all dictionary mutations on the highest-scored lines before falling back to a genetic programming (GP) search. Evaluated on the CirFix benchmark suite across six design under test (DUT) families, the proposed approach produces correct oracle-passing repairs on 14 bug variants, including a 6-edit multi-bug instance that CirFix cannot repair, and achieves an 18x speedup over CirFix on a two-edit benchmark variant. These results indicate that dictionary-constrained mutation operators, combined with lightweight simulation-divergence FL, are a practical and competitive approach to automated HDL repair for common bug classes without formal analysis or synthesis dependencies.