Skip to main content
QUICK REVIEW

[Paper Review] Fuzzing Hardware Like Software

Timothy Trippel, Kang G. Shin|arXiv (Cornell University)|Feb 3, 2021
Software Testing and Debugging TechniquesComputer Science57 references30 citations
TL;DR

The paper proposes Hardware Fuzzing by translating RTL hardware to software models and fuzzing those models with open-source software fuzzers, yielding two orders-of-magnitude faster FSM coverage and high HDL line coverage on OpenTitan IP blocks.

ABSTRACT

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.

Motivation & Objective

  • Motivate why traditional dynamic and formal hardware verification struggle with complex designs and security flaws.
  • Introduce Hardware Fuzzing as a design-agnostic, software-fuzzer-based CDG alternative for hardware DV.
  • Develop a scalable HWFP to fuzz RTL hardware at scale using open-source tools.
  • Show that fuzzing hardware like software accelerates coverage convergence and increases HDL line coverage.

Proposed method

  • Translate RTL hardware to software models using Verilator to create Hardware Simulation Binaries (HSBs).
  • Use coverage-guided greybox software fuzzers to drive HSBs and maximize hardware coverage via software instrumentation.
  • Design a generic fuzzing harness that maps fuzzer outputs to two-dimensional space-time inputs for hardware sequences.
  • Introduce a bus-centric fuzzing grammar based on the TileLink TL-UL protocol to generate valid bus transactions from fuzzing bytes.
  • Build and open-source the Hardware Fuzzing Pipeline (HWFP) that runs on Google Cloud Platform using open-source tools.
  • Evaluate against OpenTitan RoT IP cores and a configurable digital lock FSM to compare against CRV.

Experimental results

Research questions

  • RQ1How can software fuzzers be adapted to drive hardware simulation binaries effectively?
  • RQ2Does fuzzing hardware like software provide faster coverage convergence than conventional constrained-random verification (CRV)?
  • RQ3Can a generic bus-centric fuzzing grammar enable design-agnostic fuzzing of RTL cores?
  • RQ4What is the impact of hardware fuzzing on HDL code coverage and FSM state-space exploration?

Key findings

  • Fuzzing hardware like software achieves over two orders-of-magnitude reduction in time to reach FSM coverage compared with conventional CRV.
  • Using a bus-centric grammar, the approach fuzzed four OpenTitan RoT IP cores achieving over 88% HDL line coverage in three of four cores within one hour, without seeds.
  • The Hardware Fuzzing Pipeline (HWFP) runs entirely with open-source tools and scales on Google Cloud Platform.
  • Maximizing software model coverage translates to maximizing hardware coverage due to Verilator’s translation properties.
  • A design-agnostic harness and grammar enable reusable fuzzing across multiple RTL designs speaking the same bus protocol.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.