Commit be05c331 authored by Jaco Hofmann's avatar Jaco Hofmann Committed by Jaco A. Hofmann
Browse files

Add parameter to set a custom board repository path

    - Paramter is boardPartRepository in JSON
    - Closes #46
parent 8b7a8d0d
......@@ -53,6 +53,9 @@ set bitstreamname @@BITSTREAM_NAME@@
# setup the project
create_project @@PROJECT_NAME@@ [pwd]/@@PROJECT_NAME@@ -part {@@PART@@} -force
if {"@@BOARD_PART@@" != ""} {
if {"@@BOARD_PART_REPOSITORY@@" != ""} {
set_property BOARD_PART_REPO_PATHS {@@BOARD_PART_REPOSITORY@@} [current_project]
}
set_property board_part {@@BOARD_PART@@} [current_project]
}
......
......@@ -138,16 +138,17 @@ class VivadoComposer()(implicit cfg: Configuration) extends Composer {
composition: String): Unit = {
// needles for template
val needles: scala.collection.mutable.Map[String, String] = scala.collection.mutable.Map(
"PROJECT_NAME" -> "microarch",
"BITSTREAM_NAME" -> projectName,
"HEADER" -> header,
"PRELOAD_FILES" -> "",
"PART" -> target.pd.part,
"BOARD_PART" -> (target.pd.boardPart getOrElse ""),
"BOARD_PRESET" -> (target.pd.boardPreset getOrElse ""),
"PLATFORM_TCL" -> target.pd.tclLibrary.toString,
"ARCHITECTURE_TCL" -> target.ad.tclLibrary.toString,
"COMPOSITION" -> composition
"PROJECT_NAME" -> "microarch",
"BITSTREAM_NAME" -> projectName,
"HEADER" -> header,
"PRELOAD_FILES" -> "",
"PART" -> target.pd.part,
"BOARD_PART" -> (target.pd.boardPart getOrElse ""),
"BOARD_PART_REPOSITORY" -> (target.pd.boardPartRepository getOrElse ""),
"BOARD_PRESET" -> (target.pd.boardPreset getOrElse ""),
"PLATFORM_TCL" -> target.pd.tclLibrary.toString,
"ARCHITECTURE_TCL" -> target.ad.tclLibrary.toString,
"COMPOSITION" -> composition,
)
// write Tcl script
......
......@@ -34,6 +34,7 @@ case class Platform (
part: String,
boardPart: Option[String],
boardPreset: Option[String],
boardPartRepository: Option[String],
targetUtilization: Int,
supportedFrequencies: Seq[Int],
private val _slotCount: Option[Int],
......
......@@ -331,6 +331,7 @@ def readMapFromFile(p: Path): JsResult[Feature.FMap] ={
(JsPath \ "Part").read[String] (minLength[String](1)) ~
(JsPath \ "BoardPart").readNullable[String] (minLength[String](4)) ~
(JsPath \ "BoardPreset").readNullable[String] (minLength[String](4)) ~
(JsPath \ "BoardPartRepository").readNullable[String] (minLength[String](4)) ~
(JsPath \ "TargetUtilization").read[Int] (min(5) keepAnd max(100)) ~
(JsPath \ "SupportedFrequencies").readNullable[Seq[Int]] (minLength[Seq[Int]](1)) .map (_ getOrElse (50 to 450 by 5)) ~
(JsPath \ "SlotCount").readNullable[Int] (min(1) keepAnd max(255)) ~
......@@ -347,6 +348,7 @@ def readMapFromFile(p: Path): JsResult[Feature.FMap] ={
(JsPath \ "Part").write[String] ~
(JsPath \ "BoardPart").writeNullable[String] ~
(JsPath \ "BoardPreset").writeNullable[String] ~
(JsPath \ "BoardPartRepository").writeNullable[String] ~
(JsPath \ "TargetUtilization").write[Int] ~
(JsPath \ "SupportedFrequencies").write[Seq[Int]] ~
(JsPath \ "SlotCount").writeNullable[Int] ~
......
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