diff options
| author | Jack Koenig | 2020-09-14 19:43:01 -0700 |
|---|---|---|
| committer | GitHub | 2020-09-15 02:43:01 +0000 |
| commit | 0c646459b52394e8a388143cee324b8af3dc7c09 (patch) | |
| tree | 2a346a8669a48ae8ddba72488686f5cc70e98383 /src/test/scala/firrtlTests/annotationTests/EliminateTargetPathsSpec.scala | |
| parent | 5f410f0e4774121932d644f31fde83b9b8ed78be (diff) | |
Don't use ResolvedAnnotationPaths in ConstProp nor DCE (#1896)
Both use EliminateTargetPaths to duplicate modules based on annotations.
Currently, EliminateTargetPaths API is a little too limited so it
duplicates more than it should which effectively breaks Dedup whenever
DontTouchAnnotations are present.
Also, make ConstProp and DCE treat all HasDontTouches as local
annotations even if they are instance annotations. This is more
conservative but it is generally better to preserve deduplication than
to maximally optimize every instance.
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Diffstat (limited to 'src/test/scala/firrtlTests/annotationTests/EliminateTargetPathsSpec.scala')
| -rw-r--r-- | src/test/scala/firrtlTests/annotationTests/EliminateTargetPathsSpec.scala | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/src/test/scala/firrtlTests/annotationTests/EliminateTargetPathsSpec.scala b/src/test/scala/firrtlTests/annotationTests/EliminateTargetPathsSpec.scala index bb833f0b..56079c31 100644 --- a/src/test/scala/firrtlTests/annotationTests/EliminateTargetPathsSpec.scala +++ b/src/test/scala/firrtlTests/annotationTests/EliminateTargetPathsSpec.scala @@ -121,55 +121,37 @@ class EliminateTargetPathsSpec extends FirrtlPropSpec with FirrtlMatchers { val outputState = new LowFirrtlCompiler().compile(inputState, customTransforms) val check = """circuit Top : - | module Leaf___Top_m1_l1 : - | input i : UInt<1> - | output o : UInt<1> - | - | node a = i - | o <= i - | | module Leaf : | input i : UInt<1> | output o : UInt<1> - | - | skip + + | node a = i | o <= i | - | module Middle___Top_m1 : - | input i : UInt<1> - | output o : UInt<1> - | - | inst l1 of Leaf___Top_m1_l1 - | inst l2 of Leaf - | o <= l2.o - | l1.i <= i - | l2.i <= l1.o - | | module Middle : | input i : UInt<1> | output o : UInt<1> - | + | inst l1 of Leaf | inst l2 of Leaf | o <= l2.o | l1.i <= i | l2.i <= l1.o - | + | module Top : | input i : UInt<1> | output o : UInt<1> - | - | inst m1 of Middle___Top_m1 + + | inst m1 of Middle | inst m2 of Middle | o <= m2.o | m1.i <= i - | m2.i <= m1.o - | - """.stripMargin + | m2.i <= m1.o""".stripMargin + canonicalize(outputState.circuit).serialize should be(canonicalize(parse(check)).serialize) outputState.annotations.collect { case x: DontTouchAnnotation => x.target - } should be(Seq(Top.circuitTarget.module("Leaf___Top_m1_l1").ref("a"))) + } should be(Seq(Top.circuitTarget.module("Top").instOf("m1", "Middle").instOf("l1", "Leaf").ref("a"))) } property("No name conflicts between old and new modules") { |
