aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala
diff options
context:
space:
mode:
authorSchuyler Eldridge2019-02-05 11:23:19 -0500
committerSchuyler Eldridge2019-02-05 14:09:42 -0500
commita77122b4bb8756636c169473af3dc367b14698ef (patch)
tree318e35fb1d2e7aa503ab7cff56d9169a9cdf4e99 /src/test/scala
parent6ef7ad148ff491c06d417d417e2134da7ff49ef7 (diff)
Add RemoveValidIf to -X mverilog
This adds the RemoveValidIf Pass to the MinimumLowFirrtlOptimization Transform. A test case is included to verify that `is invalid` is properly converted to a connection to zero. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Diffstat (limited to 'src/test/scala')
-rw-r--r--src/test/scala/firrtlTests/CompilerTests.scala15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/test/scala/firrtlTests/CompilerTests.scala b/src/test/scala/firrtlTests/CompilerTests.scala
index ff7d2cb8..df83dd38 100644
--- a/src/test/scala/firrtlTests/CompilerTests.scala
+++ b/src/test/scala/firrtlTests/CompilerTests.scala
@@ -159,21 +159,18 @@ 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
+ | node c = UInt<1>("h1")
+ | b[0] <= c
+ | b[1] is invalid
|""".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;
+ | assign c = 1'h1;
+ | assign b_0 = c;
+ | assign b_1 = 1'h0;
|endmodule
|""".stripMargin
def compiler = new MinimumVerilogCompiler()