aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorJack Koenig2017-03-29 19:57:41 -0700
committerGitHub2017-03-29 19:57:41 -0700
commit8c8634639b424b7c856240d974ffd6405325dd42 (patch)
tree50388edd6c34363241f863cae6dd461f29dac726 /src/test
parent476d0d7475d641bc61d7630c8a7a8966cf61e04c (diff)
Fix bug where zero width expressions in nodes wouldn't get zeroed (#514)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/firrtlTests/ZeroWidthTests.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/ZeroWidthTests.scala b/src/test/scala/firrtlTests/ZeroWidthTests.scala
index 5cb7e532..90926bc1 100644
--- a/src/test/scala/firrtlTests/ZeroWidthTests.scala
+++ b/src/test/scala/firrtlTests/ZeroWidthTests.scala
@@ -105,6 +105,20 @@ class ZeroWidthTests extends FirrtlFlatSpec {
| skip""".stripMargin
(parse(exec(input)).serialize) should be (parse(check).serialize)
}
+ "Expression in node with type <0>" should "be replaced by UInt<1>(0)" in {
+ val input =
+ """circuit Top :
+ | module Top :
+ | input x: UInt<1>
+ | input y: UInt<0>
+ | node z = add(x, y)""".stripMargin
+ val check =
+ """circuit Top :
+ | module Top :
+ | input x: UInt<1>
+ | node z = add(x, UInt<1>(0))""".stripMargin
+ (parse(exec(input)).serialize) should be (parse(check).serialize)
+ }
}
class ZeroWidthVerilog extends FirrtlFlatSpec {