summaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/scala/chisel3/internal/Builder.scala13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/src/main/scala/chisel3/internal/Builder.scala b/core/src/main/scala/chisel3/internal/Builder.scala
index 69455455..97c3bc49 100644
--- a/core/src/main/scala/chisel3/internal/Builder.scala
+++ b/core/src/main/scala/chisel3/internal/Builder.scala
@@ -240,7 +240,18 @@ private[chisel3] trait HasId extends InstanceId {
private def refName(c: Component): String = _ref match {
case Some(arg) => arg.fullName(c)
- case None => _computeName(None, None).get
+ case None =>
+ // This is super hacky but this is just for a short term deprecation
+ // These accesses occur after Chisel elaboration so we cannot use the normal
+ // Builder.deprecated mechanism, we have to create our own one off ErrorLog and print the
+ // warning right away.
+ val errors = new ErrorLog
+ val logger = new _root_.logger.Logger(this.getClass.getName)
+ val msg = "Accessing the .instanceName or .toTarget of non-hardware Data is deprecated. " +
+ "This will become an error in Chisel 3.6."
+ errors.deprecated(msg, None)
+ errors.checkpoint(logger)
+ _computeName(None, None).get
}
// Helper for reifying views if they map to a single Target