From 254597c125bda06e041a4a241177e959200ce8f7 Mon Sep 17 00:00:00 2001 From: Richard Lin Date: Wed, 7 Feb 2018 13:49:15 -0800 Subject: 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.--- src/main/scala/chisel3/compatibility.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') 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) } } } -- cgit v1.2.3