summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/aop/injecting/InjectStatement.scala
blob: c207454d6e07579acc60c650bd0b270f82020292 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)
}