diff options
| author | Jack Koenig | 2021-04-19 14:11:21 -0700 |
|---|---|---|
| committer | GitHub | 2021-04-19 21:11:21 +0000 |
| commit | 0a1aa5f56fe5eb563de7c33faa8eae33caa65441 (patch) | |
| tree | c6b8772ef65402c221b15fbc79ecfcc0344217f3 /src/main/scala/firrtl/options | |
| parent | 9c868ca02e5eb99bc317f92fd75252e0ab9fb7a2 (diff) | |
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>
Diffstat (limited to 'src/main/scala/firrtl/options')
| -rw-r--r-- | src/main/scala/firrtl/options/DependencyManager.scala | 9 |
1 files changed, 8 insertions, 1 deletions
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 } |
