[FIRRTL] Use `i0` when creating `hw.array_get` ops for singleton arrays
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 524
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 46
Description
Currently, hw.array_get allows for both i0 and i1-typed values for singleton arrays https://github.com/llvm/circt/blob/727209a748563e8767c91068010f03a3d6d84847/include/circt/Dialect/HW/HWAggregates.td#L121 This is a special case added alongside #3985 to provide a transition period for FIRRTL. Eventually, FIRRTLToHW should be modified to remove any special-case logic around singleton arrays, which in turn will allow the type constraint to be made unambiguous.
An additional benefit of this is that once the i0/i1 type ambiguity is removed for hw.array_get, we can remove the index type from the ODS specifier that was added in #3985 to support this transition period.
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
Start with the hw.array_get definition in include/circt/Dialect/HW/HWAggregates.td and the FIRRTLToHW conversion entry point. Trace the singleton-array handling and remove its special-case logic so created ops use i0; done means the ODS index type is no longer needed and the array_get type constraint is unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100