summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/InstanceNameSpec.scala
diff options
context:
space:
mode:
authorJack2022-07-30 22:41:15 +0000
committerJack2022-07-30 22:41:15 +0000
commit4cd44fa4dab370fcc5c20bcacc1fa0ee02327252 (patch)
tree05730be260feca0d2a870c4bb88325d36631a8fc /src/test/scala/chiselTests/InstanceNameSpec.scala
parentfe9635ef21bad233945617a24ab16cfa4055f2d1 (diff)
parentbced77045c8fc5db37e40b159c49220929e15d46 (diff)
Merge branch '3.5.x' into 3.5-release
Diffstat (limited to 'src/test/scala/chiselTests/InstanceNameSpec.scala')
-rw-r--r--src/test/scala/chiselTests/InstanceNameSpec.scala20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/test/scala/chiselTests/InstanceNameSpec.scala b/src/test/scala/chiselTests/InstanceNameSpec.scala
index 7eaf3106..cc5980f4 100644
--- a/src/test/scala/chiselTests/InstanceNameSpec.scala
+++ b/src/test/scala/chiselTests/InstanceNameSpec.scala
@@ -22,28 +22,36 @@ class InstanceNameModule extends Module {
io.bar := io.foo + x
}
-class InstanceNameSpec extends ChiselFlatSpec {
+class InstanceNameSpec extends ChiselFlatSpec with Utils {
behavior.of("instanceName")
val moduleName = "InstanceNameModule"
var m: InstanceNameModule = _
ChiselStage.elaborate { m = new InstanceNameModule; m }
+ val deprecationMsg = "Accessing the .instanceName or .toTarget of non-hardware Data is deprecated"
+
it should "work with module IO" in {
val io = m.io.pathName
assert(io == moduleName + ".io")
}
- it should "work with internal vals" in {
+ it should "work for literals" in {
val x = m.x.pathName
- val y = m.y.pathName
- val z = m.z.pathName
assert(x == moduleName + ".UInt<2>(\"h03\")")
+ }
+
+ it should "work with non-hardware values (but be deprecated)" in {
+ val (ylog, y) = grabLog(m.y.pathName)
+ val (zlog, z) = grabLog(m.z.pathName)
+ ylog should include(deprecationMsg)
assert(y == moduleName + ".y")
+ zlog should include(deprecationMsg)
assert(z == moduleName + ".z")
}
- it should "work with bundle elements" in {
- val foo = m.z.foo.pathName
+ it should "work with non-hardware bundle elements (but be deprecated)" in {
+ val (log, foo) = grabLog(m.z.foo.pathName)
+ log should include(deprecationMsg)
assert(foo == moduleName + ".z.foo")
}