diff options
| author | Jack Koenig | 2017-06-29 14:20:09 -0700 |
|---|---|---|
| committer | GitHub | 2017-06-29 14:20:09 -0700 |
| commit | 905cac96053caf4b6c87ac0b9c8addf313d1085c (patch) | |
| tree | 7d0bcf384f63e0176acdd70f9524369bb5bb4ce0 /src/test/scala/firrtlTests/AnnotationTests.scala | |
| parent | 8eb69dd91e58915f8dad5e42da0a3fe686c628d8 (diff) | |
| parent | a0aeafa3d591f9bcc14eca6d8a41eb2155f1b5b0 (diff) | |
Merge pull request #617 from freechipsproject/const-prop-regs
Improvements to Constant Propagation and Testing
Diffstat (limited to 'src/test/scala/firrtlTests/AnnotationTests.scala')
| -rw-r--r-- | src/test/scala/firrtlTests/AnnotationTests.scala | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/test/scala/firrtlTests/AnnotationTests.scala b/src/test/scala/firrtlTests/AnnotationTests.scala index 3e93081e..aeefbbe3 100644 --- a/src/test/scala/firrtlTests/AnnotationTests.scala +++ b/src/test/scala/firrtlTests/AnnotationTests.scala @@ -23,13 +23,13 @@ trait AnnotationSpec extends LowTransformSpec { def transform = new ResolveAndCheck // Check if Annotation Exception is thrown - override def failingexecute(annotations: AnnotationMap, input: String): Exception = { + override def failingexecute(input: String, annotations: Seq[Annotation]): Exception = { intercept[AnnotationException] { - compile(CircuitState(parse(input), ChirrtlForm, Some(annotations)), Seq.empty) + compile(CircuitState(parse(input), ChirrtlForm, Some(AnnotationMap(annotations))), Seq.empty) } } - def execute(aMap: Option[AnnotationMap], input: String, check: Annotation): Unit = { - val cr = compile(CircuitState(parse(input), ChirrtlForm, aMap), Seq.empty) + def execute(input: String, check: Annotation, annotations: Seq[Annotation]): Unit = { + val cr = compile(CircuitState(parse(input), ChirrtlForm, Some(AnnotationMap(annotations))), Seq.empty) cr.annotations.get.annotations should contain (check) } } @@ -49,13 +49,6 @@ class AnnotationTests extends AnnotationSpec with Matchers { Annotation(ComponentName(s, ModuleName(mod, CircuitName("Top"))), classOf[Transform], value) def manno(mod: String): Annotation = Annotation(ModuleName(mod, CircuitName("Top")), classOf[Transform], "some value") - // TODO unify with FirrtlMatchers, problems with multiple definitions of parse - def dontTouch(path: String): Annotation = { - val parts = path.split('.') - require(parts.size >= 2, "Must specify both module and component!") - val name = ComponentName(parts.tail.mkString("."), ModuleName(parts.head, CircuitName("Top"))) - DontTouchAnnotation(name) - } "Loose and Sticky annotation on a node" should "pass through" in { val input: String = @@ -65,7 +58,7 @@ class AnnotationTests extends AnnotationSpec with Matchers { | input b : UInt<1> | node c = b""".stripMargin val ta = anno("c", "") - execute(getAMap(ta), input, ta) + execute(input, ta, Seq(ta)) } "Annotations" should "be readable from file" in { |
