Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for emitting string-valued plusargs and plusargs with no default #2453

Merged
merged 5 commits into from
May 11, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/main/scala/util/PlusArg.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ object PlusArg
* pass.
*/
def apply(name: String, default: BigInt = 0, docstring: String = "", width: Int = 32): UInt = {
PlusArgArtefacts.append(name, Some(default), docstring, "INT")
PlusArgArtefacts.append(name, Some(default), docstring)
Module(new plusarg_reader(name + "=%d", default, docstring, width)).io.out
}

Expand All @@ -59,7 +59,7 @@ object PlusArg
* Default 0 will never assert.
*/
def timeout(name: String, default: BigInt = 0, docstring: String = "", width: Int = 32)(count: UInt) {
PlusArgArtefacts.append(name, Some(default), docstring, "INT")
PlusArgArtefacts.append(name, Some(default), docstring)
Module(new PlusArgTimeout(name + "=%d", default, docstring, width)).io.count := count
}
}
Expand All @@ -73,7 +73,7 @@ object PlusArgArtefacts {
"Rocket Chip 2020.05"
)
def append(name: String, default: BigInt, docstring: String): Unit =
append(name, Some(default), docstring, "INT")
append(name, Some(default), docstring)

/** Add a new PlusArg
*
Expand All @@ -83,7 +83,7 @@ object PlusArgArtefacts {
* @param docstring text to include in the help
* @param doctype description of the Verilog type of the PlusArg value (e.g. STRING, INT)
*/
def append[A](name: String, default: Option[A], docstring: String, doctype: String): Unit =
def append[A](name: String, default: Option[A], docstring: String, doctype: String = "INT"): Unit =
jwright6323 marked this conversation as resolved.
Show resolved Hide resolved
artefacts = artefacts ++ Map(name -> PlusArgContainer[A](default, docstring, doctype))

/* From plus args, generate help text */
Expand Down