Skip to content

Commit

Permalink
Deprecate more Aspect parts (#4420)
Browse files Browse the repository at this point in the history
Deprecate the remaining parts of Aspects that were missed in earlier
commits.  After this, the only non-deprecated part of the `aop` library
are the `Select` utilities.

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

# Conflicts:
#	build.sbt
  • Loading branch information
seldridge committed Sep 28, 2024
1 parent 39ec860 commit 12d3bfb
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ lazy val warningSuppression = Seq(
// 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"
"cat=deprecation&origin=chisel3\\.ModuleAspect:s",
"cat=deprecation&origin=chisel3\\.aop\\.inspecting.*:s",
"cat=deprecation&origin=chisel3\\.aop\\.Aspect:s",
"cat=deprecation&origin=chisel3\\.aop\\.Aspect$:s",
"cat=deprecation&origin=chisel3\\.stage\\.phases.AspectPhase:s",
"cat=deprecation&origin=chisel3\\.stage\\.phases.MaybeAspectPhase:s"
).mkString(",")
)

Expand Down
3 changes: 3 additions & 0 deletions core/src/main/scala/chisel3/aop/Aspect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import firrtl.AnnotationSeq
* what behavior should be done to instance, via the FIRRTL Annotation Mechanism
* @tparam T Type of top-level module
*/
@deprecated("aspects are being removed in Chisel 7", "6.6.0")
abstract class Aspect[T <: RawModule] extends Annotation with Unserializable with NoTargetAnnotation {

/** variable to save [[AnnotationSeq]] from [[chisel3.stage.phases.AspectPhase]]
Expand All @@ -35,12 +36,14 @@ abstract class Aspect[T <: RawModule] extends Annotation with Unserializable wit
}

/** Holds utility functions for Aspect stuff */
@deprecated("aspects are being removed in Chisel 7", "6.6.0")
object Aspect {

/** Converts elaborated Chisel components to FIRRTL modules
* @param chiselIR
* @return
*/
@deprecated("aspects are being removed in Chisel 7", "6.6.0")
def getFirrtl(chiselIR: chisel3.internal.firrtl.ir.Circuit): firrtl.ir.Circuit = {
chisel3.internal.firrtl.Converter.convert(chiselIR)
}
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/chisel3/aop/AspectLibrary.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import firrtl.options.{OptionsException, RegisteredLibrary, ShellOption}
/** Enables adding aspects to a design from the commandline, e.g.
* sbt> runMain chisel3.stage.ChiselMain --module <module> --with-aspect <aspect>
*/
@deprecated("aspects are being removed in Chisel 7", "6.6.0")
final class AspectLibrary() extends RegisteredLibrary {
val name = "AspectLibrary"

Expand Down
2 changes: 2 additions & 0 deletions src/main/scala/chisel3/aop/inspecting/InspectingAspect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ import firrtl.AnnotationSeq
* @param inspect Given top-level design, print things and return nothing
* @tparam T Type of top-level module
*/
@deprecated("aspects are being removed in Chisel 7", "6.6.0")
case class InspectingAspect[T <: RawModule](inspect: T => Unit) extends InspectorAspect[T](inspect)

/** Extend to make custom inspections of an elaborated design and printing out results
*
* @param inspect Given top-level design, print things and return nothing
* @tparam T Type of top-level module
*/
@deprecated("aspects are being removed in Chisel 7", "6.6.0")
abstract class InspectorAspect[T <: RawModule](inspect: T => Unit) extends Aspect[T] {
override def toAnnotation(top: T): AnnotationSeq = {
inspect(top)
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/chisel3/stage/phases/AspectPhase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import scala.collection.mutable
*
* Consumes the [[chisel3.stage.DesignAnnotation]] and converts every `Aspect` into their annotations prior to executing FIRRTL
*/
@deprecated("aspects are being removed in Chisel 7", "6.6.0")
class AspectPhase extends Phase {
def transform(annotations: AnnotationSeq): AnnotationSeq = {
var dut: Option[RawModule] = None
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/chisel3/stage/phases/MaybeAspectPhase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import firrtl.options.{Dependency, Phase}

/** Run [[AspectPhase]] if a [[chisel3.aop.Aspect]] is present.
*/
@deprecated("aspects are being removed in Chisel 7", "6.6.0")
class MaybeAspectPhase extends Phase {

override def prerequisites = Seq(Dependency[Elaborate])
Expand Down

0 comments on commit 12d3bfb

Please sign in to comment.