From cd845bdbfea0c09e9edbf61e651ede5197d8a084 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Tue, 17 Nov 2020 14:49:49 -0800 Subject: Make MultiTargetAnnotation.targets a def (#1969) * Make MultiTargetAnnotation.targets a def This enables the annotation writer to choose their own underlying data structure * Update MultiTargetAnnotation ScalaDoc Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>--- src/main/scala/firrtl/annotations/Annotation.scala | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main/scala/firrtl/annotations/Annotation.scala b/src/main/scala/firrtl/annotations/Annotation.scala index bea88e51..5f792127 100644 --- a/src/main/scala/firrtl/annotations/Annotation.scala +++ b/src/main/scala/firrtl/annotations/Annotation.scala @@ -91,12 +91,19 @@ trait SingleTargetAnnotation[T <: Named] extends Annotation { /** [[MultiTargetAnnotation]] keeps the renamed targets grouped within a single annotation. */ trait MultiTargetAnnotation extends Annotation { - /** Contains a sequence of [[firrtl.annotations.Target Target]]. - * When created, [[targets]] should be assigned by `Seq(Seq(TargetA), Seq(TargetB), Seq(TargetC))` + /** Contains a nested sequence of [[firrtl.annotations.Target Target]] + * + * Each inner Seq should contain a single element. For example: + * {{{ + * def targets = Seq(Seq(foo), Seq(bar)) + * }}} */ - val targets: Seq[Seq[Target]] + def targets: Seq[Seq[Target]] - /** Create another instance of this Annotation */ + /** Create another instance of this Annotation + * + * The inner Seqs correspond to the renames of the inner Seqs of targets + */ def duplicate(n: Seq[Seq[Target]]): Annotation /** Assume [[RenameMap]] is `Map(TargetA -> Seq(TargetA1, TargetA2, TargetA3), TargetB -> Seq(TargetB1, TargetB2))` -- cgit v1.2.3