Skip to content

Commit

Permalink
Remove aspects (#4424)
Browse files Browse the repository at this point in the history
Remove all deprecated Aspect features.  This leave the `aop` package
around, but now it only contains the Select APIs.

Signed-off-by: Schuyler Eldridge <[email protected]>
  • Loading branch information
seldridge authored Sep 28, 2024
1 parent f94fbf5 commit e7178e5
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 232 deletions.
8 changes: 1 addition & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,7 @@ lazy val warningSuppression = Seq(
"cat=deprecation&origin=firrtl\\.options\\.internal\\.WriteableCircuitAnnotation:s",
"cat=deprecation&origin=chisel3\\.util\\.experimental\\.BoringUtils.*: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\\.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"
"cat=deprecation&origin=chisel3\\.ltl.*:s"
).mkString(",")
)

Expand Down
50 changes: 0 additions & 50 deletions core/src/main/scala/chisel3/aop/Aspect.scala

This file was deleted.

This file was deleted.

54 changes: 0 additions & 54 deletions src/main/scala/chisel3/aop/AspectLibrary.scala

This file was deleted.

4 changes: 1 addition & 3 deletions src/main/scala/chisel3/aop/Select.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import firrtl.annotations.ReferenceTarget
import scala.reflect.runtime.universe.TypeTag
import scala.collection.mutable

/** Use to select Chisel components in a module, after that module has been constructed
* Useful for adding additional Chisel annotations or for use within an [[Aspect]]
*/
/** Use to select Chisel components in a module, after that module has been constructed. */
object Select {

/** Return just leaf components of expanded node
Expand Down
28 changes: 0 additions & 28 deletions src/main/scala/chisel3/aop/inspecting/InspectingAspect.scala

This file was deleted.

37 changes: 0 additions & 37 deletions src/main/scala/chisel3/stage/phases/AspectPhase.scala

This file was deleted.

24 changes: 0 additions & 24 deletions src/main/scala/chisel3/stage/phases/MaybeAspectPhase.scala

This file was deleted.

1 change: 0 additions & 1 deletion src/main/scala/circt/stage/ChiselStage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class ChiselStage extends Stage {
targets = Seq(
Dependency[chisel3.stage.phases.AddImplicitOutputFile],
Dependency[chisel3.stage.phases.AddImplicitOutputAnnotationFile],
Dependency[chisel3.stage.phases.MaybeAspectPhase],
Dependency[chisel3.stage.phases.AddSerializationAnnotations],
Dependency[chisel3.stage.phases.Convert],
Dependency[chisel3.stage.phases.AddDedupGroupAnnotations],
Expand Down
27 changes: 0 additions & 27 deletions src/test/scala/chiselTests/ChiselSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package chiselTests

import _root_.logger.{LogLevel, LogLevelAnnotation, Logger}
import chisel3._
import chisel3.aop.Aspect
import chisel3.stage.{ChiselGeneratorAnnotation, PrintFullStackTraceAnnotation}
import chisel3.testers._
import circt.stage.{CIRCTTarget, CIRCTTargetAnnotation, ChiselStage}
Expand Down Expand Up @@ -325,32 +324,6 @@ trait Utils {
*/
private case class ExitException(status: Int) extends SecurityException(s"Found a sys.exit with code $status")

/** A tester which runs generator and uses an aspect to check the returned object
* @param gen function to generate a Chisel module
* @param f a function to check the Chisel module
* @tparam T the Chisel module class
*/
def aspectTest[T <: RawModule](gen: () => T)(f: T => Unit)(implicit scalaMajorVersion: Int): Unit = {
// Runs chisel stage
def run[T <: RawModule](gen: () => T, annotations: AnnotationSeq): AnnotationSeq = {
new ChiselStage().run(
Seq(
ChiselGeneratorAnnotation(gen),
CIRCTTargetAnnotation(CIRCTTarget.CHIRRTL),
PrintFullStackTraceAnnotation
) ++ annotations
)
}
// Creates a wrapping aspect to contain checking function
case object BuiltAspect extends Aspect[T] {
override def toAnnotation(top: T): AnnotationSeq = { f(top); Nil }
}
val currentMajorVersion = scala.util.Properties.versionNumberString.split('.')(1).toInt
if (currentMajorVersion >= scalaMajorVersion) {
run(gen, Seq(BuiltAspect))
}
}

/** Run some code and rethrow an exception with a specific type if an exception of that type occurs anywhere in the
* stack trace.
*
Expand Down

0 comments on commit e7178e5

Please sign in to comment.