[PrettifyVerilog] Transform (some) array_create/get pairs into cases
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 524
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 46
Description
As discussed in the design meeting it would make sense to lower certain array_create/get pairs into case statements (potentially in an always_comb block):
- When the expression feeding the elements is large, complicated, and single use it would make sense to generate case statements.
- When multiple array_get's exists that use the same index condition it makes sense to fold them together into a single larger case. It is possible that this is just a "case folding" peephole that triggers after the first one.
We need to be careful not to go overboard here though, because the array_create syntax is nice for simple inline expressions. The example in the rationale docs should stay inline for example.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the linked design-meeting discussion and the array operation rationale in docs/RationaleHW-SV.md first. Then locate the PrettifyVerilog implementation and its existing tests; completion should selectively lower suitable array_create/get pairs while keeping simple inline expressions, including the rationale example, unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100