Explicitly name PlusArg serializers as *_cHeader
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@gmail.com>
This commit is contained in:
parent
cfd49f87c1
commit
09c1d034fa
@ -21,7 +21,7 @@ abstract class BareCoreplexModule[+L <: BareCoreplex](_outer: L) extends LazyMod
|
|||||||
ElaborationArtefacts.add("graphml", outer.graphML)
|
ElaborationArtefacts.add("graphml", outer.graphML)
|
||||||
ElaborationArtefacts.add("dts", outer.dts)
|
ElaborationArtefacts.add("dts", outer.dts)
|
||||||
ElaborationArtefacts.add("json", outer.json)
|
ElaborationArtefacts.add("json", outer.json)
|
||||||
ElaborationArtefacts.add("plusArgs", PlusArgArtefacts.serialize)
|
ElaborationArtefacts.add("plusArgs", PlusArgArtefacts.serialize_cHeader)
|
||||||
println(outer.dts)
|
println(outer.dts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ object PlusArgArtefacts {
|
|||||||
artefacts = artefacts ++ Map(name -> PlusArgInfo(default, docstring))
|
artefacts = artefacts ++ Map(name -> PlusArgInfo(default, docstring))
|
||||||
|
|
||||||
/* From plus args, generate help text */
|
/* From plus args, generate help text */
|
||||||
private def serializeHelp(tab: String = ""): String = artefacts
|
private def serializeHelp_cHeader(tab: String = ""): String = artefacts
|
||||||
.map{ case(arg, PlusArgInfo(default, docstring)) =>
|
.map{ case(arg, PlusArgInfo(default, docstring)) =>
|
||||||
s"""|$tab+$arg=INT\\n\\
|
s"""|$tab+$arg=INT\\n\\
|
||||||
|$tab${" "*20}$docstring\\n\\
|
|$tab${" "*20}$docstring\\n\\
|
||||||
@ -44,7 +44,7 @@ object PlusArgArtefacts {
|
|||||||
.mkString("\\n\\\n") ++ "\""
|
.mkString("\\n\\\n") ++ "\""
|
||||||
|
|
||||||
/* From plus args, generate a char array of their names */
|
/* From plus args, generate a char array of their names */
|
||||||
private def serializeArray(tab: String = ""): String = {
|
private def serializeArray_cHeader(tab: String = ""): String = {
|
||||||
val prettyTab = tab + " " * 44 // Length of 'static const ...'
|
val prettyTab = tab + " " * 44 // Length of 'static const ...'
|
||||||
s"${tab}static const char * verilog_plusargs [] = {\\\n" ++
|
s"${tab}static const char * verilog_plusargs [] = {\\\n" ++
|
||||||
artefacts
|
artefacts
|
||||||
@ -55,9 +55,9 @@ object PlusArgArtefacts {
|
|||||||
|
|
||||||
/* Generate C code to be included in emulator.cc that helps with
|
/* Generate C code to be included in emulator.cc that helps with
|
||||||
* argument parsing based on available Verilog PlusArgs */
|
* argument parsing based on available Verilog PlusArgs */
|
||||||
def serialize(): String =
|
def serialize_cHeader(): String =
|
||||||
s"""|#define PLUSARG_USAGE_OPTIONS \"EMULATOR VERILOG PLUSARGS\\n\\
|
s"""|#define PLUSARG_USAGE_OPTIONS \"EMULATOR VERILOG PLUSARGS\\n\\
|
||||||
|${serializeHelp(" "*7)}
|
|${serializeHelp_cHeader(" "*7)}
|
||||||
|${serializeArray()}
|
|${serializeArray_cHeader()}
|
||||||
|""".stripMargin
|
|""".stripMargin
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user