[FIRRTL] Canonicalize propassign/ref.define, like canonicalizeSingleSetConnect
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 524
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 46
Description
Consider:
```
firrtl.circuit "WireProbe" {
firrtl.module @WireProbe(in %x: !firrtl.uint<5>, out %p: !firrtl.probe>) {
%0 = firrtl.ref.send %x : !firrtl.uint<5>
%w = firrtl.wire : !firrtl.probe>
firrtl.ref.define %w, %0 : !firrtl.probe>
firrtl.ref.define %p, %w : !firrtl.probe>
}
}
```
We should be able to forward through the wire and drop it, as happens with strictconnect of hw things.
Similarly for propassign.
This will help remove wires without doing constant-prop, such as wires used in a passthrough module.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the existing canonicalizeSingleSetConnect behavior and tracing the FIRRTL propassign and ref.define canonicalization paths. Confirm that a wire can be forwarded through and removed, and apply the same expectation to propassign; the issue is done when both cases canonicalize without constant propagation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100