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/Compiler.scala | |
| 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/Compiler.scala')
| -rw-r--r-- | src/main/scala/firrtl/Compiler.scala | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/main/scala/firrtl/Compiler.scala b/src/main/scala/firrtl/Compiler.scala index 38b71f4a..2998af3c 100644 --- a/src/main/scala/firrtl/Compiler.scala +++ b/src/main/scala/firrtl/Compiler.scala @@ -210,22 +210,9 @@ final case object UnknownForm extends CircuitForm(-1) { // Internal utilities to keep code DRY, not a clean interface private[firrtl] object Transform { - // Run transform with logging - def runTransform(name: String, mk: => CircuitState, logger: Logger): CircuitState = { - logger.info(s"======== Starting Transform $name ========") - - val (timeMillis, result) = Utils.time(mk) - - logger.info(s"""----------------------------${"-" * name.size}---------\n""") - logger.info(f"Time: $timeMillis%.1f ms") - - result - } - def remapAnnotations(name: String, before: CircuitState, after: CircuitState, logger: Logger): CircuitState = { val remappedAnnotations = propagateAnnotations(name, logger, before.annotations, after.annotations, after.renames) - logger.info(s"Form: ${after.form}") logger.trace(s"Annotations:") logger.trace { JsonProtocol @@ -240,7 +227,6 @@ private[firrtl] object Transform { } logger.trace(s"Circuit:\n${after.circuit.serialize}") - logger.info(s"======== Finished Transform $name ========\n") CircuitState(after.circuit, after.form, remappedAnnotations, None) } @@ -385,7 +371,7 @@ trait Transform extends TransformLike[CircuitState] with DependencyAPI[Transform * @return A transformed Firrtl AST */ final def runTransform(state: CircuitState): CircuitState = { - val result = Transform.runTransform(name, execute(prepare(state)), logger) + val result = execute(prepare(state)) Transform.remapAnnotations(name, state, result, logger) } |
