From 97dcec4321f7a68f82487ce81de024c43787c02a Mon Sep 17 00:00:00 2001 From: Tynan McAuley Date: Sat, 26 Feb 2022 11:47:15 -0800 Subject: [PATCH] Run ConvertToExtMod before DedupModules Normally, `DedupModules` spends a lot of time working on modules that this pass removes. Having this run before `DedupModules` significantly speeds up FIRRTL compile time for the Harness block in Chipyard. Resolves https://github.com/ucb-bar/barstools/issues/119 --- .../barstools/tapeout/transforms/ConvertToExtModPass.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/scala/barstools/tapeout/transforms/ConvertToExtModPass.scala b/src/main/scala/barstools/tapeout/transforms/ConvertToExtModPass.scala index a81937a3..32f9235b 100644 --- a/src/main/scala/barstools/tapeout/transforms/ConvertToExtModPass.scala +++ b/src/main/scala/barstools/tapeout/transforms/ConvertToExtModPass.scala @@ -9,6 +9,7 @@ import firrtl.options.Dependency import firrtl.passes.memlib.ReplSeqMem import firrtl.stage.Forms import firrtl.stage.TransformManager.TransformDependency +import firrtl.transforms.DedupModules case class ConvertToExtModAnnotation(target: ModuleTarget) extends SingleTargetAnnotation[ModuleTarget] { def duplicate(n: ModuleTarget) = this.copy(n) @@ -19,10 +20,10 @@ case class ConvertToExtModAnnotation(target: ModuleTarget) extends SingleTargetA // otherwise it's left alone. class ConvertToExtMod extends Transform with DependencyAPIMigration { - override def prerequisites: Seq[TransformDependency] = Forms.HighForm + override def prerequisites: Seq[TransformDependency] = Seq.empty override def optionalPrerequisites: Seq[TransformDependency] = Seq.empty override def optionalPrerequisiteOf: Seq[TransformDependency] = { - Forms.HighEmitters ++ Seq(Dependency[RemoveUnusedModules], Dependency[ReplSeqMem]) + Forms.HighEmitters ++ Seq(Dependency[RemoveUnusedModules], Dependency[ReplSeqMem], Dependency[DedupModules]) } override def invalidates(a: Transform): Boolean = false