aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala')
-rw-r--r--src/test/scala/firrtlTests/CompilerTests.scala29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/CompilerTests.scala b/src/test/scala/firrtlTests/CompilerTests.scala
index 348ed300..ff7d2cb8 100644
--- a/src/test/scala/firrtlTests/CompilerTests.scala
+++ b/src/test/scala/firrtlTests/CompilerTests.scala
@@ -13,6 +13,7 @@ import firrtl.{
Compiler,
HighFirrtlCompiler,
MiddleFirrtlCompiler,
+ MinimumVerilogCompiler,
LowFirrtlCompiler,
Parser,
VerilogCompiler
@@ -153,3 +154,31 @@ class VerilogCompilerSpec extends CompilerSpec with Matchers {
getOutput should be (check)
}
}
+
+class MinimumVerilogCompilerSpec extends CompilerSpec with Matchers {
+ val input = """|circuit Top:
+ | module Top:
+ | output b: UInt<1>[2]
+ | node c = UInt<1>("h0")
+ | node d = UInt<1>("h0")
+ | b[0] <= UInt<1>("h0")
+ | b[1] <= c
+ |""".stripMargin
+ val check = """|module Top(
+ | output b_0,
+ | output b_1
+ |);
+ | wire c;
+ | wire d;
+ | assign c = 1'h0;
+ | assign d = 1'h0;
+ | assign b_0 = 1'h0;
+ | assign b_1 = c;
+ |endmodule
+ |""".stripMargin
+ def compiler = new MinimumVerilogCompiler()
+
+ "A circuit's minimum Verilog output" should "not have constants propagated or dead code eliminated" in {
+ getOutput should be (check)
+ }
+}