summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchuyler Eldridge2019-01-14 21:01:16 -0500
committerSchuyler Eldridge2019-05-22 16:17:17 -0400
commit1abb84497315cff795e24afda0e4790fe535132f (patch)
tree9e559f8546ee3b554b5147b648ea528f204c3697
parent0ac473b5f80b9627a06fc5caa052899680fd13cb (diff)
Add chisel3.stage.ChiselStage
This adds ChiselStage, a reimplementation of chisel3.Driver as a firrtl.options.Stage. This is simplistically described as a pipeline of Phases. Co-Authored-By: Schuyler Eldridge <schuyler.eldridge@ibm.com> Co-Authored-By: chick <chick@qrhino.com> Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
-rw-r--r--src/main/scala/chisel3/stage/ChiselStage.scala26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/scala/chisel3/stage/ChiselStage.scala b/src/main/scala/chisel3/stage/ChiselStage.scala
new file mode 100644
index 00000000..1e92aaf6
--- /dev/null
+++ b/src/main/scala/chisel3/stage/ChiselStage.scala
@@ -0,0 +1,26 @@
+// See LICENSE for license details.
+
+package chisel3.stage
+
+import firrtl.AnnotationSeq
+import firrtl.options.{Phase, Shell, Stage}
+import firrtl.stage.FirrtlCli
+
+class ChiselStage extends Stage {
+ val shell: Shell = new Shell("chisel") with ChiselCli with FirrtlCli
+
+ private val phases: Seq[Phase] =
+ Seq( new chisel3.stage.phases.Checks,
+ new chisel3.stage.phases.Elaborate,
+ new chisel3.stage.phases.AddImplicitOutputFile,
+ new chisel3.stage.phases.AddImplicitOutputAnnotationFile,
+ new chisel3.stage.phases.Emitter,
+ new chisel3.stage.phases.Convert,
+ new chisel3.stage.phases.MaybeFirrtlStage )
+ .map(firrtl.options.phases.DeletedWrapper(_))
+
+ def run(annotations: AnnotationSeq): AnnotationSeq =
+ /* @todo: Should this be wrapped in a try/catch? */
+ phases.foldLeft(annotations)( (a, f) => f.transform(a) )
+
+}