Skip to content

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

Open
kroening wants to merge 1 commit into
mainfrom
kroening/smv-word-level-reduction-replication
Open

SMV word-level: support reduction and replication operators#2037
kroening wants to merge 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.

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.

The regression tests are updated from KNOWNBUG to CORE.
@kroening
kroening force-pushed the kroening/smv-word-level-reduction-replication branch from 592872d to d96c658 Compare August 11, 2026 01:56
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.

1 participant