A Formally Verified Procedure for Width Inference in FIRRTL

The work

AuthorsKeyin Wang; Xiaomu Shi; Jiaxiang Liu; Zhilin Wu; Fu Song; Taolue Chen; David N. Jansen
Editors
Typemisc
Year2026
Citekeywang2026formally

Identifiers

arXiv2601.12813 from its landing_page_url

Empty on purpose

container

Related

Distinct frombaty2024formal
Distinct fromlyu2026rtl2lean
Distinct fromnukala2024translating
Distinct frompuri2014using

From bibtex.

Abstract

FIRRTL is an intermediate representation language for Register Transfer Level (RTL) hardware designs. In FIRRTL programs, the bit widths of many components are not specified explicitly and must be inferred during compilation. In mainstream FIRRTL compilers, such as the official compiler firtool, width inference is conducted by a compilation pass referred to as InferWidths, which may fail even for simple FIRRTL programs. In this paper, we thoroughly investigate the width inference problem for FIRRTL programs. We show that, if the constraints obtained from a FIRRTL program are satisfiable, there exists a unique least solution. Based on this result, we propose a complete procedure for solving the width inference problem. We implement it in the interactive theorem prover Rocq and prove its functional correctness. From the Rocq implementation, we extract an OCaml implementation, which is the first formally verified implementation of the InferWidths pass. Extensive experiments demonstrate that our approach can solve more instances than the official InferWidths pass in firtool, normally with high efficiency.

A copy is held

pdf, 1.0 MB. Not published — it may be under copyright. The facts and links here are.

How it got here

How it got hereagent via bibtex
Added2026-09-17 04:53 UTC
Approved bya person 2026-09-17 17:00 UTC

Cite it as

@misc{wang2026formally,
  title        = {A Formally Verified Procedure for Width Inference in FIRRTL},
  author       = {Keyin Wang and Xiaomu Shi and Jiaxiang Liu and Zhilin Wu and Fu Song and Taolue Chen and David N. Jansen},
  year         = {2026},
}

This record lives at https://refs.drheap.org/wang2026formally/ and will keep doing so.