Commit 62acda9d authored by Lukas Sommer's avatar Lukas Sommer
Browse files

Introduce additional flag for compose command, setting the effort level;

parent 6e310f30
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -54,11 +54,12 @@ final case class BulkImportJob(csvFile: Path) extends Job("bulkimport")
 * i.e., each combination of [[base.Architecture]] and [[base.Platform]] given.
 * @param composition Composition to synthesize micro-architecture for.
 * @param designFrequency Operating frequency of PEs in the design.
 * @param implementation Composer Implementation (e.g., Vivado).
 * @param _implementation Composer Implementation (e.g., Vivado).
 * @param _architectures Name list of [[base.Architecture]] instances.
 * @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.).
 **/
final case class ComposeJob(
    composition: Composition,
@@ -68,7 +69,8 @@ final case class ComposeJob(
    private val _platforms: Option[Seq[String]] = None,
    features: Option[Seq[Feature]] = None,
    debugMode: Option[String] = None,
    deleteProjects: Option[Boolean] = None) extends Job("compose") {
    deleteProjects: Option[Boolean] = None,
    synthEffort : Option[String] = Some("normal")) extends Job("compose") {
  /** Returns the selected composer tool implementation. */
  lazy val implementation: Composer.Implementation = Composer.Implementation(_implementation)

+4 −2
Original line number Diff line number Diff line
@@ -117,7 +117,8 @@ package object json {
    (JsPath \ "Platforms").readNullable[Seq[String]] ~
    (JsPath \ "Features").readNullable[Seq[Feature]] ~
    (JsPath \ "DebugMode").readNullable[String] ~
    (JsPath \ "DeleteProjects").readNullable[Boolean]
    (JsPath \ "DeleteProjects").readNullable[Boolean] ~
    (JsPath \ "SynthEffort").readNullable[String]
  ) (ComposeJob.apply _)

  implicit val composeJobWrites: Writes[ComposeJob] = (
@@ -129,7 +130,8 @@ package object json {
    (JsPath \ "Platforms").writeNullable[Seq[String]] ~
    (JsPath \ "Features").writeNullable[Seq[Feature]] ~
    (JsPath \ "DebugMode").writeNullable[String] ~
    (JsPath \ "DeleteProjects").writeNullable[Boolean]
    (JsPath \ "DeleteProjects").writeNullable[Boolean] ~
    (JsPath \ "SynthEffort").writeNullable[String]
  ) (unlift(ComposeJob.unapply _ andThen (_ map ("Compose" +: _))))
  /* ComposeJob @} */

+4 −0
Original line number Diff line number Diff line
@@ -73,6 +73,10 @@ private object CommonArgParsers {
    (longOption("deleteProjects", "DeleteProjects") ~ ws ~/
      ( boolstr ~ ws).?) map {case s => (s._1, s._2.getOrElse(true))}

  def synthEffort : Parser[(String, String)] =
    longOption("synthEffort", "SynthEffort") ~ ws ~/
    string.opaque("Synthesis effort") ~ ws

  def implementation: Parser[(String, String)] =
    longOption("implementation", "Implementation") ~
    ws ~/
+11 −1
Original line number Diff line number Diff line
@@ -39,9 +39,12 @@ private object ComposeParser {
  private val jobid = identity[ComposeJob] _

  private def options: Parser[ComposeJob => ComposeJob] =
    (implementation | architectures | platforms | features | debugMode | delProj).rep
    (implementation | architectures | platforms | features | debugMode | synthEffort | delProj).rep
      .map (opts => (opts map (applyOption _) fold jobid) (_ andThen _))

  private val effortModes : Set[String] = Set("fastest", "fast", "normal",
    "optimal", "aggressive_performance", "aggressive_area")

  private def applyOption(opt: (String, _)): ComposeJob => ComposeJob =
    opt match {
      case ("Implementation", i: String) => _.copy(_implementation = i)
@@ -50,6 +53,13 @@ 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)){
        _.copy(synthEffort = Some(effort))
      }
      else{
        logger.warn(s"Unknown effort level $effort, using default normal")
        _.copy(synthEffort = Some("normal"))
      }
      case o => throw new Exception(s"parsed illegal option: $o")
    }
}
+8 −1
Original line number Diff line number Diff line
@@ -169,7 +169,14 @@ configuration via `tapasco -n config.json`.
           Indent(Arg("  r", "generate random result values") &
                  Arg("  f", "generate only timing failures") &
                  Arg("  p", "generate only placer errors") &
                  Arg("  o", "generate only other errors"))) &
                  Arg("  o", "generate only other errors")) &
           Arg("--synthEffort 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") &
                  Arg("optimal", "slower, get best QoR possible") &
                  Arg("aggressive_performance", "maximal optimization for performance") &
                  Arg("aggressive_area", "maximal optimization for area"))) &
    "" &
    "NOTE: Currently the  total number of PEs must be <= ${PLATFORM_NUM_SLOTS}.")

Loading