diff options
| author | Jack Koenig | 2017-02-28 10:24:29 -0800 |
|---|---|---|
| committer | Jack Koenig | 2017-03-01 18:01:28 -0600 |
| commit | 7f280a5b0821c61284e9bf9ed7780cc825f7f3e8 (patch) | |
| tree | 700d511e93c4058c627bb28ecc507d0c49eb6758 /src/test | |
| parent | 51f8f4a5e868a8e655091e3e61445d3cd772d2ba (diff) | |
Allow nested digit fields in subfield expressions
Workaround for #470. This allows parsing DoubleLits in subfield
expressions.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/scala/firrtlTests/ParserSpec.scala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/ParserSpec.scala b/src/test/scala/firrtlTests/ParserSpec.scala index a1f14c8e..cd9bfb40 100644 --- a/src/test/scala/firrtlTests/ParserSpec.scala +++ b/src/test/scala/firrtlTests/ParserSpec.scala @@ -93,6 +93,19 @@ class ParserSpec extends FirrtlFlatSpec { } } + // ********** Digits as Fields ********** + "Digits" should "be legal fields in bundles and in subexpressions" in { + val input = """ + |circuit Test : + | module Test : + | input in : { 0 : { 0 : UInt<32>, flip 1 : UInt<32> } } + | input in2 : { 4 : { 23 : { foo : UInt<32>, bar : { flip 123 : UInt<32> } } } } + | in.0.1 <= in.0.0 + | in2.4.23.bar.123 <= in2.4.23.foo + """.stripMargin + firrtl.Parser.parse(input split "\n") + } + // ********** Doubles as parameters ********** "Doubles" should "be legal parameters for extmodules" in { val nums = Seq("1.0", "7.6", "3.00004", "1.0E10", "1.0023E-17") |
