summaryrefslogtreecommitdiff
path: root/core/src/main/scala/chisel3/Data.scala
diff options
context:
space:
mode:
authorJack Koenig2021-04-29 16:18:06 -0700
committerGitHub2021-04-29 16:18:06 -0700
commitc5861176887bfa529277e686df09a42aeceb6cd7 (patch)
tree82dc235e29ee615d063325eb66b96f54d652c4f6 /core/src/main/scala/chisel3/Data.scala
parent4d8fed00225d15221cf32177ea9147b20d0b91f7 (diff)
Scala 2.13 support (#1751)
Diffstat (limited to 'core/src/main/scala/chisel3/Data.scala')
-rw-r--r--core/src/main/scala/chisel3/Data.scala45
1 files changed, 22 insertions, 23 deletions
diff --git a/core/src/main/scala/chisel3/Data.scala b/core/src/main/scala/chisel3/Data.scala
index 0241f248..0832161e 100644
--- a/core/src/main/scala/chisel3/Data.scala
+++ b/core/src/main/scala/chisel3/Data.scala
@@ -122,6 +122,7 @@ object ActualDirection {
}
package experimental {
+ import chisel3.internal.requireIsHardware // Fix ambiguous import
/** Experimental hardware construction reflection API
*/
@@ -763,35 +764,33 @@ object WireDefault {
}
}
-package internal {
- /** RHS (source) for Invalidate API.
- * Causes connection logic to emit a DefInvalid when connected to an output port (or wire).
- */
- private[chisel3] object InternalDontCare extends Element {
- // This object should be initialized before we execute any user code that refers to it,
- // otherwise this "Chisel" object will end up on the UserModule's id list.
- // We make it private to chisel3 so it has to be accessed through the package object.
+/** RHS (source) for Invalidate API.
+ * Causes connection logic to emit a DefInvalid when connected to an output port (or wire).
+ */
+final case object DontCare extends Element {
+ // This object should be initialized before we execute any user code that refers to it,
+ // otherwise this "Chisel" object will end up on the UserModule's id list.
+ // We make it private to chisel3 so it has to be accessed through the package object.
- private[chisel3] override val width: Width = UnknownWidth()
+ private[chisel3] override val width: Width = UnknownWidth()
- bind(DontCareBinding(), SpecifiedDirection.Output)
- override def cloneType: this.type = DontCare
+ bind(DontCareBinding(), SpecifiedDirection.Output)
+ override def cloneType: this.type = DontCare
- override def toString: String = "DontCare()"
+ override def toString: String = "DontCare()"
- override def litOption: Option[BigInt] = None
+ override def litOption: Option[BigInt] = None
- def toPrintable: Printable = PString("DONTCARE")
+ def toPrintable: Printable = PString("DONTCARE")
- private[chisel3] def connectFromBits(that: Bits)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Unit = {
- Builder.error("connectFromBits: DontCare cannot be a connection sink (LHS)")
- }
+ private[chisel3] def connectFromBits(that: Bits)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Unit = {
+ Builder.error("connectFromBits: DontCare cannot be a connection sink (LHS)")
+ }
- def do_asUInt(implicit sourceInfo: chisel3.internal.sourceinfo.SourceInfo, compileOptions: CompileOptions): UInt = {
- Builder.error("DontCare does not have a UInt representation")
- 0.U
- }
- // DontCare's only match themselves.
- private[chisel3] def typeEquivalent(that: Data): Boolean = that == DontCare
+ def do_asUInt(implicit sourceInfo: chisel3.internal.sourceinfo.SourceInfo, compileOptions: CompileOptions): UInt = {
+ Builder.error("DontCare does not have a UInt representation")
+ 0.U
}
+ // DontCare's only match themselves.
+ private[chisel3] def typeEquivalent(that: Data): Boolean = that == DontCare
}