summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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) )
+
+}