From 39d76a02785f4391b67abd3b7d7720d287736312 Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Tue, 21 Apr 2020 22:41:23 -0400 Subject: Mixin DependencyAPIMigration to all Transforms This mixes in the new DependencyAPIMigration trait into all Transforms and Passes. This enables in-tree transforms/passes to build without deprecation warnings associated with the deprecated CircuitForm. As a consequence of this, every Transform now has UnknownForm as both its inputForm and outputForm. This PR modifies legacy Compiler and testing infrastructure to schedule transforms NOT using mergeTransforms/getLoweringTransforms (which rely on inputForm and outputForm not being UnknownForm), but instead using the Dependency API. Signed-off-by: Schuyler Eldridge --- src/test/scala/firrtlTests/AnnotationTests.scala | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/test/scala/firrtlTests/AnnotationTests.scala') diff --git a/src/test/scala/firrtlTests/AnnotationTests.scala b/src/test/scala/firrtlTests/AnnotationTests.scala index 31ee9680..a898d216 100644 --- a/src/test/scala/firrtlTests/AnnotationTests.scala +++ b/src/test/scala/firrtlTests/AnnotationTests.scala @@ -35,9 +35,21 @@ trait AnnotationSpec extends LowTransformSpec { } } +object AnnotationTests { + + class DeletingTransform extends Transform { + val inputForm = LowForm + val outputForm = LowForm + def execute(state: CircuitState) = state.copy(annotations = Seq()) + } + +} + // Abstract but with lots of tests defined so that we can use the same tests // for Legacy and newer Annotations abstract class AnnotationTests extends AnnotationSpec with Matchers { + import AnnotationTests._ + def anno(s: String, value: String ="this is a value", mod: String = "Top"): Annotation def manno(mod: String): Annotation @@ -59,11 +71,6 @@ abstract class AnnotationTests extends AnnotationSpec with Matchers { | module Top : | input in: UInt<3> |""".stripMargin - class DeletingTransform extends Transform { - val inputForm = LowForm - val outputForm = LowForm - def execute(state: CircuitState) = state.copy(annotations = Seq()) - } val transform = new DeletingTransform val tname = transform.name val inlineAnn = InlineAnnotation(CircuitName("Top")) -- cgit v1.2.3