From 696bc256a90cc80bcb094aaeada8eea51a643ae0 Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Thu, 15 Nov 2018 21:50:29 -0500 Subject: Change firrtl.options API, add Phase This breaks firrtl.options.Stage into a small type hierarchy: * Phase: something that transforms an AnnotationSeq * Stage extends Phase: a Phase with a Command Line Interface Some of the old "common options" (input annotation file and target directory) are moved into firrtl.options and provided as part of the Stage class. Stage will automatically preprocess an input annotation sequence to resolve all input annotation files and add a default target directory. Minor changes: * Adds ViewException * Stops mixing in the DoNotTerminateOnExit trait into the default Shell parser * Add StageOptionsView Signed-off-by: Schuyler Eldridge --- .../firrtl/options/phases/ConvertLegacyAnnotations.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/main/scala/firrtl/options/phases/ConvertLegacyAnnotations.scala (limited to 'src/main/scala/firrtl/options/phases/ConvertLegacyAnnotations.scala') diff --git a/src/main/scala/firrtl/options/phases/ConvertLegacyAnnotations.scala b/src/main/scala/firrtl/options/phases/ConvertLegacyAnnotations.scala new file mode 100644 index 00000000..37667160 --- /dev/null +++ b/src/main/scala/firrtl/options/phases/ConvertLegacyAnnotations.scala @@ -0,0 +1,14 @@ +// See LICENSE for license details. + +package firrtl.options.phases + +import firrtl.AnnotationSeq +import firrtl.annotations.LegacyAnnotation +import firrtl.options.Phase + +/** Convert any [[LegacyAnnotation]]s to non-legacy variants */ +object ConvertLegacyAnnotations extends Phase { + + def transform(annotations: AnnotationSeq): AnnotationSeq = LegacyAnnotation.convertLegacyAnnos(annotations) + +} -- cgit v1.2.3