From 17437907de4ad12eb3f8d0818a158eb6959591a3 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Tue, 10 Jul 2018 19:03:53 -0700 Subject: Fix bug in zero-width renaming (#845) Previously, Vecs of Bundles that contained a zero-width element would result in a ClassCastException--- src/test/scala/firrtlTests/AnnotationTests.scala | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/test') diff --git a/src/test/scala/firrtlTests/AnnotationTests.scala b/src/test/scala/firrtlTests/AnnotationTests.scala index 99e1ea2c..b2aeda77 100644 --- a/src/test/scala/firrtlTests/AnnotationTests.scala +++ b/src/test/scala/firrtlTests/AnnotationTests.scala @@ -430,10 +430,13 @@ abstract class AnnotationTests extends AnnotationSpec with Matchers { | output y : { foo : UInt<8>, bar : {}, fizz : UInt<8>[0], buzz : UInt<0> } | output a : {} | output b : UInt<8>[0] + | output c : { d : UInt<0>, e : UInt<8> }[2] + | c is invalid | y <= x |""".stripMargin val annos = Seq( - anno("x"), anno("y.bar"), anno("y.fizz"), anno("y.buzz"), anno("a"), anno("b") + anno("x"), anno("y.bar"), anno("y.fizz"), anno("y.buzz"), anno("a"), anno("b"), anno("c"), + anno("c[0].d"), anno("c[1].d") ) val result = compiler.compile(CircuitState(parse(input), ChirrtlForm, annos), Nil) val resultAnno = result.annotations.toSeq @@ -453,6 +456,13 @@ abstract class AnnotationTests extends AnnotationSpec with Matchers { resultAnno should not contain (anno("x_bar")) resultAnno should not contain (anno("x_fizz")) resultAnno should not contain (anno("x_buzz")) + resultAnno should not contain (anno("c")) + resultAnno should contain (anno("c_0_e")) + resultAnno should contain (anno("c_1_e")) + resultAnno should not contain (anno("c[0].d")) + resultAnno should not contain (anno("c[1].d")) + resultAnno should not contain (anno("c_0_d")) + resultAnno should not contain (anno("c_1_d")) } } -- cgit v1.2.3