Skip to content

Verilog: create the transition relation from the RTL representation - #2119

Merged
tautschnig merged 1 commit into
diffblue:mainfrom
kroening:kroening/verilog-transition-relation
Sep 22, 2026
Merged

tautschnig merged 1 commit into
diffblue:mainfrom
kroening:kroening/verilog-transition-relation

Conversation

@kroening

Copy link
Copy Markdown
Collaborator

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 replaces verilog_synthesis in 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:

  • 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; unassigned fragments hold their value (registers) or remain unconstrained (wires). Variables that are only assigned combinationally become wires, as do variables 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.
  • Constraints from port connections and primitive gates are added to the state constraints.
  • 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 remaining system function calls, e.g. $past, are rewritten as in synthesis.

Unlike synthesis, the conversion does not introduce auxiliary wires (x_aux0 etc.); four regression test expectations are updated accordingly. verilog_synthesis remains 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

@kroening
kroening force-pushed the kroening/verilog-transition-relation branch 3 times, most recently from 18a7fb9 to a6c94e3 Compare August 27, 2026 19:17
@kroening
kroening force-pushed the kroening/verilog-transition-relation branch 3 times, most recently from ea474a0 to 2160574 Compare August 30, 2026 16:05
@kroening
kroening force-pushed the kroening/verilog-transition-relation branch 2 times, most recently from 17f0e30 to 70fe11b Compare September 17, 2026 17:33
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
kroening force-pushed the kroening/verilog-transition-relation branch from 70fe11b to 2e2001a Compare September 19, 2026 16:33
@tautschnig
tautschnig merged commit e224197 into diffblue:main Sep 22, 2026
11 checks passed
kroening added a commit that referenced this pull request Sep 23, 2026
PR #2119 replaced verilog_synthesis with verilog_transition_relation
(RTL construction) in the EBMC flow. The disable1 and release1 tests
still expected the old synthesis-path diagnostics, so they failed.

Update both .desc files to match the new RTL-construction error
messages:
* disable1: "statement `disable' is not supported by RTL construction"
* release1: "statement `force' is not supported by RTL construction"
kroening added a commit that referenced this pull request Sep 24, 2026
The transition relation is now built from the RTL representation (#2119,
#2142) rather than by verilog_synthesis. Unlike synthesis, this does not
introduce auxiliary wires, and composes slices differently, which changes
the shape of the next-state functions the estimator walks. The combinational
area estimates for seven of the FSM-style designs change as a result;
register counts and all other designs are unaffected.

Against the NanGate45 reference areas in DOCKER_VALIDATION.md, the estimates
for float_to_int, fp_adder, fp_divider, and struct_packet get closer, while
array_sorter, fp_multiplier, and int_to_float get further away.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants