summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/ChiselExecutionOptions.scala
diff options
context:
space:
mode:
authorchick2016-09-29 00:37:32 -0700
committerchick2016-10-14 09:41:25 -0700
commit070a8d724b282d3866da530b5d99ce7646fbf00e (patch)
treec5aa54b045e23320b07e164bc0758315ea139a2e /src/main/scala/chisel3/ChiselExecutionOptions.scala
parented872df330cb7dfabdd0e0866176f8f5be8861da (diff)
Implement a standardized execution scheme for chisel
Provide support for chisel options Provide support for firrtl options when called as part of chisel compile provide command line support the above options via scopt provide and execution result class that can be used when chisel3 is part of some externally controlled toolchain
Diffstat (limited to 'src/main/scala/chisel3/ChiselExecutionOptions.scala')
-rw-r--r--src/main/scala/chisel3/ChiselExecutionOptions.scala34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main/scala/chisel3/ChiselExecutionOptions.scala b/src/main/scala/chisel3/ChiselExecutionOptions.scala
new file mode 100644
index 00000000..6f58153f
--- /dev/null
+++ b/src/main/scala/chisel3/ChiselExecutionOptions.scala
@@ -0,0 +1,34 @@
+// See LICENSE for license details.
+
+package chisel3
+
+import firrtl.{ExecutionOptionsManager, ComposableOptions}
+
+//TODO: provide support for running firrtl as separate process, could alternatively be controlled by external driver
+//TODO: provide option for not saving chirrtl file, instead calling firrtl with in memory chirrtl
+/**
+ * Options that are specific to chisel.
+ *
+ * @param runFirrtlCompiler when true just run chisel, when false run chisel then compile its output with firrtl
+ * @note this extends FirrtlExecutionOptions which extends CommonOptions providing easy access to down chain options
+ */
+case class ChiselExecutionOptions(
+ runFirrtlCompiler: Boolean = true
+ // var runFirrtlAsProcess: Boolean = false
+ ) extends ComposableOptions
+
+trait HasChiselExecutionOptions {
+ self: ExecutionOptionsManager =>
+
+ var chiselOptions = ChiselExecutionOptions()
+
+ parser.note("chisel3 options")
+
+ parser.opt[Unit]("no-run-firrtl")
+ .abbr("chnrf")
+ .foreach { _ =>
+ chiselOptions = chiselOptions.copy(runFirrtlCompiler = false)
+ }
+ .text("Stop after chisel emits chirrtl file")
+}
+