diff options
| author | Kevin Laeufer | 2020-08-05 13:35:41 -0700 |
|---|---|---|
| committer | GitHub | 2020-08-05 20:35:41 +0000 |
| commit | b1ec7cd70ab267cd30d8421651625ba1d9a623ff (patch) | |
| tree | 237c666247aa285719d38bb46ea3445f0d880703 /src/main/scala/firrtl/annotations/transforms | |
| parent | 687f3ddbbcd9217542a4bc0e2c256559d2c67a5b (diff) | |
Deprecate InstanceGraph (#1800)
* InstanceKeyGraph: add staticInstanceCount, getGraph and getChildrenInstanceMap
* InstanceKeyGraph: reachableModules, unreachableModules, lowestCommonAncestor and fullHierarchy
* Replace usage of InstanceGraph with InstanceKeyGraph
Also deprecates all unused methods.
* WiringUtils: make new version of sinksToSources package private
This will make our live easier next time we need to change it.
* CircuitGraph: use InstanceKeyGraph
* InstanceKeyGraphSpec: respect maximum line width
* InstanceKeyGraph: make constructor private
* InstanceKeyGraph: move lowestCommonAncestor function to Wiring
* WiringUtils: update deprecation message
Diffstat (limited to 'src/main/scala/firrtl/annotations/transforms')
| -rw-r--r-- | src/main/scala/firrtl/annotations/transforms/EliminateTargetPaths.scala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/scala/firrtl/annotations/transforms/EliminateTargetPaths.scala b/src/main/scala/firrtl/annotations/transforms/EliminateTargetPaths.scala index 402f7028..d92d3b5e 100644 --- a/src/main/scala/firrtl/annotations/transforms/EliminateTargetPaths.scala +++ b/src/main/scala/firrtl/annotations/transforms/EliminateTargetPaths.scala @@ -3,7 +3,7 @@ package firrtl.annotations.transforms import firrtl.Mappers._ -import firrtl.analyses.InstanceGraph +import firrtl.analyses.InstanceKeyGraph import firrtl.annotations.ModuleTarget import firrtl.annotations.TargetToken.{Instance, OfModule, fromDefModuleToTargetToken} import firrtl.annotations.analysis.DuplicationHelper @@ -132,7 +132,7 @@ class EliminateTargetPaths extends Transform with DependencyAPIMigration { */ def run(cir: Circuit, targets: Seq[IsMember], - iGraph: InstanceGraph + iGraph: InstanceKeyGraph ): (Circuit, RenameMap, AnnotationSeq) = { val dupMap = DuplicationHelper(cir.modules.map(_.name).toSet) @@ -239,8 +239,8 @@ class EliminateTargetPaths extends Transform with DependencyAPIMigration { val targets = targetsToEliminate.collect { case x: IsMember => x } // Check validity of paths in targets - val iGraph = new InstanceGraph(state.circuit) - val instanceOfModules = iGraph.getChildrenInstanceOfModule + val iGraph = InstanceKeyGraph(state.circuit) + val instanceOfModules = iGraph.getChildInstances.map { case(k,v) => k -> v.map(_.toTokens) }.toMap val targetsWithInvalidPaths = mutable.ArrayBuffer[IsMember]() targets.foreach { t => val path = t match { @@ -311,8 +311,8 @@ class EliminateTargetPaths extends Transform with DependencyAPIMigration { nextRenameMap } - val iGraphx = new InstanceGraph(newCircuit) - val newlyUnreachableModules = iGraphx.unreachableModules diff iGraph.unreachableModules + val iGraphx = InstanceKeyGraph(newCircuit) + val newlyUnreachableModules = iGraphx.unreachableModules.toSet diff iGraph.unreachableModules.toSet val newCircuitGC = { val modulesx = newCircuit.modules.flatMap{ |
