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 --- .../firrtl/annotations/transforms/EliminateTargetPaths.scala | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main/scala/firrtl/annotations/transforms') diff --git a/src/main/scala/firrtl/annotations/transforms/EliminateTargetPaths.scala b/src/main/scala/firrtl/annotations/transforms/EliminateTargetPaths.scala index 00f2ad6a..fe5090b2 100644 --- a/src/main/scala/firrtl/annotations/transforms/EliminateTargetPaths.scala +++ b/src/main/scala/firrtl/annotations/transforms/EliminateTargetPaths.scala @@ -9,7 +9,9 @@ import firrtl.annotations.TargetToken.{Instance, OfModule, fromDefModuleToTarget import firrtl.annotations.analysis.DuplicationHelper import firrtl.annotations._ import firrtl.ir._ -import firrtl.{CircuitForm, CircuitState, FirrtlInternalException, HighForm, RenameMap, Transform, WDefInstance} +import firrtl.{CircuitState, DependencyAPIMigration, FirrtlInternalException, RenameMap, Transform, WDefInstance} +import firrtl.options.PreservesAll +import firrtl.stage.Forms import scala.collection.mutable @@ -41,11 +43,11 @@ case class NoSuchTargetException(message: String) extends FirrtlInternalExceptio * B/x -> (B/x, B_/x) // where x is any reference in B * C/x -> (C/x, C_/x) // where x is any reference in C */ -class EliminateTargetPaths extends Transform { +class EliminateTargetPaths extends Transform with DependencyAPIMigration with PreservesAll[Transform] { - def inputForm: CircuitForm = HighForm - - def outputForm: CircuitForm = HighForm + override def prerequisites = Forms.MinimalHighForm + override def optionalPrerequisites = Seq.empty + override def dependents = Seq.empty /** Replaces old ofModules with new ofModules by calling dupMap methods * Updates oldUsedOfModules, newUsedOfModules -- cgit v1.2.3