summaryrefslogtreecommitdiff
path: root/core/src/main/scala/chisel3/Module.scala
diff options
context:
space:
mode:
authorJack2023-01-08 04:47:27 +0000
committerJack2023-01-08 04:47:27 +0000
commit5aa60ecda6bd2b02dfc7253a47e53c7647981a5c (patch)
tree53ea2570c4af7824d6203e0c0cd7953c1ba4910c /core/src/main/scala/chisel3/Module.scala
parenta50a5a287a23ba6b833b13d8cec84dd5dfe0fc61 (diff)
parent116210ff806ccdda91b4c3343f78bad66783d0e6 (diff)
Merge branch '3.5.x' into 3.5-release
Diffstat (limited to 'core/src/main/scala/chisel3/Module.scala')
-rw-r--r--core/src/main/scala/chisel3/Module.scala38
1 files changed, 3 insertions, 35 deletions
diff --git a/core/src/main/scala/chisel3/Module.scala b/core/src/main/scala/chisel3/Module.scala
index e5c2a848..a2d5cec6 100644
--- a/core/src/main/scala/chisel3/Module.scala
+++ b/core/src/main/scala/chisel3/Module.scala
@@ -200,42 +200,10 @@ abstract class Module(implicit moduleCompileOptions: CompileOptions) extends Raw
}
package experimental {
-
- import chisel3.internal.requireIsChiselType // Fix ambiguous import
-
object IO {
-
- /** Constructs a port for the current Module
- *
- * This must wrap the datatype used to set the io field of any Module.
- * i.e. All concrete modules must have defined io in this form:
- * [lazy] val io[: io type] = IO(...[: io type])
- *
- * Items in [] are optional.
- *
- * The granted iodef must be a chisel type and not be bound to hardware.
- *
- * Also registers a Data as a port, also performing bindings. Cannot be called once ports are
- * requested (so that all calls to ports will return the same information).
- * Internal API.
- */
+ @deprecated("chisel3.experimental.IO is deprecated, use chisel3.IO instead", "Chisel 3.5")
def apply[T <: Data](iodef: T): T = {
- val module = Module.currentModule.get // Impossible to fail
- require(!module.isClosed, "Can't add more ports after module close")
- requireIsChiselType(iodef, "io type")
-
- // Clone the IO so we preserve immutability of data types
- val iodefClone =
- try {
- iodef.cloneTypeFull
- } catch {
- // For now this is going to be just a deprecation so we don't suddenly break everyone's code
- case e: AutoClonetypeException =>
- Builder.deprecated(e.getMessage, Some(s"${iodef.getClass}"))
- iodef
- }
- module.bindIoInPlace(iodefClone)
- iodefClone
+ chisel3.IO.apply(iodef)
}
}
}
@@ -753,7 +721,7 @@ package experimental {
* TODO(twigg): Specifically walk the Data definition to call out which nodes
* are problematic.
*/
- protected def IO[T <: Data](iodef: T): T = chisel3.experimental.IO.apply(iodef)
+ protected def IO[T <: Data](iodef: T): T = chisel3.IO.apply(iodef)
//
// Internal Functions