Commit 41a66104 authored by Jens Korinth's avatar Jens Korinth

Closes #91 - Alternatives are not built prior to DSE

* alternatives are now checked and built, in case the alternatives
  dimension is activated in DSE
parent dd2daa49
......@@ -58,8 +58,19 @@ object Alternatives {
* @param target Target Architecture and Platform
* @return Set of alternative names for kernel on Target **/
def alternatives(kernel: String, target: Target)(implicit cfg: Configuration): Set[String] =
//idForName(kernel) map (namesForId(_, target)) getOrElse(Set())
idForName(kernel) map (namesForId(_)) getOrElse(Set())
/** Returns alternative kernels for given kernel.
* @param kernel Kernel to find alternatives to.
* @return Set of alternative Kernels. **/
def alternatives(kernel: Kernel)(implicit cfg: Configuration): Set[Kernel] =
FileAssetManager.entities.kernels.filter(_.id equals kernel.id)
/** Returns alternative kernels for given kernel name.
* @param name Name of Kernel; this may be used to find alternatives to an Verilog/VHDL core.
* @return Set of alternative Kernels. **/
def alternatives(name: String)(implicit cfg: Configuration): Set[Kernel] =
FileAssetManager.entities.kernels.filter(k => idForName(name) map (_ equals k.id) getOrElse false)
/** Returns alternative compositions on given Target.
* @param bd Original Composition
......
......@@ -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.dse._
import de.tu_darmstadt.cs.esa.tapasco.filemgmt._
import de.tu_darmstadt.cs.esa.tapasco.task._
import de.tu_darmstadt.cs.esa.tapasco.jobs._
......@@ -42,12 +43,18 @@ private object DesignSpaceExploration extends Executor[DesignSpaceExplorationJob
val kernels = job.initialComposition.composition map (_.kernel) toSet
logger.debug("kernels found in composition: {}", kernels)
logger.debug("alternative kernels: {}", kernels map (Alternatives.alternatives _))
val missing = for {
val missing = (for {
k <- kernels
t <- job.targets
if FileAssetManager.entities.core(k, t).isEmpty
} yield (k, t)
} yield (k, t)) ++ (for {
k <- kernels
t <- job.targets
a <- Alternatives.alternatives(k)
if job.dimensions.alternatives && FileAssetManager.entities.core(a.name, t).isEmpty
} yield (a.name, t))
if (missing.nonEmpty) {
logger.info("need to synthesize the following cores first: {}",
......
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