-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Internals to use Scala 2 Veneers #4400
Conversation
9d55db5
to
ba408d5
Compare
2668c35
to
8dff997
Compare
looks great so far. one thing i'd like to see is a scala-3 directory with some placeholder file that can successfully compile. though not necessarily as part of this pr |
Yeah that'll be good, but we should do that in a follow on PR as that will also require several other things (like the |
da6a962
to
95551e7
Compare
A few points:
Footnotes
|
e31805d
to
37cce1f
Compare
37cce1f
to
16ce260
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Perhaps in a future pr we can remove the implicit SourceInfo from the Impl files so that we can completely revamp source info in scala3.
I personally suggest directly using https://github.com/com-lihaoyi/sourcecode rather than implementing our own for Scala 3 version of chisel. |
I'm not sure I follow, what is wrong with the SourceInfo being implicit in the Impl files? We could make it explicit but I'm not sure that achieves anything.
While, I understand the inclination to use libraries rather than implementing things ourselves (and @azidar has also expressed a desire to have source locators being a separate dependency from the single Considering it's about 5 lines of code to implement the SourceInfo macro, I don't think this is worth it. If we want to make such a transition, I think we should do it completely separately from the Scala 3 upgrade. Also, probably making all of the above moot, sourcecode only supports local paths or absolute paths, neither of which fulfill our needs. We want project-local paths with some customization via System properties (or Scala compiler arguments if possible). So basically, I don't think we could use sourcecode even if it was worth the pain to migrate. |
It's nothing but macros.
It is just a macro.
The SourceInfo hierarchy is sealed, and very basic, so most of the code is just moved to src/main/scala-2.
16ce260
to
82d57b8
Compare
/** A trait for [[Vec]]s containing common hardware generators for collection | ||
* operations. | ||
*/ | ||
trait VecLike[T <: Data] extends VecLikeImpl[T] with SourceInfoDoc { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adkian-sifive I ended up going back and adding VecLikeImpl so no need to document the previous weirdness here.
Happy to split this into multiple PRs, not sure if it's worth it or not.
This needs to be merged with a merge commit
Contributor Checklist
docs/src
?Type of Improvement
Desired Merge Strategy
Release Notes
This is a massive refactoring of Chisel's internals in preparation for adding Scala 3 support. The public API should be generally unchanged but there are many new package private traits that should not affect Scala users but are messy at the binary compatibility level.
Reviewer Checklist (only modified by reviewer)
3.6.x
,5.x
, or6.x
depending on impact, API modification or big change:7.0
)?Enable auto-merge (squash)
, clean up the commit message, and label withPlease Merge
.Create a merge commit
.