Skip to content

Commit

Permalink
Deprecate all Injecting Aspect Code (#4415)
Browse files Browse the repository at this point in the history
Deprecate injecting aspect code as of Chisel 6.6.0.  These were planned to
be deprecated some time ago (see ROADMAP.md).  However, these had a long
user in @sequencer.  He is now off of these and there is nothing blocking
their removal.

I will follow this with a commit to remove these from `main` for Chisel 7.

For similar, verification-focused functionality can be selectively added
to the circuit, use layers.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
(cherry picked from commit d292a5e)

# Conflicts:
#	build.sbt
  • Loading branch information
seldridge authored and mergify[bot] committed Sep 27, 2024
1 parent d46fcc8 commit 4fc27f5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,16 @@ lazy val warningSuppression = Seq(
// This is deprecated for external users but not internal use
"cat=deprecation&origin=firrtl\\.options\\.internal\\.WriteableCircuitAnnotation:s",
"cat=deprecation&origin=chisel3\\.util\\.experimental\\.BoringUtils.*:s",
<<<<<<< HEAD
"cat=deprecation&origin=chisel3\\.ltl.*:s"
=======
"cat=deprecation&origin=chisel3\\.experimental\\.IntrinsicModule:s",
"cat=deprecation&origin=chisel3\\.ltl.*:s",
// This is deprecated and planned to be removed
"cat=deprecation&origin=chisel3\\.aop\\.injecting.*:s",
"cat=deprecation&origin=chisel3\\.stage\\.phases\\.MaybeInjectingPhase:s",
"cat=deprecation&origin=chisel3\\.ModuleAspect:s"
>>>>>>> d292a5eef (Deprecate all Injecting Aspect Code (#4415))
).mkString(",")
)

Expand Down
1 change: 1 addition & 0 deletions core/src/main/scala/chisel3/ModuleAspect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import chisel3.internal.{Builder, PseudoModule}
*
* @param module Module for which this object is an aspect of
*/
@deprecated("injecting aspects are being removed in Chisel 7", "6.6.0")
abstract class ModuleAspect private[chisel3] (module: RawModule) extends RawModule with PseudoModule {

Builder.addAspect(module, this)
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/chisel3/aop/injecting/InjectStatement.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import firrtl.annotations.{Annotation, ModuleTarget, NoTargetAnnotation, SingleT
* @param modules Additional modules that may be instantiated by s
* @param annotations Additional annotations that should be passed down compiler
*/
@deprecated("injecting aspects are being removed in Chisel 7", "6.6.0")
case class InjectStatement(
module: ModuleTarget,
s: firrtl.ir.Statement,
Expand Down
2 changes: 2 additions & 0 deletions src/main/scala/chisel3/aop/injecting/InjectingAspect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import scala.collection.mutable.ArrayBuffer
* @tparam T Type of top-level module
* @tparam M Type of root module (join point)
*/
@deprecated("injecting aspects are being removed in Chisel 7", "6.6.0")
case class InjectingAspect[T <: RawModule, M <: RawModule](
selectRoots: T => Iterable[M],
injection: M => Unit)
Expand All @@ -41,6 +42,7 @@ case class InjectingAspect[T <: RawModule, M <: RawModule](
* @tparam T Type of top-level module
* @tparam M Type of root module (join point)
*/
@deprecated("injecting aspects are being removed in Chisel 7", "6.6.0")
abstract class InjectorAspect[T <: RawModule, M <: RawModule](
selectRoots: T => Iterable[M],
injection: M => Unit)
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/chisel3/aop/injecting/InjectingPhase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import scala.collection.mutable
*
* Consumes the [[chisel3.stage.DesignAnnotation]] and converts every [[Aspect]] into their annotations prior to executing FIRRTL
*/
@deprecated("injecting aspects are being removed in Chisel 7", "6.6.0")
class InjectingPhase extends Phase {
def transform(annotations: AnnotationSeq): AnnotationSeq = {
val addStmtMap = mutable.HashMap[String, Seq[ir.Statement]]()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import firrtl.options.Phase

/** Run `InjectingPhase` if a `InjectStatement` is present.
*/
@deprecated("injecting aspects are being removed in Chisel 7", "6.6.0")
class MaybeInjectingPhase extends Phase {
override def prerequisites = Seq.empty
override def optionalPrerequisites = Seq.empty
Expand Down

0 comments on commit 4fc27f5

Please sign in to comment.