Skip to content

Commit 4c28bd6

Browse files
authored
Clean up Bindings deprecations (#3736)
* Make already deprecated APIs package private * Add deprecation warnings to a few that we missed
1 parent ca58b95 commit 4c28bd6

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed

core/src/main/scala/chisel3/internal/Binding.scala

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,23 @@ private[chisel3] object BindingDirection {
4141
}
4242

4343
// Location refers to 'where' in the Module hierarchy this lives
44+
@deprecated(deprecatedPublicAPIMsg, "Chisel 6.0")
4445
sealed trait Binding {
4546
def location: Option[BaseModule]
4647
}
4748
// Top-level binding representing hardware, not a pointer to another binding (like ChildBinding)
49+
@deprecated(deprecatedPublicAPIMsg, "Chisel 6.0")
4850
sealed trait TopBinding extends Binding
4951

5052
// Constrained-ness refers to whether 'bound by Module boundaries'
5153
// An unconstrained binding, like a literal, can be read by everyone
54+
@deprecated(deprecatedPublicAPIMsg, "Chisel 6.0")
5255
sealed trait UnconstrainedBinding extends TopBinding {
5356
def location: Option[BaseModule] = None
5457
}
5558
// A constrained binding can only be read/written by specific modules
5659
// Location will track where this Module is, and the bound object can be referenced in FIRRTL
60+
@deprecated(deprecatedPublicAPIMsg, "Chisel 6.0")
5761
sealed trait ConstrainedBinding extends TopBinding {
5862
def enclosure: BaseModule
5963
def location: Option[BaseModule] = {
@@ -68,63 +72,56 @@ sealed trait ConstrainedBinding extends TopBinding {
6872
}
6973

7074
// A binding representing a data that cannot be (re)assigned to.
75+
@deprecated(deprecatedPublicAPIMsg, "Chisel 6.0")
7176
sealed trait ReadOnlyBinding extends TopBinding
7277

7378
// A component that can potentially be declared inside a 'when'
79+
@deprecated(deprecatedPublicAPIMsg, "Chisel 6.0")
7480
sealed trait ConditionalDeclarable extends TopBinding {
7581
def visibility: Option[WhenContext]
7682
}
7783

7884
// TODO(twigg): Ops between unenclosed nodes can also be unenclosed
7985
// However, Chisel currently binds all op results to a module
80-
@deprecated(deprecatedPublicAPIMsg, "Chisel 3.6")
81-
case class PortBinding(enclosure: BaseModule) extends ConstrainedBinding
86+
private[chisel3] case class PortBinding(enclosure: BaseModule) extends ConstrainedBinding
8287

8388
// Added to handle BoringUtils in Chisel
8489
private[chisel3] case class SecretPortBinding(enclosure: BaseModule) extends ConstrainedBinding
8590

86-
@deprecated(deprecatedPublicAPIMsg, "Chisel 3.6")
87-
case class OpBinding(enclosure: RawModule, visibility: Option[WhenContext])
91+
private[chisel3] case class OpBinding(enclosure: RawModule, visibility: Option[WhenContext])
8892
extends ConstrainedBinding
8993
with ReadOnlyBinding
9094
with ConditionalDeclarable
91-
@deprecated(deprecatedPublicAPIMsg, "Chisel 3.6")
92-
case class MemoryPortBinding(enclosure: RawModule, visibility: Option[WhenContext])
95+
private[chisel3] case class MemoryPortBinding(enclosure: RawModule, visibility: Option[WhenContext])
9396
extends ConstrainedBinding
9497
with ConditionalDeclarable
95-
@deprecated(deprecatedPublicAPIMsg, "Chisel 3.6")
96-
case class RegBinding(enclosure: RawModule, visibility: Option[WhenContext])
98+
private[chisel3] case class RegBinding(enclosure: RawModule, visibility: Option[WhenContext])
9799
extends ConstrainedBinding
98100
with ConditionalDeclarable
99-
@deprecated(deprecatedPublicAPIMsg, "Chisel 3.6")
100-
case class WireBinding(enclosure: RawModule, visibility: Option[WhenContext])
101+
private[chisel3] case class WireBinding(enclosure: RawModule, visibility: Option[WhenContext])
101102
extends ConstrainedBinding
102103
with ConditionalDeclarable
103104

104105
private[chisel3] case class ClassBinding(enclosure: Class) extends ConstrainedBinding with ReadOnlyBinding
105106

106107
private[chisel3] case class ObjectFieldBinding(enclosure: BaseModule) extends ConstrainedBinding
107108

108-
@deprecated(deprecatedPublicAPIMsg, "Chisel 3.6")
109-
case class ChildBinding(parent: Data) extends Binding {
109+
private[chisel3] case class ChildBinding(parent: Data) extends Binding {
110110
def location: Option[BaseModule] = parent.topBinding.location
111111
}
112112

113113
/** Special binding for Vec.sample_element */
114-
@deprecated(deprecatedPublicAPIMsg, "Chisel 3.6")
115-
case class SampleElementBinding[T <: Data](parent: Vec[T]) extends Binding {
114+
private[chisel3] case class SampleElementBinding[T <: Data](parent: Vec[T]) extends Binding {
116115
def location = parent.topBinding.location
117116
}
118117

119118
/** Special binding for Mem types */
120-
@deprecated(deprecatedPublicAPIMsg, "Chisel 3.6")
121-
case class MemTypeBinding[T <: Data](parent: MemBase[T]) extends Binding {
119+
private[chisel3] case class MemTypeBinding[T <: Data](parent: MemBase[T]) extends Binding {
122120
def location: Option[BaseModule] = parent._parent
123121
}
124122
// A DontCare element has a specific Binding, somewhat like a literal.
125123
// It is a source (RHS). It may only be connected/applied to sinks.
126-
@deprecated(deprecatedPublicAPIMsg, "Chisel 3.6")
127-
case class DontCareBinding() extends UnconstrainedBinding
124+
private[chisel3] case class DontCareBinding() extends UnconstrainedBinding
128125

129126
// Views currently only support 1:1 Element-level mappings
130127
private[chisel3] case class ViewBinding(target: Element) extends UnconstrainedBinding
@@ -142,20 +139,17 @@ private[chisel3] case class AggregateViewBinding(childMap: Map[Data, Data]) exte
142139
}
143140

144141
/** Binding for Data's returned from accessing an Instance/Definition members, if not readable/writable port */
145-
@deprecated(deprecatedPublicAPIMsg, "Chisel 3.6")
146142
private[chisel3] case object CrossModuleBinding extends TopBinding {
147143
def location = None
148144
}
149145

146+
@deprecated(deprecatedPublicAPIMsg, "Chisel 6.0")
150147
sealed trait LitBinding extends UnconstrainedBinding with ReadOnlyBinding
151148
// Literal binding attached to a element that is not part of a Bundle.
152-
@deprecated(deprecatedPublicAPIMsg, "Chisel 3.6")
153-
case class ElementLitBinding(litArg: LitArg) extends LitBinding
149+
private[chisel3] case class ElementLitBinding(litArg: LitArg) extends LitBinding
154150
// Literal binding attached to the root of a Bundle, containing literal values of its children.
155-
@deprecated(deprecatedPublicAPIMsg, "Chisel 3.6")
156-
case class BundleLitBinding(litMap: Map[Data, LitArg]) extends LitBinding
151+
private[chisel3] case class BundleLitBinding(litMap: Map[Data, LitArg]) extends LitBinding
157152
// Literal binding attached to the root of a Vec, containing literal values of its children.
158-
@deprecated(deprecatedPublicAPIMsg, "Chisel 3.6")
159-
case class VecLitBinding(litMap: VectorMap[Data, LitArg]) extends LitBinding
153+
private[chisel3] case class VecLitBinding(litMap: VectorMap[Data, LitArg]) extends LitBinding
160154
// Literal binding attached to a Property.
161155
private[chisel3] case object PropertyValueBinding extends UnconstrainedBinding with ReadOnlyBinding

0 commit comments

Comments
 (0)