diff options
| author | Jiuyang Liu | 2021-02-27 05:01:10 +0800 |
|---|---|---|
| committer | GitHub | 2021-02-26 13:01:10 -0800 |
| commit | 923ccbde1353e37f0948d3c5d94b49965dc6d950 (patch) | |
| tree | 0565112847c8aef6cf8aaf2562a3e97ead026d24 /core/src/main/scala/chisel3/aop | |
| parent | c2ba4098d0a2f7ca056ea198d68b1d3bfaf40f3b (diff) | |
Expose AnnotationSeq to Module. (#1731)
Diffstat (limited to 'core/src/main/scala/chisel3/aop')
| -rw-r--r-- | core/src/main/scala/chisel3/aop/Aspect.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/src/main/scala/chisel3/aop/Aspect.scala b/core/src/main/scala/chisel3/aop/Aspect.scala index 59add417..be9b8975 100644 --- a/core/src/main/scala/chisel3/aop/Aspect.scala +++ b/core/src/main/scala/chisel3/aop/Aspect.scala @@ -12,6 +12,10 @@ import firrtl.AnnotationSeq * @tparam T Type of top-level module */ abstract class Aspect[T <: RawModule] extends Annotation with Unserializable with NoTargetAnnotation { + /** variable to save [[AnnotationSeq]] from [[chisel3.stage.phases.AspectPhase]] + * to be used at [[chisel3.aop.injecting.InjectorAspect]], exposes annotations to [[chisel3.internal.DynamicContext]] + */ + private[aop] var annotationsInAspect: AnnotationSeq = Seq() /** Convert this Aspect to a seq of FIRRTL annotation * @param top * @return @@ -22,7 +26,8 @@ abstract class Aspect[T <: RawModule] extends Annotation with Unserializable wit * @param top * @return */ - private[chisel3] def resolveAspect(top: RawModule): AnnotationSeq = { + private[chisel3] def resolveAspect(top: RawModule, remainingAnnotations: AnnotationSeq): AnnotationSeq = { + annotationsInAspect = remainingAnnotations toAnnotation(top.asInstanceOf[T]) } } |
