Commit e1877293 authored by Lukas Sommer's avatar Lukas Sommer
Browse files

Additional field for number of slave ports in XML synthesis report;

parent 59c3499a
......@@ -23,4 +23,8 @@
<AchievedClockPeriod>@@MIN_PERIOD@@</AchievedClockPeriod>
</TimingReport>
<PortReport>
<NumSlaves>@@SLAVES@@</NumSlaves>
</PortReport>
</profile>
......@@ -122,7 +122,8 @@ object EvaluateIP {
logger.trace("%s: Vivado finished successfully".format(runPrefix))
val ur = UtilizationReport(files.rpt_util).get
val dpd = TimingReport(files.rpt_timing).get.dataPathDelay
writeXMLReport(reportFile, ur, dpd, targetPeriod)
val numSlaves = PortReport(files.rpt_port).get.numSlaves
writeXMLReport(reportFile, ur, dpd, targetPeriod, numSlaves)
logger.info("{} finished successfully, report in {}", runPrefix: Any, reportFile)
// clean up files on exit
deleteOnExit(files.baseDir.toFile)
......@@ -179,7 +180,7 @@ object EvaluateIP {
* @param targetPeriod Target operating period.
**/
private def writeXMLReport(reportFile: Path, ur: UtilizationReport, dataPathDelay: Double,
targetPeriod: Double): Unit = {
targetPeriod: Double, slaves : Int): Unit = {
val needles = scala.collection.mutable.Map[String, String](
"SLICE" -> ur.used.SLICE.toString,
"SLICES" -> ur.available.SLICE.toString,
......@@ -192,7 +193,8 @@ object EvaluateIP {
"DSP" -> ur.used.DSP.toString,
"DSPS" -> ur.available.DSP.toString,
"PERIOD" -> targetPeriod.toString,
"MIN_PERIOD" -> dataPathDelay.toString
"MIN_PERIOD" -> dataPathDelay.toString,
"SLAVES" -> slaves.toString
)
// write final report
......
package de.tu_darmstadt.cs.esa.tapasco.reports
import java.nio.file.Path
final case class PortReport(override val file : Path, numSlaves : Int) extends Report(file)
object PortReport {
def apply(pr : Path) : Option[PortReport] = Some(PortReport(pr, 42))
// TODO Actually parse report after it was filled by the TCL script.
}
......@@ -30,9 +30,10 @@ import java.nio.file.Path
final case class SynthesisReport(
override val file: Path,
area: Option[AreaEstimate],
timing: Option[TimingEstimate]) extends Report(file) {
timing: Option[TimingEstimate],
ports : Option[Int]) extends Report(file) {
require(file.toFile.exists, "file %s does not exist".format(file.toString))
require(area.nonEmpty || timing.nonEmpty, "no synthesis results found in %s".format(file.toString))
require(area.nonEmpty || timing.nonEmpty || ports.nonEmpty, "no synthesis results found in %s".format(file.toString))
}
object SynthesisReport {
......@@ -64,9 +65,14 @@ object SynthesisReport {
((xml \\ "TimingReport" \\ "TargetClockPeriod") text).toDouble))
} catch { case e: Exception => logger.warn("parsing timing report failed: " + e); None }
def extractSlavePorts(sr : Path) : Option[Int] = try {
val xml = scala.xml.XML.loadFile(sr.toAbsolutePath.toString)
Some(((xml \\ "PortReport" \\ "NumSlaves") text).toInt)
} catch { case e : Exception => logger.warn("parsing port report failed: %s".format(e)); None}
/** Produce SynthesisReport instance from file. **/
def apply(sr: Path): Option[SynthesisReport] = catchAllDefault(None: Option[SynthesisReport],
"failed to read synthesis report %s: ".format(sr.toString)) {
Some(SynthesisReport(sr, extractArea(sr), extractTiming(sr)))
Some(SynthesisReport(sr, extractArea(sr), extractTiming(sr), extractSlavePorts(sr)))
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment