Verilog: register-transfer level IR layer - #2117
Open
kroening wants to merge 1 commit into
Open
Conversation
This was referenced Aug 27, 2026
kroening
force-pushed
the
kroening/verilog-rtl-layer
branch
from
August 30, 2026 15:00
4cb8228 to
e064293
Compare
This adds a new IR layer to the Verilog frontend that follows type checking and precedes synthesis. The register-transfer level (RTL) representation is a map from identifiers to a map of slices (lower and higher bit index) to the definition of the slice, which indicates whether the slice is state-holding or a wire, and gives the defining expression: the next-state value for state-holding slices, and the current-state value for wires. The new command-line option --show-rtl shows the representation.
kroening
force-pushed
the
kroening/verilog-rtl-layer
branch
from
August 30, 2026 16:04
1b28f0b to
20ba76c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a new IR layer to the Verilog frontend that follows type checking and precedes synthesis.
Summary
The register-transfer level (RTL) representation (
src/verilog/verilog_rtl.h) is a map from identifiers to a map of slices (lower and higher bit index) to the definition of the slice, plus the assert, assume and cover properties of the module. The slice definition indicates whether the slice is state-holding (a register) or a wire, and gives the defining expression: the next-state value for state-holding slices, and the current-state value for wires.The construction pass (
src/verilog/verilog_rtl.cpp) builds the representation from the type-checked module items. It supports:?,x,zas synthesisConstructs that synthesis also rejects (e.g. always_latch, guard-less always with assignments, procedural continuous assignments) produce a located error.
The new command-line option
--show-rtlshows the representation, e.g.:Full designs
The RTL representation now covers full designs, so that a transition system can be constructed from it (see #2119):
$leftare resolved during substitution.Testing
unit/verilog/verilog_rtl.cpp(17 scenarios): slices, registers, wires, part selects, conditionals, case statements, for loops with and without break, task enables, concatenation lvalues, struct members, array elements, compound assignments, net declarations, increment/decrement, properties with and without labels, blocking-assignment substitution.regression/verilogandregression/ebmcsuites pass.--show-rtlsucceeds on all 746 tests inregression/verilogthat reach RTL construction, except for 5 that deliberately provoke front-end errors.