summaryrefslogtreecommitdiff
path: root/core/src/main/scala/chisel3/Annotation.scala
diff options
context:
space:
mode:
authormergify[bot]2022-07-13 20:39:44 +0000
committerGitHub2022-07-13 20:39:44 +0000
commitdbffb8779efca6bea8699ed80a04b1d47d657d93 (patch)
tree20882275e5999549e8d0959d9acc83c3eb7bbc06 /core/src/main/scala/chisel3/Annotation.scala
parentc247be3fd94084cc21b5891c422319e103b47074 (diff)
New enhanced API for specifying Chisel to Firrtl Annotations (#2628) (#2631)
(cherry picked from commit 4b10cf7a276e90b280c1fd57070566acac3d80d3) Co-authored-by: Girish Pai <girish.pai@sifive.com>
Diffstat (limited to 'core/src/main/scala/chisel3/Annotation.scala')
-rw-r--r--core/src/main/scala/chisel3/Annotation.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/src/main/scala/chisel3/Annotation.scala b/core/src/main/scala/chisel3/Annotation.scala
index e08557eb..c350fb30 100644
--- a/core/src/main/scala/chisel3/Annotation.scala
+++ b/core/src/main/scala/chisel3/Annotation.scala
@@ -20,6 +20,14 @@ trait ChiselAnnotation {
def toFirrtl: Annotation
}
+/** Enhanced interface for Annotations in Chisel
+ *
+ * Defines a conversion to corresponding FIRRTL Annotation(s)
+ */
+trait ChiselMultiAnnotation {
+ def toFirrtl: Seq[Annotation]
+}
+
/** Mixin for [[ChiselAnnotation]] that instantiates an associated FIRRTL Transform when this Annotation is present
* during a run of
* [[Driver$.execute(args:Array[String],dut:()=>chisel3\.RawModule)* Driver.execute]].
@@ -34,6 +42,9 @@ object annotate {
def apply(anno: ChiselAnnotation): Unit = {
Builder.annotations += anno
}
+ def apply(annos: ChiselMultiAnnotation): Unit = {
+ Builder.newAnnotations += annos
+ }
}
/** Marks that a module to be ignored in Dedup Transform in Firrtl pass