Commit a62d8d19 authored by Lukas Sommer's avatar Lukas Sommer

Pass compose command effort level from frontend to TCL template;

parent 62acda9d
......@@ -70,6 +70,9 @@ set_msg_config -suppress -severity INFO
# ignore AXI Interrupt controller warning about manual edge trigger setting
set_msg_config -suppress -id {[xilinx.com:ip:axi_intc:4.1-7]}
# Synthesis and P&R effort level
puts @@EFFORT_LEVEL@@
# loadout-specific configuration
@@COMPOSITION@@
......
......@@ -43,7 +43,7 @@ trait Composer {
* @param cfg implicit Configuration instance
* @return Composer.Result with error code / additional data
**/
def compose(bd: Composition, target: Target, f: Double = 0, features: Seq[Feature] = Seq())
def compose(bd: Composition, target: Target, f: Double = 0, synthEffort : String, features: Seq[Feature] = Seq())
(implicit cfg: Configuration): Result
/** Removes all intermediate files for the run, leaving results.
......
......@@ -46,7 +46,7 @@ class VivadoComposer()(implicit cfg: Configuration) extends Composer {
def maxMemoryUsagePerProcess: Int = VIVADO_PROCESS_PEAK_MEM
/** @inheritdoc */
def compose(bd: Composition, target: Target, f: Heuristics.Frequency = 0, features: Seq[Feature] = Seq())
def compose(bd: Composition, target: Target, f: Heuristics.Frequency = 0, synthEffort : String, features: Seq[Feature] = Seq())
(implicit cfg: Configuration): Composer.Result = {
logger.debug("VivadoComposer uses at most {} threads", cfg.maxThreads getOrElse "unlimited")
// create output struct
......@@ -63,7 +63,8 @@ class VivadoComposer()(implicit cfg: Configuration) extends Composer {
projectName = Composer.mkProjectName(bd, target, f),
header = makeHeader(bd, target, f, features),
target = target,
composition = composition(bd, target))
composition = composition(bd, target),
effort = synthEffort)
logger.info("Vivado starting run {}: show progress with `vivado_progress {}`", files.runName: Any, files.logFile)
files.logFile.toFile.delete
......@@ -141,7 +142,7 @@ class VivadoComposer()(implicit cfg: Configuration) extends Composer {
/** Writes the .tcl script for Vivado. */
private def mkTclScript(fromTemplate: Path, to: Path, projectName: String, header: String, target: Target,
composition: String): Unit = {
composition: String, effort : String): Unit = {
// needles for template
val needles: scala.collection.mutable.Map[String, String] = scala.collection.mutable.Map(
"PROJECT_NAME" -> "microarch",
......@@ -155,6 +156,7 @@ class VivadoComposer()(implicit cfg: Configuration) extends Composer {
"PLATFORM_TCL" -> target.pd.tclLibrary.toString,
"ARCHITECTURE_TCL" -> target.ad.tclLibrary.toString,
"COMPOSITION" -> composition,
"EFFORT_LEVEL" -> effort.toUpperCase
)
// write Tcl script
......
......@@ -80,9 +80,9 @@ private object Compose extends Executor[ComposeJob] {
target = t,
features = job.features,
debugMode = job.debugMode,
onComplete = _ => signal.release(),
deleteOnFail = job.deleteProjects
)
deleteOnFail = job.deleteProjects,
effortLevel = job.synthEffort.get,
onComplete = _ => signal.release())
composeTasks foreach { tsk.apply _ }
......
......@@ -53,7 +53,7 @@ private object ComposeParser {
case ("Features", fs: Seq[Feature @unchecked]) => _.copy(features = Some(fs))
case ("DebugMode", m: String) => _.copy(debugMode = Some(m))
case ("DeleteProjects", e: Boolean) => _.copy(deleteProjects = Some(e))
case ("SynthEffort", effort : String) => if(effortModes.contains(effort)){
case ("SynthEffort", effort : String) => if(effortModes.contains(effort.toLowerCase)){
_.copy(synthEffort = Some(effort))
}
else{
......
......@@ -41,8 +41,9 @@ class ComposeTask(composition: Composition,
features: Option[Seq[Feature]] = None,
logFile: Option[String] = None,
debugMode: Option[String] = None,
val onComplete: Boolean => Unit,
val deleteOnFail: Option[Boolean] = None)
val deleteOnFail: Option[Boolean] = None,
private val effortLevel : String = "normal",
val onComplete: Boolean => Unit)
(implicit cfg: Configuration) extends Task with LogTracking {
private[this] implicit val _logger = de.tu_darmstadt.cs.esa.tapasco.Logging.logger(getClass)
private[this] val _slurm = Slurm.enabled
......@@ -64,7 +65,7 @@ class ComposeTask(composition: Composition,
_logger.debug("launching compose run for {}@{} [current thread: {}], logfile {}",
target.ad.name: Object, target.pd.name: Object, Thread.currentThread.getName(): Object, _logFile: Object)
if (debugMode.isEmpty) {
_composerResult = Some(try { composer.compose(composition, target, designFrequency, features getOrElse Seq()) }
_composerResult = Some(try { composer.compose(composition, target, designFrequency, effortLevel, features getOrElse Seq()) }
catch { case e: Exception =>
_logger.error(e.toString)
_logger.debug("stacktrace: {}", e.getStackTrace() mkString NL)
......
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