The tests/silimate suite (which aborted the Run tests CI job) exposed two
issues in the generalized passes:
- opt_compact_prefix: the forward dense pack regressions at 64 and 128 bits
no longer rewrote. The ConstEval fingerprint was uint64_t-based (capped at
62 bits) and the per-cone cell cap (max_width*96) was below the O(width^2)
cell count of a wide pack. The fingerprint now drives whole-width Const
bit patterns (no width cap) and the cone cap scales quadratically; total
work stays bounded by the shared walk/eval budgets.
- opt_priority_onehot: the "max-width below lane count" negative test set
max_width=8 on a 16-lane design expecting no rewrite, but the generalized
matcher legitimately (and equivalence-provably) rewrites the 8-lane
sub-region. The test now uses max_width=3 (below min_width 4) to verify
the width gate suppresses all matching.
Co-authored-by: Cursor <cursoragent@cursor.com>
- update CMakeLists.txt to load two new files:
- SilimateConfig.cmake: sets Silimate configuration options and defaults
- SilimateVerific.cmake: compiles Verific library, optionally with Silimate modifications
- include silimate tests in test Makefile
This commit introduces the negopt pass with pre/post optimization modes
for handling negation patterns in arithmetic circuits.
Pre-optimization patterns (expose for tree balancing):
- manual2sub: (a + ~b) + 1 → a - b
- sub2neg: a - b → a + (-b)
- negexpand: -(a + b) → (-a) + (-b) [with output width fix]
- negneg: -(-a) → a
- negmux: -(s ? a : b) → s ? (-a) : (-b)
Post-optimization patterns (cleanup/rebuild):
- negrebuild: (-a) + (-b) → -(a + b)
- muxneg: s ? (-a) : (-b) → -(s ? a : b)
- neg2sub: a + (-b) → a - b
All patterns use nusers() for fanout checking (standard Yosys style).
Comprehensive test coverage with positive/negative cases and formal
verification via equiv_opt.
Adds a new pass, `splitlarge`, that recursively divides $add/$sub
cells into smaller cells until each cell's width doesn't exceed a
given max_width (128 by default.) An $add/$sub cell's width for
this purpose is defined as the higher of the widths of its two
inputs.
A test was written in Tcl for it, which tests this matrix:
- cell: $add/$sub
- b: unsigned, signed
- a: unsigned, signed
This is the first test for a Silimate pass in Tcl and thus
`run-test.sh` was modified to include it.