Skip to content

SMV word-level: support reduction and replication operators - #2037

Merged
tautschnig merged 1 commit into
mainfrom
kroening/smv-word-level-reduction-replication
Oct 12, 2026
Merged

tautschnig merged 1 commit into
mainfrom
kroening/smv-word-level-reduction-replication

Conversation

@kroening

Copy link
Copy Markdown
Collaborator

Add lower() free functions for Verilog reduction operators (and/nand/or/nor/xor/xnor) and the replication operator in a new header src/verilog/verilog_expr_lowering.h. Use these in expr2smv.cpp to produce proper SMV output instead of norep dumps.

Also fix the Verilog type checker to unwrap the single-element concatenation that the parser wraps around the replication operand.

Changes

  • src/verilog/verilog_expr_lowering.h (new): Free-standing lower() functions for reduction and replication expressions
  • src/smvlang/expr2smv.cpp: Call lower() for reduction/replication operators in convert_rec()
  • src/verilog/verilog_typecheck_expr.cpp: Unwrap single-element concatenation in replication operand
  • regression/ebmc/smv-word-level/reduction1.desc: KNOWNBUG → CORE
  • regression/ebmc/smv-word-level/replication1.desc: KNOWNBUG → CORE

Testing

All smv-word-level and verilog regression tests pass.

@kroening
kroening force-pushed the kroening/smv-word-level-reduction-replication branch from edb3ac1 to 4717e97 Compare July 21, 2026 11:18
@kroening

Copy link
Copy Markdown
Collaborator Author

I'll do a PR against cbmc with the functions in src/verilog/verilog_expr_lowering.h becoming methods on the bitvector expressions.

@kroening
kroening force-pushed the kroening/smv-word-level-reduction-replication branch from 4717e97 to 592872d Compare July 21, 2026 11:27
@kroening
kroening force-pushed the kroening/smv-word-level-reduction-replication branch from 592872d to d96c658 Compare August 11, 2026 01:56
@kroening
kroening force-pushed the kroening/smv-word-level-reduction-replication branch from d96c658 to 722df77 Compare September 10, 2026 18:54
@tautschnig

Copy link
Copy Markdown
Collaborator

I have commented on the CBMC side: diffblue/cbmc#9123 (review) - should we try to merge the CBMC PR first?

@kroening
kroening force-pushed the kroening/smv-word-level-reduction-replication branch from 722df77 to 78d9d79 Compare September 24, 2026 10:37
@tautschnig

Copy link
Copy Markdown
Collaborator

With diffblue/cbmc#9123 merged, should we do a submodule bump here?

@kroening

Copy link
Copy Markdown
Collaborator Author

Yes, will do

Uses the lower() methods of the Verilog reduction operators
(and/nand/or/nor/xor/xnor) and the replication operator provided
by CBMC to produce proper SMV output instead of norep dumps.

Also fix the Verilog type checker to unwrap the single-element
concatenation that the parser wraps around the replication operand.

The regression tests are updated from KNOWNBUG to CORE.
@kroening
kroening force-pushed the kroening/smv-word-level-reduction-replication branch from 78d9d79 to 9352755 Compare October 9, 2026 15:28
@kroening

kroening commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

Done

@tautschnig
tautschnig merged commit 2a0df71 into main Oct 12, 2026
11 checks passed
@tautschnig
tautschnig deleted the kroening/smv-word-level-reduction-replication branch October 12, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants