Add an implicit annotation file derived from the determined top name of the circuit if no InputAnnotationFileAnnotation is present.
Add an implicit annotation file derived from the determined top name of the circuit if no InputAnnotationFileAnnotation is present.
The implicit annotation file is determined through the following complicated semantics:
main
in a Circuit) is discernable (see below) and a
file called topName.anno
(exactly, not topName.anno.json
) exists, then this will add an
InputAnnotationFileAnnotation using that topName.anno
The precedence for determining the topName
is the following (first one wins):
topName
in a TopNameAnnotationmain
FirrtlCircuitAnnotationmain
in a parsed FirrtlSourceAnnotationmain
in the first FirrtlFileAnnotation using either ProtoBuf or parsing as determined by file
extension
output annotations
Add a FirrtlFileAnnotation if no annotation that explictly defines a circuit exists.
Add a FirrtlFileAnnotation if no annotation that explictly defines a circuit exists.
This takes the option with the following precedence:
In the case of (3) above, this AnnotationSeq is likely insufficient for FIRRTL to work with (no circuit was passed). However, instead of catching this here, we rely on Checks to validate the annotations.
Adds an EmitAnnotation for each CompilerAnnotation.
Adds an EmitAnnotation for each CompilerAnnotation.
If an EmitOneFilePerModuleAnnotation exists, then this will add an EmitAllModulesAnnotation. Otherwise, this adds an EmitCircuitAnnotation. This replicates old behavior where specifying a compiler automatically meant that an emitter would also run.
(Since version 1.2) AddImplicitEmitter should only be used to build Driver compatibility wrappers. Switch to Stage.
Adds an OutputFileAnnotation derived from a TopNameAnnotation if no OutputFileAnnotation already exists.
Adds an OutputFileAnnotation derived from a TopNameAnnotation if no OutputFileAnnotation already exists. If no TopNameAnnotation exists, then no OutputFileAnnotation is added.
(Since version 1.2) AddImplicitOutputFile should only be used to build Driver compatibility wrappers. Switch to Stage.
Holds the name of the top (main) module in an input circuit
Holds the name of the top (main) module in an input circuit
(Since version 1.2) "top-name" is deprecated as part of the Stage/Phase refactor. Use explicit input/output files.
Indicates that the implicit emitter, derived from a CompilerAnnotation should be an EmitAllModulesAnnotation as opposed to an EmitCircuitAnnotation.
Convert an AnnotationSeq to a deprecated FirrtlExecutionResult.
Convert an AnnotationSeq to a deprecated FirrtlExecutionResult.
a sequence of Annotation
(Since version 1.2) FirrtlExecutionResult is deprecated as part of the Stage/Phase refactor. Migrate to FirrtlStage.
Provides compatibility methods to replicate deprecated Driver semantics.
At a high level, the Driver tries extremely hard to figure out what the user meant and to enable them to not be explicit with command line options. As an example, the
--top-name
option is not used for any FIRRTL top module determination, but to find a FIRRTL file by that name and/or an annotation file by that name. This mode of file discovery is only used if no explicit FIRRTL file/source/circuit and/or annotation file is given. Going further, the--top-name
argument is implicitly specified by themain
of an input circuit if not explicit and can be used to derive an annotation file. Summarily, the Phases provided by this enable this type of resolution.Only use these methods if you are intending to replicate old Driver semantics for a good reason. Otherwise, opt for more explicit specification by the user.