aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/Compiler.scala
diff options
context:
space:
mode:
authorAdam Izraelevitz2017-03-03 17:04:43 -0800
committerAdam Izraelevitz2017-03-06 16:48:15 -0800
commitfa4922dd3d985350fbc30281f6ffcf6e05c542ad (patch)
tree1ba8ac3195806c5684a2ac2fbedf724ca056819a /src/main/scala/firrtl/Compiler.scala
parentb5ef5b876d4f4ad4a17bc81362b2264970272d63 (diff)
Added more stylized debugging style
Diffstat (limited to 'src/main/scala/firrtl/Compiler.scala')
-rw-r--r--src/main/scala/firrtl/Compiler.scala23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/main/scala/firrtl/Compiler.scala b/src/main/scala/firrtl/Compiler.scala
index 780f5eb0..3da25083 100644
--- a/src/main/scala/firrtl/Compiler.scala
+++ b/src/main/scala/firrtl/Compiler.scala
@@ -131,9 +131,12 @@ abstract class Transform {
trait SimpleRun extends LazyLogging {
def runPasses(circuit: Circuit, passSeq: Seq[Pass]): Circuit =
passSeq.foldLeft(circuit) { (c: Circuit, pass: Pass) =>
- val x = Utils.time(pass.name) { pass.run(c) }
- logger.debug(s"** Pass ${pass.name} **")
- logger.debug(x.serialize)
+ val name = pass.name
+ logger.info(s"-------- Starting Pass $name --------")
+ val (timeMillis, x) = Utils.time { pass.run(c) }
+ logger.info(f"Time: $timeMillis%.1f ms")
+ logger.debug(s"Circuit:\n${c.serialize}")
+ logger.info(s"-------- Finished Pass $name --------")
x
}
}
@@ -311,7 +314,10 @@ trait Compiler extends LazyLogging {
val allTransforms = CompilerUtils.mergeTransforms(transforms, customTransforms) :+ emitter
val finalState = allTransforms.foldLeft(state) { (in, xform) =>
- val result = Utils.time(s"***${xform.name}***") { xform.execute(in) }
+ logger.info(s"======== Starting Transform ${xform.name} ========")
+ val (timeMillis, result) = Utils.time { xform.execute(in) }
+
+ logger.info(f"Time: $timeMillis%.1f ms")
val newAnnotations = {
val inSet = in.annotations.getOrElse(AnnotationMap(Seq.empty)).annotations.toSet
@@ -331,12 +337,15 @@ trait Compiler extends LazyLogging {
anno <- newAnnotations.toSeq
newAnno <- anno.update(renames.getOrElse(anno.target, Seq(anno.target)))
} yield newAnno
- logger.debug(s"*** ${xform.name} ***")
- logger.debug(s"Form: ${result.form}")
- logger.debug(result.circuit.serialize)
+
+ logger.info(s"Form: ${result.form}")
+ logger.debug(s"Annotations:")
remappedAnnotations.foreach { a =>
logger.debug(a.serialize)
}
+ logger.debug(s"Circuit:\n${result.circuit.serialize}")
+ logger.info(s"======== Finished Transform ${xform.name} ========\n")
+
CircuitState(result.circuit, result.form, Some(AnnotationMap(remappedAnnotations)))
}
finalState