From 09c1d034fa8b141dbf9c93d030b90910918f9f7f Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Mon, 15 Jan 2018 17:00:12 -0500 Subject: [PATCH] Explicitly name PlusArg serializers as *_cHeader Signed-off-by: Schuyler Eldridge --- src/main/scala/coreplex/BaseCoreplex.scala | 2 +- src/main/scala/util/PlusArg.scala | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/scala/coreplex/BaseCoreplex.scala b/src/main/scala/coreplex/BaseCoreplex.scala index 41af61ec..94c90a5c 100644 --- a/src/main/scala/coreplex/BaseCoreplex.scala +++ b/src/main/scala/coreplex/BaseCoreplex.scala @@ -21,7 +21,7 @@ abstract class BareCoreplexModule[+L <: BareCoreplex](_outer: L) extends LazyMod ElaborationArtefacts.add("graphml", outer.graphML) ElaborationArtefacts.add("dts", outer.dts) ElaborationArtefacts.add("json", outer.json) - ElaborationArtefacts.add("plusArgs", PlusArgArtefacts.serialize) + ElaborationArtefacts.add("plusArgs", PlusArgArtefacts.serialize_cHeader) println(outer.dts) } diff --git a/src/main/scala/util/PlusArg.scala b/src/main/scala/util/PlusArg.scala index 97e8a0f5..f8814dbf 100644 --- a/src/main/scala/util/PlusArg.scala +++ b/src/main/scala/util/PlusArg.scala @@ -36,7 +36,7 @@ object PlusArgArtefacts { artefacts = artefacts ++ Map(name -> PlusArgInfo(default, docstring)) /* 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)) => s"""|$tab+$arg=INT\\n\\ |$tab${" "*20}$docstring\\n\\ @@ -44,7 +44,7 @@ object PlusArgArtefacts { .mkString("\\n\\\n") ++ "\"" /* 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 ...' s"${tab}static const char * verilog_plusargs [] = {\\\n" ++ artefacts @@ -55,9 +55,9 @@ object PlusArgArtefacts { /* Generate C code to be included in emulator.cc that helps with * argument parsing based on available Verilog PlusArgs */ - def serialize(): String = + def serialize_cHeader(): String = s"""|#define PLUSARG_USAGE_OPTIONS \"EMULATOR VERILOG PLUSARGS\\n\\ - |${serializeHelp(" "*7)} - |${serializeArray()} + |${serializeHelp_cHeader(" "*7)} + |${serializeArray_cHeader()} |""".stripMargin }