Skip to content

Remove unnecessary slice (s) LogicNets from sign_extended and zero_extended. - #496

Merged
fdxmw merged 1 commit into
UCSBarchlab:developmentfrom
fdxmw:extend
Jul 28, 2026
Merged

Remove unnecessary slice (s) LogicNets from sign_extended and zero_extended.#496
fdxmw merged 1 commit into
UCSBarchlab:developmentfrom
fdxmw:extend

Conversation

@fdxmw

@fdxmw fdxmw commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

This removes 9% of pyrtlnet's slice (s) LogicNets, and 6% of pyrtlnet's wire (W) WireVectors, without introducing any new LogicNets or WireVectors. This speeds up simulation times, especially with pyrtl.Simulation.

Fix tests broken by this change.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.8%. Comparing base (9454d07) to head (4c5272e).

Additional details and impacted files
@@              Coverage Diff              @@
##           development    #496     +/-   ##
=============================================
- Coverage         93.8%   93.8%   -0.0%     
=============================================
  Files               30      30             
  Lines             7143    7148      +5     
=============================================
+ Hits              6694    6698      +4     
- Misses             449     450      +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…zero_extended`.

This removes 9% of pyrtlnet's slice (`s`) `LogicNets`, and 6% of pyrtlnet's
wire (`W`) `WireVectors`, without introducing new `LogicNets` or `WireVectors`.
This slightly speeds up simulations.

* Remove visualization special cases for bit-slices that select the same bit
  multiple times. This case is now extremely rare now that `sign-extended`
  `concats` multiple copies of the most significant bit.

* Move `output_to_verilog`'s logic for repeated bit seletions to concat ("c").
  This generalizes the logic, so we now use the Verilog replication operator
  for any repeated concat args, not just single-bit slices.

* Add a `FastSimulation` test for a non-consecutive bit-slice. We lost test
  coverage for this case because `sign_extended` no longer generates slices
  that copy the most significant bit.

* Add a sign_extended test that attempts to reduce bitwidth.

* Fix tests broken by this change and remove empty test methods.
@fdxmw
fdxmw merged commit 96fbc6f into UCSBarchlab:development Jul 28, 2026
6 checks passed
@fdxmw
fdxmw deleted the extend branch July 28, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant