-
Notifications
You must be signed in to change notification settings - Fork 609
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 Lookupable #4519
Merged
Merged
Refactor Lookupable #4519
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jackkoenig
added
the
Deprecation
Deprecates an API, will be included in release notes
label
Nov 19, 2024
mwachs5
reviewed
Nov 19, 2024
@@ -11,6 +11,10 @@ trait IsInstantiable | |||
|
|||
object IsInstantiable { | |||
implicit class IsInstantiableExtensions[T <: IsInstantiable](i: T) { | |||
@deprecated( | |||
"Use of @instantiable on user-defined types is deprecated. Implement Lookupable for your type instead.", |
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.
should we point to website docs on this?
mwachs5
reviewed
Nov 19, 2024
core/src/main/scala/chisel3/experimental/hierarchy/core/Lookupable.scala
Show resolved
Hide resolved
mwachs5
reviewed
Nov 19, 2024
core/src/main/scala/chisel3/experimental/hierarchy/core/Lookupable.scala
Outdated
Show resolved
Hide resolved
mwachs5
reviewed
Nov 19, 2024
mwachs5
reviewed
Nov 19, 2024
mwachs5
reviewed
Nov 19, 2024
mwachs5
reviewed
Nov 19, 2024
azidar
reviewed
Nov 20, 2024
azidar
approved these changes
Nov 20, 2024
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.
I'll approve, but please add a simpler example to both the documentation and the unit tests. Thanks!
Historically, the Lookupable API is able to change the type of fields looked up from Definitions or Instances. This enabled Module fields to be looked up as Instances, as well as user-defined types to opt-in to this same Instance-boxing behavior. This path-dependent type changing behavior is now deprecated. Looking up Modules is also deprecated, instead, the user should cast them Instances (via `.toInstance`). It is also deprecated to mark user-defined types as `@instantiable`. Instead, users should define Lookupable for their types using the new Lookupable.product[1-5] factory methods. See the Chisel website for more details. * Deprecate user-extension of trait Lookupable. * Deprecate Lookupable.lookupModule. Users should use Instances instead of Modules. * Deprecate Lookupable.isInstantiable. User should use new factories to implement Lookupable for their user-defined types instead. * Deprecate Lookupable.SimpleLookupable. * Add Lookupable.isLookupable factory for "simple" Lookupables. * Add Lookupable.product1-5 factories for Lookupables for user-defined types. * Add Lookupable for Tuple3-5 (already existed for Tuple2). * Add private LookupableImpl which is simpler to implement.
jackkoenig
force-pushed
the
refactor-lookupable
branch
from
November 20, 2024 05:03
bdf4c6d
to
88dd8f0
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Release Notes for description.
Contributor Checklist
docs/src
?Type of Improvement
Desired Merge Strategy
Release Notes
Historically, the Lookupable API is able to change the type of fields looked up from Definitions or Instances. This enabled Module fields to be looked up as Instances, as well as user-defined types to opt-in to this same Instance-boxing behavior.
This path-dependent type changing behavior is now deprecated. Looking up Modules is also deprecated, instead, the user should cast them Instances (via
.toInstance
). It is also deprecated to mark user-defined types as@instantiable
. Instead, users should define Lookupable for their types using the new Lookupable.product[1-5] factory methods. See the Chisel website for more details.of Modules.
implement Lookupable for their user-defined types instead.
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
.