summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Lin2018-02-07 13:49:15 -0800
committerGitHub2018-02-07 13:49:15 -0800
commit254597c125bda06e041a4a241177e959200ce8f7 (patch)
treed67e6bb0212c17ac19e095aff6d2edb8b92e6bf9 /src
parent7be9b1c681558695b95fccb22a60c34101c86118 (diff)
Cloning IO with compatibility 🦆 (#754)
Changes the API such that IO(...) clones. All Bundles will need to be clone-able, but auto clone type is expected to handle most cases.
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/chisel3/compatibility.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/scala/chisel3/compatibility.scala b/src/main/scala/chisel3/compatibility.scala
index d80ff40b..a1af6236 100644
--- a/src/main/scala/chisel3/compatibility.scala
+++ b/src/main/scala/chisel3/compatibility.scala
@@ -250,9 +250,9 @@ package object Chisel { // scalastyle:ignore package.object.name
abstract class BlackBox(params: Map[String, Param] = Map.empty[String, Param]) extends chisel3.core.BlackBox(params) {
// This class auto-wraps the BlackBox with IO(...), allowing legacy code (where IO(...) wasn't
// required) to build.
- override def _autoWrapPorts(): Unit = { // scalastyle:ignore method.name
- if (!_ioPortBound()) {
- IO(io)
+ override def _compatAutoWrapPorts(): Unit = { // scalastyle:ignore method.name
+ if (!_compatIoPortBound()) {
+ _bindIoInPlace(io)
}
}
}
@@ -283,9 +283,9 @@ package object Chisel { // scalastyle:ignore package.object.name
def this(_clock: Clock, _reset: Bool)(implicit moduleCompileOptions: CompileOptions) =
this(Option(_clock), Option(_reset))(moduleCompileOptions)
- override def _autoWrapPorts(): Unit = { // scalastyle:ignore method.name
- if (!_ioPortBound() && io != null) {
- IO(io)
+ override def _compatAutoWrapPorts(): Unit = { // scalastyle:ignore method.name
+ if (!_compatIoPortBound() && io != null) {
+ _bindIoInPlace(io)
}
}
}