🤖 AI Summary
The Verilog standard lacks a mathematically formalized semantics for its synthesizable subset; existing formalizations are hampered by internal inconsistencies in the standard and misalignment with industrial practice, limiting their utility for execution and verification. Method: We develop the first executable, hardware-design-compatible formal semantics for synthesizable Verilog—systematically identifying and resolving multiple logical contradictions in the standard’s synthesis-related semantics. Our approach integrates formal modeling, implementation in an executable metalanguage, and visual semantic representation, validated via rigorous standard-consistency analysis. Contribution/Results: We present the first formal semantics that simultaneously ensures executability, verifiability, and industrial applicability. The model successfully simulates multiple industrial-scale hardware designs. Accompanying open-source tooling includes an executable implementation and an interactive visualization framework, establishing a foundational basis for formal verification, simulator development, and future standard evolution.
📝 Abstract
Despite numerous previous formalisation projects targeting Verilog, the semantics of Verilog defined by the Verilog standard -- Verilog's simulation semantics -- has thus far eluded definitive mathematical formalisation. Previous projects on formalising the semantics have made good progress but no previous project provides a formalisation that can be used to execute or formally reason about real-world hardware designs. In this paper, we show that the reason for this is that the Verilog standard is inconsistent both with Verilog practice and itself. We pinpoint a series of problems in the Verilog standard that we have identified in how the standard defines the semantics of the subset of Verilog used to describe hardware designs, that is, the synthesisable subset of Verilog. We show how the most complete Verilog formalisation to date inherits these problems and how, after we repair these problems in an executable implementation of the formalisation, the repaired implementation can be used to execute real-world hardware designs. The existing formalisation together with the repairs hence constitute the first formalisation of Verilog's simulation semantics compatible with real-world hardware designs. Additionally, to make the results of this paper accessible to a wider (nonmathematical) audience, we provide a visual formalisation of Verilog's simulation semantics.