Skip to content

Update concat to immediately concatenate Consts, returning a new Const. - #502

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

Update concat to immediately concatenate Consts, returning a new Const.#502
fdxmw merged 1 commit into
UCSBarchlab:developmentfrom
fdxmw:extend

Conversation

@fdxmw

@fdxmw fdxmw commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This removes many unnecessary concats, especially from the common counter + 1 pattern. In this pattern, as_wires creates a 1-bit Const for the 1, then match_bitwidth zero-extends the Const to counter's bitwidth, which concatenates zeroes to the 1-bit Const. This concat is not useful, because the zeroes and the 1-bit 1 are all Consts. This commit removes these unnecessary concats.

This significantly reduces the number of concat LogicNets in pyrtlnet (33%, 611 -> 412).

…`Const`.

This removes many unnecessary `concats`, especially from the common `counter +
1` pattern. In this pattern, `as_wires` creates a 1-bit `Const` for the `1`,
then `match_bitwidth` zero-extends the `Const` to `counter`'s bitwidth, which
concatenates zeroes to the 1-bit `Const`. This `concat` is not useful, because
the zeroes and the 1-bit `1` are all `Consts`. This commit removes these
unnecessary `concats`.

This significantly reduces the number of `concat` `LogicNets` in `pyrtlnet`
(33%, 611 -> 412).
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.8%. Comparing base (d05a872) to head (6dfd3a6).

Additional details and impacted files
@@              Coverage Diff              @@
##           development    #502     +/-   ##
=============================================
+ Coverage         93.8%   93.8%   +0.1%     
=============================================
  Files               30      30             
  Lines             7166    7172      +6     
=============================================
+ Hits              6716    6722      +6     
  Misses             450     450             

☔ 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.

@fdxmw
fdxmw merged commit 1a7c606 into UCSBarchlab:development Jul 30, 2026
6 checks passed
@fdxmw
fdxmw deleted the extend branch July 30, 2026 22:11
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