summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/aop/injecting/InjectStatement.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/chisel3/aop/injecting/InjectStatement.scala')
-rw-r--r--src/main/scala/chisel3/aop/injecting/InjectStatement.scala21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/scala/chisel3/aop/injecting/InjectStatement.scala b/src/main/scala/chisel3/aop/injecting/InjectStatement.scala
new file mode 100644
index 00000000..c207454d
--- /dev/null
+++ b/src/main/scala/chisel3/aop/injecting/InjectStatement.scala
@@ -0,0 +1,21 @@
+// See LICENSE for license details.
+
+package chisel3.aop.injecting
+
+import chisel3.stage.phases.AspectPhase
+import firrtl.annotations.{Annotation, ModuleTarget, NoTargetAnnotation, SingleTargetAnnotation}
+
+/** Contains all information needed to inject statements into a module
+ *
+ * Generated when a [[InjectingAspect]] is consumed by a [[AspectPhase]]
+ * Consumed by [[InjectingTransform]]
+ *
+ * @param module Module to inject code into at the end of the module
+ * @param s Statements to inject
+ * @param modules Additional modules that may be instantiated by s
+ * @param annotations Additional annotations that should be passed down compiler
+ */
+case class InjectStatement(module: ModuleTarget, s: firrtl.ir.Statement, modules: Seq[firrtl.ir.DefModule], annotations: Seq[Annotation]) extends SingleTargetAnnotation[ModuleTarget] {
+ val target: ModuleTarget = module
+ override def duplicate(n: ModuleTarget): Annotation = this.copy(module = n)
+}