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 --- .../transforms/FixAddingNegativeLiteralsTransform.scala | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/main/scala/firrtl/transforms/FixAddingNegativeLiteralsTransform.scala') diff --git a/src/main/scala/firrtl/transforms/FixAddingNegativeLiteralsTransform.scala b/src/main/scala/firrtl/transforms/FixAddingNegativeLiteralsTransform.scala index 59d14ab2..6a7e75e0 100644 --- a/src/main/scala/firrtl/transforms/FixAddingNegativeLiteralsTransform.scala +++ b/src/main/scala/firrtl/transforms/FixAddingNegativeLiteralsTransform.scala @@ -2,7 +2,7 @@ package firrtl.transforms -import firrtl.{CircuitState, Namespace, PrimOps, Transform, UnknownForm, Utils, WRef} +import firrtl.{CircuitState, DependencyAPIMigration, Namespace, PrimOps, Transform, Utils, WRef} import firrtl.ir._ import firrtl.Mappers._ import firrtl.options.{Dependency, PreservesAll} @@ -107,15 +107,13 @@ object FixAddingNegativeLiterals { * the literal and thus not all expressions in the add are the same. This is fixed here when we directly * subtract the literal instead. */ -class FixAddingNegativeLiterals extends Transform with PreservesAll[Transform] { - def inputForm = UnknownForm - def outputForm = UnknownForm +class FixAddingNegativeLiterals extends Transform with DependencyAPIMigration with PreservesAll[Transform] { - override val prerequisites = Forms.LowFormMinimumOptimized :+ Dependency[BlackBoxSourceHelper] + override def prerequisites = Forms.LowFormMinimumOptimized :+ Dependency[BlackBoxSourceHelper] - override val optionalPrerequisites = firrtl.stage.Forms.LowFormOptimized + override def optionalPrerequisites = firrtl.stage.Forms.LowFormOptimized - override val dependents = Seq.empty + override def dependents = Seq.empty def execute(state: CircuitState): CircuitState = { val modulesx = state.circuit.modules.map(FixAddingNegativeLiterals.fixupModule) -- cgit v1.2.3