From 6b21b7df6f70ed753abe03814c88ef9010259303 Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Wed, 15 Jan 2020 17:12:53 -0500 Subject: Filter ResolvePaths in EliminateTargetPaths (#1310) Change EliminateTargetPaths to remove ResolvePaths annotations in the output AnnotationSeq. This prevents a bug whereby the upstream ResolvePaths annotations from previous runs of EliminateTargetPaths can result in unexpected duplication. Adds a test that checks that ResolvePaths annotations are actually removed. Signed-off-by: Schuyler Eldridge Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .../annotationTests/EliminateTargetPathsSpec.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/test') diff --git a/src/test/scala/firrtlTests/annotationTests/EliminateTargetPathsSpec.scala b/src/test/scala/firrtlTests/annotationTests/EliminateTargetPathsSpec.scala index c75e0914..7aac277f 100644 --- a/src/test/scala/firrtlTests/annotationTests/EliminateTargetPathsSpec.scala +++ b/src/test/scala/firrtlTests/annotationTests/EliminateTargetPathsSpec.scala @@ -357,4 +357,19 @@ class EliminateTargetPathsSpec extends FirrtlPropSpec with FirrtlMatchers { outputLines should contain (line) } } + + property("It should remove ResolvePaths annotations") { + val input = + """|circuit Foo: + | module Bar: + | skip + | module Foo: + | inst bar of Bar + |""".stripMargin + + CircuitState(passes.ToWorkingIR.run(Parser.parse(input)), UnknownForm, Nil) + .resolvePaths(Seq(CircuitTarget("Foo").module("Foo").instOf("bar", "Bar"))) + .annotations + .collect{ case a: firrtl.annotations.transforms.ResolvePaths => a } should be (empty) + } } -- cgit v1.2.3