Commit d764cc24 authored by Jens Korinth's avatar Jens Korinth

Compose: Rebuild only missing kernels

* Compose started an HLS task for every PE in a Composition
* problem, if Core does not have a Kernel (imported IP-XACT)
* wanted to fix that in any case, but until now it was just a
  convenience/efficiency thing, now it was a bug
parent 3773b845
......@@ -60,6 +60,10 @@ final case class ComposeJob(
/** Returns the list of [[base.Platform]] instances selected in this job. */
def platforms: Set[Platform] =
FileAssetManager.entities.platforms filter (p => _platforms map (_.contains(p.name)) getOrElse true)
/** Returns a list of [[base.Target]]s selected in this job. */
def targets: Seq[Target] =
for { a <- architectures.toSeq.sortBy(_.name); p <- platforms.toSeq.sortBy(_.name) } yield Target(a, p)
}
/**
......
......@@ -23,6 +23,7 @@
**/
package de.tu_darmstadt.cs.esa.tapasco.jobs.executors
import de.tu_darmstadt.cs.esa.tapasco.base._
import de.tu_darmstadt.cs.esa.tapasco.filemgmt._
import de.tu_darmstadt.cs.esa.tapasco.task._
import de.tu_darmstadt.cs.esa.tapasco.jobs.{ComposeJob, HighLevelSynthesisJob}
import java.util.concurrent.Semaphore
......@@ -41,13 +42,28 @@ private object Compose extends Executor[ComposeJob] {
logger.debug("kernels found in compositions: {}", kernels)
// run HLS job first to build all kernels (will skip existing ones)
val hls_ok = HighLevelSynthesisJob(
"VivadoHLS", // FIXME
if (job.architectures.size > 0) Some(job.architectures.toSeq map (_.name) sorted) else None,
if (job.platforms.size > 0) Some(job.platforms.toSeq map (_.name) sorted) else None,
Some(kernels.toSeq.sorted)
).execute
val missing = for {
k <- kernels
t <- job.targets
if FileAssetManager.entities.core(k, t).isEmpty
} yield (k, t)
if (missing.nonEmpty) {
logger.info("need to synthesize the following cores first: {}",
missing map { case (k, t) => "%s @ %s".format(k, t) } mkString ", ")
}
val hls_results = missing map { case (k, t) =>
// run HLS job for this kernel and target
HighLevelSynthesisJob(
"VivadoHLS", // FIXME
Some(Seq(t.ad.name)),
Some(Seq(t.pd.name)),
Some(Seq(k))
).execute
}
val hls_ok = (hls_results fold true) (_ && _)
if (hls_ok) {
logger.info("all HLS tasks finished successfully, beginning compose run...")
......
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