-
Notifications
You must be signed in to change notification settings - Fork 603
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
Make "deprecated public" binding APIs private #4177
Conversation
cbbde30
to
4054f73
Compare
// Element only direction used for the Binding system only. | ||
private[chisel3] sealed abstract class BindingDirection | ||
private[chisel3] object BindingDirection { | ||
|
||
/** Internal type or wire | ||
*/ | ||
case object Internal extends BindingDirection | ||
|
||
/** Module port with output direction | ||
*/ | ||
case object Output extends BindingDirection | ||
|
||
/** Module port with input direction | ||
*/ | ||
case object Input extends BindingDirection | ||
|
||
/** Determine the BindingDirection of an Element given its top binding and resolved direction. | ||
*/ | ||
def from(binding: TopBinding, direction: ActualDirection): BindingDirection = { | ||
binding match { | ||
case _: PortBinding | _: SecretPortBinding => | ||
direction match { | ||
case ActualDirection.Output => Output | ||
case ActualDirection.Input => Input | ||
case dir => throw new RuntimeException(s"Unexpected port element direction '$dir'") | ||
} | ||
case _ => Internal | ||
private[chisel3] object binding { | ||
|
||
// Element only direction used for the Binding system only. | ||
sealed abstract class BindingDirection | ||
object BindingDirection { | ||
|
||
/** Internal type or wire | ||
*/ | ||
case object Internal extends BindingDirection | ||
|
||
/** Module port with output direction | ||
*/ | ||
case object Output extends BindingDirection | ||
|
||
/** Module port with input direction | ||
*/ | ||
case object Input extends BindingDirection | ||
|
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.
This diff looks crazy, but all it is is adding private[chisel3] object binding {
, tabbing everything over, and deleting all nested private[chisel3]
and deprecation messages. It's split into 2 commits that at least makes that more clear in the normal commit history. I'll merge with a merge commit.
This is done by adding a new package private object "binding" within which all bindings live. This required changing imports in lots of files but it makes it much easier to not accidentally create a public binding in the future.
These are no longer needed now that all binding are packaged up in a package private object.
4054f73
to
cf72316
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
This is done by adding a new package private object "binding" within
which all bindings live. This required changing imports in lots of files
but it makes it much easier to not accidentally create a public binding
in the future.
Contributor Checklist
docs/src
?Type of Improvement
Desired Merge Strategy
Release Notes
These
chisel3.internal
APIs should never have been public in the first place.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
.