1
0

Artefact output (#545)

* build: stop using empty .prm file

* generator: general-purpose mechanism for creating elaboration artefacts
This commit is contained in:
Wesley W. Terpstra
2017-02-02 19:24:55 -08:00
committed by GitHub
parent 094b3bc2b1
commit 93b2fa197e
10 changed files with 25 additions and 69 deletions

View File

@ -103,26 +103,17 @@ trait GeneratorApp extends App with HasGeneratorUtilities {
TestGeneration.addSuite(DefaultTestSuites.singleRegression)
}
/** Output a global Parameter dump, which an external script can turn into Verilog headers. */
def generateParameterDump {
writeOutputFile(td, s"$longName.prm", "")
}
/** Output a global ConfigString, for use by the RISC-V software ecosystem. */
def generateConfigString {
ConfigStringOutput.contents.foreach(c => writeOutputFile(td, s"${names.configs}.cfg", c))
}
/** Output a global LazyModule topology for documentation purposes. */
def generateGraphML {
TopModule.contents.foreach(lm => writeOutputFile(td, s"${names.configs}.graphml", lm.graphML))
/** Output files created as a side-effect of elaboration */
def generateArtefacts {
ElaborationArtefacts.files.foreach { case (extension, contents) =>
writeOutputFile(td, s"${names.configs}.${extension}", contents ())
}
}
}
object ConfigStringOutput {
var contents: Option[String] = None
}
object TopModule {
var contents: Option[LazyModule] = None
object ElaborationArtefacts {
var files: Seq[(String, () => String)] = Nil
def add(extension: String, contents: => String) {
files = (extension, () => contents) +: files
}
}