Verilog: create the transition relation from the RTL representation - #2119
Open
kroening wants to merge 2 commits into
Open
Verilog: create the transition relation from the RTL representation#2119kroening wants to merge 2 commits into
kroening wants to merge 2 commits into
Conversation
This was referenced Aug 27, 2026
kroening
force-pushed
the
kroening/verilog-transition-relation
branch
3 times, most recently
from
August 27, 2026 19:17
18a7fb9 to
a6c94e3
Compare
kroening
force-pushed
the
kroening/verilog-transition-relation
branch
2 times, most recently
from
August 30, 2026 16:03
ad89c2e to
ea474a0
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.
This adds verilog_transition_relation, which replaces verilog_synthesis in the EBMC flow. It takes the register-transfer level (RTL) representation as input, which includes module instances recursively, and produces the transition relation for the design: * State-holding slices become next-state equalities in the transition constraints, and wire slices become equalities in the state constraints; slices are composed into whole-symbol values, with unassigned fragments holding their value (registers) or remaining unconstrained (wires). Variables that are only assigned combinationally become wires, as do variables that are forced by port connections. * Declared variables without a next-state definition hold their value. * The initial values yield the initial state constraints; reads of state-holding variables are replaced by their non-deterministic pre-initial value, and unused non-determinism is removed. --ignore-initial and --initial-zero are handled here. * The constraints, e.g. from port connections and primitive gates, are added to the state constraints. * The properties are wrapped as in synthesis (implicit always, assume/cover marking, sequence semantics) and set as the values of the property symbols. * Expressions are lowered, and the remaining system function calls, e.g. $past, are rewritten as in synthesis. Unlike synthesis, the conversion does not introduce auxiliary wires; four regression test expectations are updated accordingly. verilog_synthesis remains in use by the hw-cbmc flow. All unit and regression suites pass with the new pipeline.
kroening
force-pushed
the
kroening/verilog-transition-relation
branch
from
August 30, 2026 16:05
ea474a0 to
2160574
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.
Stacked on #2117; only the top commit ("Verilog: create the transition relation from the RTL representation") is new relative to that PR.
Summary
This adds a new component,
verilog_transition_relation(src/verilog/verilog_transition_relation.{h,cpp}), which replacesverilog_synthesisin the EBMC flow. It takes the register-transfer level (RTL) representation introduced in #2117 as input — which includes module instances recursively — and produces the transition relation for the design:--ignore-initialand--initial-zeroare handled here.always, assume/cover marking, sequence semantics) and set as the values of the property symbols.$past, are rewritten as in synthesis.Unlike synthesis, the conversion does not introduce auxiliary wires (
x_aux0etc.); four regression test expectations are updated accordingly.verilog_synthesisremains in use by the hw-cbmc flow.The RTL gaps found while making all tests pass were fixed in #2117 (module instances, initial values, declared-variable and forced-wire tracking, function call inlining with side effects, hierarchical identifiers, constant folding of type-dependent system functions, case pattern folding, and more).
Testing
With the new pipeline, all suites pass:
unit(356 assertions in 62 test cases)regression/verilog(SAT and Z3)regression/ebmc(SAT and Z3)regression/smv(SAT and Z3)regression/vlindex