summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/ToTargetSpec.scala
diff options
context:
space:
mode:
authorJack2022-11-11 06:53:04 +0000
committerJack2022-11-11 06:53:04 +0000
commit3ce953c81f06519351c48277e3474b5720ec07ff (patch)
treeac79dcb80d0528c2ae86ca21da4cf424715ab645 /src/test/scala/chiselTests/ToTargetSpec.scala
parentadccde9998c91875e5490cff6d5822ffacc593ed (diff)
parentc8046636a25474be4c547c6fe9c6d742ea7b1d13 (diff)
Merge branch '3.5.x' into 3.5-release
Diffstat (limited to 'src/test/scala/chiselTests/ToTargetSpec.scala')
-rw-r--r--src/test/scala/chiselTests/ToTargetSpec.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/ToTargetSpec.scala b/src/test/scala/chiselTests/ToTargetSpec.scala
index dc4ec448..de46cdcb 100644
--- a/src/test/scala/chiselTests/ToTargetSpec.scala
+++ b/src/test/scala/chiselTests/ToTargetSpec.scala
@@ -49,4 +49,21 @@ class ToTargetSpec extends ChiselFlatSpec with Utils {
val q = m.q.toTarget.toString
assert(q == s"~$mn|Queue")
}
+
+ it should "warn on non-hardware types and provide information" in {
+ class Example extends Module {
+ val tpe = UInt(8.W)
+
+ val in = IO(Input(tpe))
+ val out = IO(Output(tpe))
+ out := in
+ }
+
+ var e: Example = null
+ chisel3.stage.ChiselStage.elaborate { e = new Example; e }
+ val (log, foo) = grabLog(e.tpe.toTarget)
+ log should include(
+ "Accessing the .instanceName or .toTarget of non-hardware Data is deprecated: 'tpe', in module 'Example'"
+ )
+ }
}