chipsalliance / chipsalliance/chisel
CloneModuleAsRecord needs a macro
- Dominant language
- Scala
- Stars
- 4.8k
- Forks
- 658
- Avg merge
- 18h 59m
- Merged PRs (30d)
- 14
Description
The example for `CloneModuleAsRecord` doesn't work due to chained apply/source info:
```scala
class Foo extends RawModule
class Bar extends RawModule {
val foo = Module(new Foo)
CloneModuleAsRecord(foo)("io")
// not enough arguments for method apply: (implicit sourceInfo: chisel3.internal.sourceinfo.SourceInfo, implicit compileOptions: chisel3.CompileOptions)chisel3.experimental.ClonePorts in object CloneModuleAsRecord.
// Unspecified value parameter compileOptions.
}
```
This needs the macro treatment.
**Type of issue**: bug report
**Impact**: no functional change
**Development Phase**: request
**Other information**
**If the current behavior is a bug, please provide the steps to reproduce the problem:**
See above example.
**What is the current behavior?**
Example usage fails with the above error.
**What is the expected behavior?**
Example should work, chained apply should work.
**Please tell us about your environment:**
3.3.1
**What is the use case for changing the behavior?**
Examples should work. This would improve ergonomics.
Contributor guide
Research direction
Start with the CloneModuleAsRecord example and its chained apply usage shown in the issue, then trace the CloneModuleAsRecord API and the reported implicit-argument expansion. Confirm that the example compiles with the intended chained call and that the existing source-info and compile-options behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100