From 0a1aa5f56fe5eb563de7c33faa8eae33caa65441 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Mon, 19 Apr 2021 14:11:21 -0700 Subject: Hoist Transform timing to the Phase level (#2190) With Stage/Phase, users can provide complex functionality at the phase level rather than just the transform level. It is useful to have the same logging information at that level. Note that this change still logs transforms in the same way, but now the time in inclusive of annotation renaming which can also [unfortunately] be slow. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>--- src/main/scala/firrtl/options/DependencyManager.scala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/main/scala/firrtl/options') diff --git a/src/main/scala/firrtl/options/DependencyManager.scala b/src/main/scala/firrtl/options/DependencyManager.scala index 5e911940..f8299bbb 100644 --- a/src/main/scala/firrtl/options/DependencyManager.scala +++ b/src/main/scala/firrtl/options/DependencyManager.scala @@ -275,7 +275,14 @@ trait DependencyManager[A, B <: TransformLike[A] with DependencyAPI[B]] extends | prerequisites: ${prerequisites.mkString("\n -", "\n -", "")}""".stripMargin ) } - (t.transform(a), ((state + wrapperToClass(t)).map(dToO).filterNot(t.invalidates).map(oToD))) + val logger = t.getLogger + logger.info(s"======== Starting ${t.name} ========") + val (timeMillis, annosx) = firrtl.Utils.time { t.transform(a) } + logger.info(s"""----------------------------${"-" * t.name.size}---------\n""") + logger.info(f"Time: $timeMillis%.1f ms") + logger.info(s"======== Finished ${t.name} ========") + val statex = (state + wrapperToClass(t)).map(dToO).filterNot(t.invalidates).map(oToD) + (annosx, statex) }._1 } -- cgit v1.2.3