Bits refactor
I'm trying to split Bits into small types, and add return type to each type in type hierarchy.
I don't know will this work or not, seems to be a big change. However this may help splitting implementation between Scala3 and Scala213. And IDEA will be much happier if we successfully implement this.
Based on https://docs.scala-lang.org/tour/self-types.html, I think usage of self.type is wrong in type hierarchy.
After cleaning up, implementation to chisel3.internal.operators will be split out from each classes, and moved to 2.13 specific directory based on tutorial-macro-cross-building.
A possible gain in the future might be dsptool-like spiral-based design more easy to implement.
During refactoring I found these strange behaviors:
Num[T <: Data]seems to be a flawed design which doesn't provide a cross type operation, for example:UInt+SInt,UInt+FixedPoint.- slice to
Bitswill returnUInt, really wish a type-safe behavior here. Bitsnot being concrete, whileBits.applyjust return aUIntis a confusing design, I think we should concreteBitsdirectly(this may affect RocketChip). seeking for opinions from @aswaterman
macro refactor strategy
- Split out all API implemented by marco to small
traits - Split all macro to
FooMacroImptrait, creating corresponding version specific sources
Contributor Checklist
- [ ] Did you add Scaladoc to every public function/method?
- [ ] Did you add at least one test demonstrating the PR?
- [ ] Did you delete any extraneous printlns/debugging code?
- [ ] Did you specify the type of improvement?
- [ ] Did you add appropriate documentation in
docs/src? - [ ] Did you state the API impact?
- [ ] Did you specify the code generation impact?
- [ ] Did you request a desired merge strategy?
- [ ] Did you add text to be included in the Release Notes for this change?
Type of Improvement
API Impact
Backend Code Generation Impact
Desired Merge Strategy
Release Notes
Reviewer Checklist (only modified by reviewer)
- [ ] Did you add the appropriate labels?
- [ ] Did you mark the proper milestone (Bug fix:
3.3.x, [small] API extension:3.4.x, API modification or big change:3.5.0)? - [ ] Did you review?
- [ ] Did you check whether all relevant Contributor checkboxes have been checked?
- [ ] Did you mark as
Please Merge?