aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/Driver.scala
diff options
context:
space:
mode:
authorJack Koenig2017-11-15 14:19:40 -0800
committerAdam Izraelevitz2017-12-29 11:44:24 -0800
commitcfae691ae172633845e279c27be3d70ff5e50cfe (patch)
treea202806126493ae21471874d7dd6f3c50ca49915 /src/main/scala/firrtl/Driver.scala
parentb5a3c2e9c2b6336d4a4ee896e05b5cf2cd45c9f3 (diff)
Remove option --force-append-anno-file, make default
The logic around this option was unintuitive and led to silently dropped annotations.
Diffstat (limited to 'src/main/scala/firrtl/Driver.scala')
-rw-r--r--src/main/scala/firrtl/Driver.scala22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/main/scala/firrtl/Driver.scala b/src/main/scala/firrtl/Driver.scala
index acc7603b..66123d77 100644
--- a/src/main/scala/firrtl/Driver.scala
+++ b/src/main/scala/firrtl/Driver.scala
@@ -95,23 +95,15 @@ object Driver {
* update the firrtlOptions with new annotations if it does
*/
def loadAnnotations(optionsManager: ExecutionOptionsManager with HasFirrtlOptions): Unit = {
- /*
- If firrtlAnnotations in the firrtlOptions are nonEmpty then these will be the annotations
- used by firrtl.
- To use the file annotations make sure that the annotations in the firrtlOptions are empty
- The annotation file if needed is found via
- s"$targetDirName/$topName.anno" or s"$annotationFileNameOverride.anno"
- */
+
def firrtlConfig = optionsManager.firrtlOptions
- if (firrtlConfig.annotations.isEmpty || firrtlConfig.forceAppendAnnoFile) {
- val annotationFileName = firrtlConfig.getAnnotationFileName(optionsManager)
- val annotationFile = new File(annotationFileName)
- if (annotationFile.exists) {
- val annotationsYaml = io.Source.fromFile(annotationFile).getLines().mkString("\n").parseYaml
- val annotationArray = annotationsYaml.convertTo[Array[Annotation]]
- optionsManager.firrtlOptions = firrtlConfig.copy(annotations = firrtlConfig.annotations ++ annotationArray)
- }
+ val annotationFileName = firrtlConfig.getAnnotationFileName(optionsManager)
+ val annotationFile = new File(annotationFileName)
+ if (annotationFile.exists) {
+ val annotationsYaml = io.Source.fromFile(annotationFile).getLines().mkString("\n").parseYaml
+ val annotationArray = annotationsYaml.convertTo[Array[Annotation]]
+ optionsManager.firrtlOptions = firrtlConfig.copy(annotations = firrtlConfig.annotations ++ annotationArray)
}
if(firrtlConfig.annotations.nonEmpty) {