Repository navigation
Reduce SV case-local scalar replay mux allocations - #541
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance1 warning
Comparing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SV case replay currently materializes each arm merge, so repeated scalar selections allocate intermediate muxes that the frontend cleanup later removes. Keep whole-scalar selections in a private accumulator owned by one case statement and reuse
SNLHDLMuxSelectionto fold compatible common arms before emission.Arm, selector and item evaluation remains eager against incoming replay values. Pending entries stay outside active replay environments and expression caches, and materialize in declaration order at case exit. Nested cases, vectors, scheduling, loops and uncertain effects retain their existing boundaries. Both SV and VHDL calls to
mergeRepeatedMuxSelectionsremain enabled; primitive semantics are unchanged.The synthetic allocation fixture finishes with four muxes in both variants, while bitnets decrease from 40 to 32 and abandoned intermediate nets from four to zero. This establishes construction-time avoidance for that fixture; it does not establish coverage of the audit's 207 opportunities or an external-workload speedup. Details are in
regress/mux-reduction/case-replay-scalars.md.Validation on arm64 macOS with Release CMake:
git diff --check.Bazel parity and BCR readiness were not evaluated. No external-workload allocation or timing campaign was run.