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

Also store the number of AXI4 masters in the XML synthesis report;

parent e3f219c0
......@@ -24,6 +24,7 @@
</TimingReport>
<PortReport>
<NumMasters>@@MASTERS@@</NumMasters>
<NumSlaves>@@SLAVES@@</NumSlaves>
</PortReport>
......
......@@ -122,8 +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
val numSlaves = PortReport(files.rpt_port).get.numSlaves
writeXMLReport(reportFile, ur, dpd, targetPeriod, numSlaves)
val portReport = PortReport(files.rpt_port).get
writeXMLReport(reportFile, ur, dpd, targetPeriod, portReport.numMasters, portReport.numSlaves)
logger.info("{} finished successfully, report in {}", runPrefix: Any, reportFile)
// clean up files on exit
deleteOnExit(files.baseDir.toFile)
......@@ -180,7 +180,7 @@ object EvaluateIP {
* @param targetPeriod Target operating period.
**/
private def writeXMLReport(reportFile: Path, ur: UtilizationReport, dataPathDelay: Double,
targetPeriod: Double, slaves : Int): Unit = {
targetPeriod: Double, masters : Int, slaves : Int): Unit = {
val needles = scala.collection.mutable.Map[String, String](
"SLICE" -> ur.used.SLICE.toString,
"SLICES" -> ur.available.SLICE.toString,
......@@ -194,6 +194,7 @@ object EvaluateIP {
"DSPS" -> ur.available.DSP.toString,
"PERIOD" -> targetPeriod.toString,
"MIN_PERIOD" -> dataPathDelay.toString,
"MASTERS" -> masters.toString,
"SLAVES" -> slaves.toString
)
......
......@@ -31,9 +31,10 @@ final case class SynthesisReport(
override val file: Path,
area: Option[AreaEstimate],
timing: Option[TimingEstimate],
ports : Option[Int]) extends Report(file) {
masters : Option[Int],
slaves : Option[Int]) extends Report(file) {
require(file.toFile.exists, "file %s does not exist".format(file.toString))
require(area.nonEmpty || timing.nonEmpty || ports.nonEmpty, "no synthesis results found in %s".format(file.toString))
require(area.nonEmpty || timing.nonEmpty || masters.nonEmpty || slaves.nonEmpty, "no synthesis results found in %s".format(file.toString))
}
object SynthesisReport {
......@@ -51,8 +52,8 @@ object SynthesisReport {
val ff: Integer = ((xml \\ "AreaReport" \\ e \\ "FF") text).toInt
val dsp: Integer = ((xml \\ "AreaReport" \\ e \\ "DSP") text).toInt
val bram: Integer = ((xml \\ "AreaReport" \\ e \\ "BRAM") text).toInt
new ResourcesEstimate(slice, lut, ff, dsp, bram)
}).grouped(2).map(x => new AreaEstimate(x.head, x.tail.head)).toList.headOption
ResourcesEstimate(slice, lut, ff, dsp, bram)
}).grouped(2).map(x => AreaEstimate(x.head, x.tail.head)).toList.headOption
} catch { case e: Exception => logger.warn("parsing utilization report failed: " + e); None }
/** Extracts the timing estimation from the given synthesis report file.
......@@ -65,6 +66,11 @@ object SynthesisReport {
((xml \\ "TimingReport" \\ "TargetClockPeriod") text).toDouble))
} catch { case e: Exception => logger.warn("parsing timing report failed: " + e); None }
def extractMasterPorts(sr : Path) : Option[Int] = try {
val xml = scala.xml.XML.loadFile(sr.toAbsolutePath.toString)
Some(((xml \\ "PortReport" \\ "NumMasters") text).toInt)
} catch { case e : Exception => logger.warn("parsing port report failed: %s".format(e)); None}
def extractSlavePorts(sr : Path) : Option[Int] = try {
val xml = scala.xml.XML.loadFile(sr.toAbsolutePath.toString)
Some(((xml \\ "PortReport" \\ "NumSlaves") text).toInt)
......@@ -73,6 +79,6 @@ object SynthesisReport {
/** 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), extractSlavePorts(sr)))
Some(SynthesisReport(sr, extractArea(sr), extractTiming(sr), extractMasterPorts(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