summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/naming/NamePluginSpec.scala
diff options
context:
space:
mode:
authormergify[bot]2022-06-02 18:06:03 +0000
committerGitHub2022-06-02 18:06:03 +0000
commit5bec54e535dca53c9347caddb0b395c4651a0919 (patch)
treeea9b4e534b19be7385a14d00ab434f23b54f648f /src/test/scala/chiselTests/naming/NamePluginSpec.scala
parent97fde23f666a560d4eba9333e4230f901d7f5361 (diff)
Support VerificationStatement in the naming plugin (#2555) (#2557)
Previously, verification statements (assert, assume, cover, and printf) were only named via reflection. (cherry picked from commit 7fa2691f670813eef4ec59fc27c4e4f625d598de) Co-authored-by: Jack Koenig <koenig@sifive.com>
Diffstat (limited to 'src/test/scala/chiselTests/naming/NamePluginSpec.scala')
-rw-r--r--src/test/scala/chiselTests/naming/NamePluginSpec.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/naming/NamePluginSpec.scala b/src/test/scala/chiselTests/naming/NamePluginSpec.scala
index 18359fd2..482ef62b 100644
--- a/src/test/scala/chiselTests/naming/NamePluginSpec.scala
+++ b/src/test/scala/chiselTests/naming/NamePluginSpec.scala
@@ -3,6 +3,7 @@
package chiselTests.naming
import chisel3._
+import chisel3.stage.ChiselStage
import chisel3.aop.Select
import chisel3.experimental.{prefix, treedump}
import chiselTests.{ChiselFlatSpec, Utils}
@@ -69,6 +70,24 @@ class NamePluginSpec extends ChiselFlatSpec with Utils {
}
}
+ "Scala plugin" should "name verification ops" in {
+ class Test extends Module {
+ val foo, bar = IO(Input(UInt(8.W)))
+
+ {
+ val x1 = chisel3.assert(1.U === 1.U)
+ val x2 = cover(foo =/= bar)
+ val x3 = chisel3.assume(foo =/= 123.U)
+ val x4 = printf("foo = %d\n", foo)
+ }
+ }
+ val chirrtl = ChiselStage.emitChirrtl(new Test)
+ (chirrtl should include).regex("assert.*: x1")
+ (chirrtl should include).regex("cover.*: x2")
+ (chirrtl should include).regex("assume.*: x3")
+ (chirrtl should include).regex("printf.*: x4")
+ }
+
"Naming on option" should "work" in {
class Test extends Module {