Commit 20b859b0 authored by Jens Korinth's avatar Jens Korinth
Browse files

Closes #138: Implement Import option to skip evaluation

parent ffab98d0
......@@ -45,6 +45,7 @@ object JobExamples {
42,
Some("Optional description of the core."),
Some(13124425),
Some(true),
Some(Seq("axi4mm")),
Some(Seq("zedboard", "zc706")))
......
......@@ -207,6 +207,7 @@ final case class HighLevelSynthesisJob(
core (must be > 0).
* @param description Description of the core (optional).
* @param averageClockCycles Clock cycles in an average job (optional).
* @param skipEvaluation Do not perform evaluation (optional).
* @param _architectures Name list of [[base.Architecture]] instances.
* @param _platforms Name list of [[base.Platform]] instances.
**/
......@@ -215,6 +216,7 @@ final case class ImportJob(
id: Kernel.Id,
description: Option[String] = None,
averageClockCycles: Option[Int] = None,
skipEvaluation: Option[Boolean] = None,
private val _architectures: Option[Seq[String]] = None,
private val _platforms: Option[Seq[String]] = None) extends Job("import") {
/** Returns the list of [[base.Architecture]] instances selected in this job. */
......
......@@ -36,6 +36,7 @@ package object json {
(JsPath \ "Id").read[Int] (verifying[Int](_ > 0)) ~
(JsPath \ "Description").readNullable[String] ~
(JsPath \ "Average Clock Cycles").readNullable[Int] (verifying[Int](_ > 0)) ~
(JsPath \ "Skip Evaluation").readNullable[Boolean] ~
(JsPath \ "Architectures").readNullable[Seq[String]] ~
(JsPath \ "Platforms").readNullable[Seq[String]]
) (ImportJob.apply _)
......@@ -46,6 +47,7 @@ package object json {
(JsPath \ "Id").write[Int] ~
(JsPath \ "Description").writeNullable[String] ~
(JsPath \ "Average Clock Cycles").writeNullable[Int] ~
(JsPath \ "Skip Evaluation").writeNullable[Boolean] ~
(JsPath \ "Architectures").writeNullable[Seq[String]] ~
(JsPath \ "Platforms").writeNullable[Seq[String]]
) (unlift(ImportJob.unapply _ andThen (_ map ("Import" +: _))))
......
......@@ -19,7 +19,7 @@ private object ImportParser {
private val jobid = identity[ImportJob] _
private def options: Parser[ImportJob => ImportJob] =
(description | avgClockCycles | architectures | platforms).rep map (opts =>
(description | avgClockCycles | skipEval | architectures | platforms).rep map (opts =>
(opts map (applyOption _) fold jobid) (_ andThen _))
private def description: Parser[(String, String)] =
......@@ -29,9 +29,13 @@ private object ImportParser {
longOption("averageClockCycles", "AvgCC") ~ ws ~/
posint.opaque("avg. number of clock cycles, integer > 0") ~ ws
private def skipEval: Parser[(String, Boolean)] =
(longOption("skipEvaluation", "SkipEval") ~ ws) map { case s => (s, true) }
private def applyOption(opt: (String, _)): ImportJob => ImportJob = opt match {
case ("Description", d: String) => _.copy(description = Some(d))
case ("AvgCC", cc: Int) => _.copy(averageClockCycles = Some(cc))
case ("SkipEval", se: Boolean) => _.copy(skipEvaluation = Some(se))
case ("Architectures", as: Seq[String @unchecked]) => _.copy(_architectures = Some(as))
case ("Platforms", ps: Seq[String @unchecked]) => _.copy(_platforms = Some(ps))
case o => throw new Exception(s"parsed illegal option: $o")
......
......@@ -192,6 +192,8 @@ configuration via `tapasco -n config.json`.
"-p vc709, pynq") &
Arg("--description TEXT", "any quoted or unquoted string containing" ~
"additional information about the core") &
Arg("--skipEvaluation", "do not perform out-of-context synthesis to get" ~
"resource estimates, only import") &
Arg("--averageClockCycles N", "any integer > 0; number of clock cycles in an" ~
""""average" execution of the PE; used to estimate""" ~
"the maximal throughput")))
......
Supports Markdown
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