Commit 1e7ce497 authored by Lukas Sommer's avatar Lukas Sommer

Rename 'synthEffort'-flag to 'effortLevel';

parent 2bf29d57
Pipeline #1311 passed with stages
in 187 minutes and 33 seconds
......@@ -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, synthEffort : String, features: Seq[Feature] = Seq())
def compose(bd: Composition, target: Target, f: Double = 0, effortLevel : 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, synthEffort : String, features: Seq[Feature] = Seq())
def compose(bd: Composition, target: Target, f: Heuristics.Frequency = 0, effortLevel : String, features: Seq[Feature] = Seq())
(implicit cfg: Configuration): Composer.Result = {
logger.debug("VivadoComposer uses at most {} threads", cfg.maxThreads getOrElse "unlimited")
// create output struct
......@@ -64,7 +64,7 @@ class VivadoComposer()(implicit cfg: Configuration) extends Composer {
header = makeHeader(bd, target, f, features),
target = target,
composition = composition(bd, target),
effort = synthEffort)
effort = effortLevel)
logger.info("Vivado starting run {}: show progress with `vivado_progress {}`", files.runName: Any, files.logFile)
files.logFile.toFile.delete
......
......@@ -59,18 +59,18 @@ final case class BulkImportJob(csvFile: Path) extends Job("bulkimport")
* @param _platforms Name list of [[base.Platform]] instances.
* @param features List of [[base.Feature]] configurations for the design (opt.).
* @param debugMode Debug mode name (opt.).
* @param synthEffort Synthesis effort level (opt.).
* @param effortLevel Synthesis effort level (opt.).
**/
final case class ComposeJob(
composition: Composition,
designFrequency: Heuristics.Frequency,
private val _implementation: String,
private val _architectures: Option[Seq[String]] = None,
private val _platforms: Option[Seq[String]] = None,
features: Option[Seq[Feature]] = None,
debugMode: Option[String] = None,
deleteProjects: Option[Boolean] = None,
synthEffort : Option[String] = Some("normal")) extends Job("compose") {
composition: Composition,
designFrequency: Heuristics.Frequency,
private val _implementation: String,
private val _architectures: Option[Seq[String]] = None,
private val _platforms: Option[Seq[String]] = None,
features: Option[Seq[Feature]] = None,
debugMode: Option[String] = None,
effortLevel : Option[String] = Some("normal"),
deleteProjects: Option[Boolean] = None) extends Job("compose") {
/** Returns the selected composer tool implementation. */
lazy val implementation: Composer.Implementation = Composer.Implementation(_implementation)
......
......@@ -80,9 +80,10 @@ private object Compose extends Executor[ComposeJob] {
target = t,
features = job.features,
debugMode = job.debugMode,
deleteOnFail = job.deleteProjects,
effortLevel = job.synthEffort.get,
onComplete = _ => signal.release())
effortLevel = job.effortLevel.get,
onComplete = _ => signal.release(),
deleteOnFail = job.deleteProjects
)
composeTasks foreach { tsk.apply _ }
......
......@@ -117,8 +117,8 @@ package object json {
(JsPath \ "Platforms").readNullable[Seq[String]] ~
(JsPath \ "Features").readNullable[Seq[Feature]] ~
(JsPath \ "DebugMode").readNullable[String] ~
(JsPath \ "DeleteProjects").readNullable[Boolean] ~
(JsPath \ "SynthEffort").readNullable[String]
(JsPath \ "EffortLevel").readNullable[String] ~
(JsPath \ "DeleteProjects").readNullable[Boolean]
) (ComposeJob.apply _)
implicit val composeJobWrites: Writes[ComposeJob] = (
......@@ -130,8 +130,8 @@ package object json {
(JsPath \ "Platforms").writeNullable[Seq[String]] ~
(JsPath \ "Features").writeNullable[Seq[Feature]] ~
(JsPath \ "DebugMode").writeNullable[String] ~
(JsPath \ "DeleteProjects").writeNullable[Boolean] ~
(JsPath \ "SynthEffort").writeNullable[String]
(JsPath \ "EffortLevel").writeNullable[String] ~
(JsPath \ "DeleteProjects").writeNullable[Boolean]
) (unlift(ComposeJob.unapply _ andThen (_ map ("Compose" +: _))))
/* ComposeJob @} */
......
......@@ -69,6 +69,10 @@ private object CommonArgParsers {
longOption("debugMode", "DebugMode") ~ ws ~/
qstring.opaque("debug mode name, any string") ~ ws
def effortLevel : Parser[(String, String)] =
longOption("effortLevel", "EffortLevel") ~ ws ~/
string.opaque("Effort level") ~ ws
def delProj: Parser[(String, Boolean)] =
(longOption("deleteProjects", "DeleteProjects") ~ ws ~/
( boolstr ~ ws).?) map {case s => (s._1, s._2.getOrElse(true))}
......
......@@ -39,7 +39,7 @@ private object ComposeParser {
private val jobid = identity[ComposeJob] _
private def options: Parser[ComposeJob => ComposeJob] =
(implementation | architectures | platforms | features | debugMode | synthEffort | delProj).rep
(implementation | architectures | platforms | features | debugMode | effortLevel | delProj).rep
.map (opts => (opts map (applyOption _) fold jobid) (_ andThen _))
private val effortModes : Set[String] = Set("fastest", "fast", "normal",
......@@ -53,12 +53,12 @@ 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.toLowerCase)){
_.copy(synthEffort = Some(effort))
case ("EffortLevel", effort : String) => if(effortModes.contains(effort.toLowerCase)){
_.copy(effortLevel = Some(effort))
}
else{
logger.warn(s"Unknown effort level $effort, using default normal")
_.copy(synthEffort = Some("normal"))
_.copy(effortLevel = Some("normal"))
}
case o => throw new Exception(s"parsed illegal option: $o")
}
......
......@@ -170,7 +170,7 @@ configuration via `tapasco -n config.json`.
Arg(" f", "generate only timing failures") &
Arg(" p", "generate only placer errors") &
Arg(" o", "generate only other errors")) &
Arg("--synthEffort EFFORT", "set effort level for synthesis and PnR; levels:") &
Arg("--effortLevel EFFORT", "set effort level for synthesis and PnR; levels:") &
Indent(Arg("fastest", "lowest effort, minimal runtime") &
Arg("fast", "slightly slower, but still short runtime") &
Arg("normal", "default options") &
......
......@@ -57,16 +57,16 @@ class CommonArgParsersSpec extends FlatSpec with Matchers with Checkers {
checkParsed( P( debugMode ~ End ).parse(d) )
})
"All valid effortLevel parameters" should "be parsed correctly by effortLevel" in
check(forAllNoShrink(effortModeGen) { e =>
checkParsed(P(effortLevel ~ End).parse(e))
})
"The deleteProject switch" should "be parsed correctly by deleteProject" in
check(forAllNoShrink(deleteProjectsGen) { d =>
checkParsed(P(delProj ~ End).parse(d))
})
"All valid synthEffort parameters" should "be parsed correctly by synthEffort" in
check(forAllNoShrink(effortModeGen) { e =>
checkParsed( P(synthEffort ~ End).parse(e))
})
"All valid implementation parameters" should "be parsed correctly by implementation" in
check(forAllNoShrink(implementationGen) { i =>
checkParsed( P( implementation ~ End ).parse(i) )
......@@ -113,16 +113,14 @@ private object CommonArgParsersSpec {
qstringGen
))
<<<<<<< HEAD
val booleanOrNoneGen: Gen[String] = Gen.oneOf("true", "false", "")
val deleteProjectsGen: Gen[String] = join(Seq(genLongOption("deleteProjects"), booleanOrNoneGen))
=======
val effortModeGen : Gen[String] = join(Seq(
genLongOption("synthEffort"),
genLongOption("effortLevel"),
Gen.oneOf("fastest", "fast", "normal", "optimal", "optimal", "aggressive_performance", "aggressive_area")
))
>>>>>>> Introduce additional flag for compose command, setting the effort level;
val implementationGen: Gen[String] = join(Seq(
genLongOption("implementation"),
......
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