aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorKevin Laeufer2020-08-07 10:33:29 -0700
committerGitHub2020-08-07 17:33:29 +0000
commita6d53c9df25dba7da9d923faff9bf3c32f71b2d9 (patch)
treedfc1be376e257c117af1a2b7508311224a591702 /src/test
parente44cb05e178be55d686326fc894e5ce22c8cb2d0 (diff)
ExpandWhens: VerificationStatements should be part of the simlist (#1829)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/firrtlTests/formal/VerificationSpec.scala21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/test/scala/firrtlTests/formal/VerificationSpec.scala b/src/test/scala/firrtlTests/formal/VerificationSpec.scala
index 31c54e76..73d1404d 100644
--- a/src/test/scala/firrtlTests/formal/VerificationSpec.scala
+++ b/src/test/scala/firrtlTests/formal/VerificationSpec.scala
@@ -2,10 +2,11 @@
package firrtlTests.formal
-import firrtl.{SystemVerilogCompiler}
+import firrtl.{CircuitState, SystemVerilogCompiler, ir}
import firrtl.testutils.FirrtlFlatSpec
import logger.{LogLevel, Logger}
-import firrtl.ir
+import firrtl.options.Dependency
+import firrtl.stage.TransformManager
class VerificationSpec extends FirrtlFlatSpec {
behavior of "Formal"
@@ -77,4 +78,20 @@ class VerificationSpec extends FirrtlFlatSpec {
assert(ir.Serializer.serialize(c) == "assume(clk, pred, en, \"test \\t test\")")
}
+
+ "VerificationStatements" should "end up at the bottom of the circuit like other simulation statements" in {
+ val compiler = new TransformManager(Seq(Dependency(firrtl.passes.ExpandWhens)))
+ val in =
+ """circuit m :
+ | module m :
+ | input clock : Clock
+ | input a : UInt<8>
+ | output b : UInt<16>
+ | b <= a
+ | assert(clock, eq(a, b), UInt<1>("h1"), "")
+ |""".stripMargin
+ val afterExpandWhens = compiler.transform(CircuitState(firrtl.Parser.parse(in), Seq())).circuit.serialize
+ val lastLine = afterExpandWhens.split("\n").last
+ assert(lastLine.trim.startsWith("assert"))
+ }
}