summaryrefslogtreecommitdiff
path: root/core/src/main/scala/chisel3/RawModule.scala
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/scala/chisel3/RawModule.scala')
-rw-r--r--core/src/main/scala/chisel3/RawModule.scala16
1 files changed, 12 insertions, 4 deletions
diff --git a/core/src/main/scala/chisel3/RawModule.scala b/core/src/main/scala/chisel3/RawModule.scala
index a1006594..16a2394f 100644
--- a/core/src/main/scala/chisel3/RawModule.scala
+++ b/core/src/main/scala/chisel3/RawModule.scala
@@ -200,10 +200,18 @@ package internal {
// IO for this Module. At the Scala level (pre-FIRRTL transformations),
// connections in and out of a Module may only go through `io` elements.
+ @deprecated("Removed for causing issues in Scala 2.12+. You remain free to define io Bundles " +
+ "in your Modules, but you cannot rely on an io field in every Module. " +
+ "For more information, see: https://github.com/freechipsproject/chisel3/pull/1550.",
+ "Chisel 3.4"
+ )
def io: Record
+ // Private accessor to reduce number of deprecation warnings
+ private[chisel3] def _io: Record = io
+
// Allow access to bindings from the compatibility package
- protected def _compatIoPortBound() = portsContains(io)
+ protected def _compatIoPortBound() = portsContains(_io)
private[chisel3] override def namePorts(names: HashMap[HasId, String]): Unit = {
for (port <- getModulePorts) {
@@ -218,8 +226,8 @@ package internal {
_compatAutoWrapPorts() // pre-IO(...) compatibility hack
// Restrict IO to just io, clock, and reset
- require(io != null, "Module must have io")
- require(portsContains(io), "Module must have io wrapped in IO(...)")
+ require(_io != null, "Module must have io")
+ require(portsContains(_io), "Module must have io wrapped in IO(...)")
require((portsContains(clock)) && (portsContains(reset)), "Internal error, module did not have clock or reset as IO")
require(portsSize == 3, "Module must only have io, clock, and reset as IO")
@@ -232,7 +240,7 @@ package internal {
implicit val sourceInfo = UnlocatableSourceInfo
if (!parentCompileOptions.explicitInvalidate) {
- pushCommand(DefInvalid(sourceInfo, io.ref))
+ pushCommand(DefInvalid(sourceInfo, _io.ref))
}
clock := override_clock.getOrElse(Builder.forcedClock)