[论文解读] Fuzzing Hardware Like Software
论文通过将 RTL 硬件转换为软件模型并用开源软件模糊测试这些模型,实现两数量级更快的 FSM 覆盖率,并在 OpenTitan IP 块上获得较高的 HDL 行覆盖率。
Hardware flaws are permanent and potent: hardware cannot be patched once fabricated, and any flaws may undermine any software executing on top. Consequently, verification time dominates implementation time. The gold standard in hardware Design Verification (DV) is concentrated at two extremes: random dynamic verification and formal verification. Both struggle to root out the subtle flaws in complex hardware that often manifest as security vulnerabilities. The root problem with random verification is its undirected nature, making it inefficient, while formal verification is constrained by the state-space explosion problem, making it infeasible against complex designs. What is needed is a solution that is directed, yet under-constrained. Instead of making incremental improvements to existing DV approaches, we leverage the observation that existing software fuzzers already provide such a solution, and adapt them for hardware DV. Specifically, we translate RTL hardware to a software model and fuzz that model. The central challenge we address is how best to mitigate the differences between the hardware execution model and software execution model. This includes: 1) how to represent test cases, 2) what is the hardware equivalent of a crash, 3) what is an appropriate coverage metric, and 4) how to create a general-purpose fuzzing harness for hardware. To evaluate our approach, we fuzz four IP blocks from Google's OpenTitan SoC. Our experiments reveal a two orders-of-magnitude reduction in run time to achieve Finite State Machine (FSM) coverage over traditional dynamic verification schemes. Moreover, with our design-agnostic harness, we achieve over 88% HDL line coverage in three out of four of our designs -- even without any initial seeds.
研究动机与目标
- 说明为何传统的动态和形式化硬件验证在复杂设计和安全缺陷方面存在挑战。
- 将硬件模糊测试引入作为一种设计无关、基于软件模糊测试器的 CDG(覆盖驱动)替代方案,用于硬件设计验证。
- 开发一个可扩展的 HWFP,使用开源工具对 RTL 硬件进行大规模模糊测试。
- 证明像对待软件一样模糊测试硬件可以加速覆盖收敛并提高 HDL 行覆盖率。
提出的方法
- 使用 Verilator 将 RTL 硬件转换为软件模型,以创建硬件仿真二进制(HSBs)。
- 使用覆盖引导的灰盒软件模糊测试器驱动 HSBs,并通过软件插桩最大化硬件覆盖率。
- 设计一个通用的模糊测试框架,将模糊测试器输出映射到硬件序列的二维时空输入。
- 引入基于 TileLink TL-UL 协议的面向总线的模糊测试语法,以从模糊字节生成有效的总线事务。
- 构建并开源硬件模糊测试管线(HWFP),在 Google Cloud Platform 上使用开源工具运行。
- 对 OpenTitan RoT IP 核心和一个可配置的数字锁 FSM 进行评估,以与 CRV 进行比较。
实验结果
研究问题
- RQ1如何将软件模糊测试器有效地适配以驱动硬件仿真二进制?
- RQ2像软件一样对硬件进行模糊测试是否能比传统的有约束随机验证(CRV)更快地实现覆盖收敛?
- RQ3通用的面向总线的模糊测试语法能否实现对 RTL 核心的设计无关模糊测试?
- RQ4硬件模糊测试对 HDL 代码覆盖率和 FSM 状态空间探索有什么影响?
主要发现
- 像软件一样对硬件进行模糊测试,在达到 FSM 覆盖率方面比传统 CRV 的时间缩短超过两个数量级。
- 使用面向总线的语法,该方法在四个 OpenTitan RoT IP 核中进行模糊测试,在一个小时内在其中三个核上实现了超过 88% 的 HDL 行覆盖率,且无需种子。
- 硬件模糊测试管线(HWFP)完全使用开源工具运行,并在 Google Cloud Platform 上实现可扩展。
- 最大化软件模型覆盖率等同于最大化硬件覆盖率,这是由于 Verilator 的翻译特性。
- 一个设计无关的框架和语法使在同一总线协议下的多个 RTL 设计之间实现可重复使用的模糊测试成为可能。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。