package phases
- Alphabetic
- Public
- All
Type Members
-
class
AddCircuit extends Phase
Phase that expands FirrtlFileAnnotation/FirrtlSourceAnnotation into FirrtlCircuitAnnotations and deletes the originals.
Phase that expands FirrtlFileAnnotation/FirrtlSourceAnnotation into FirrtlCircuitAnnotations and deletes the originals. This is part of the preprocessing done on an input AnnotationSeq by FirrtlStage.
The types of possible annotations are handled in the following ways:
- FirrtlFileAnnotations are read as Protocol Buffers if the file extension ends in
.pb
. Otherwise, these are assumed to be raw FIRRTL text and is sent to the Parser. The original FirrtlFileAnnotation is deleted. - FirrtlSourceAnnotations are run through the Parser. The original FirrtlSourceAnnotation is deleted.
- FirrtlCircuitAnnotations are left untouched (along with all other annotations).
If a Parser is used, its InfoMode is read from a mandatory InfoModeAnnotation. If using an InfoMode that expects a filename, the filename is used for FirrtlFileAnnotations and
[anonymous source]
is used for FirrtlSourceAnnotations.- Note
This must be run after AddDefaults as this Phase depends on the existence of an InfoModeAnnotation..
- FirrtlFileAnnotations are read as Protocol Buffers if the file extension ends in
-
class
AddDefaults extends Phase
Phase that adds default FirrtlOption Annotations.
Phase that adds default FirrtlOption Annotations. This is a part of the preprocessing done by FirrtlStage.
-
class
AddImplicitEmitter extends Phase
Phase that adds a EmitCircuitAnnotation derived from a CompilerAnnotation if one does not already exist.
-
class
AddImplicitOutputFile extends Phase
Phase that adds an OutputFileAnnotation if one does not already exist.
Phase that adds an OutputFileAnnotation if one does not already exist.
To determine the OutputFileAnnotation, the following precedence is used. Whichever happens first succeeds:
- Do nothing if an OutputFileAnnotation or EmitAllModulesAnnotation exist
- Use the main in the first discovered FirrtlCircuitAnnotation (see note below)
- Use "a"
The file suffix may or may not be specified, but this may be arbitrarily changed by the Emitter.
- Note
This Phase has a dependency on AddCircuit. Only a FirrtlCircuitAnnotation will be used to implicitly set the OutputFileAnnotation (not other CircuitOption subclasses).
- class CatchExceptions extends Phase
-
class
Checks extends Phase
Phase that strictly validates an AnnotationSeq.
Phase that strictly validates an AnnotationSeq. The checks applied are intended to be extremeley strict. Nothing is inferred or assumed to take a default value (for default value resolution see AddDefaults).
The intent of this approach is that after running this Phase, a user can be absolutely certain that other Phases or views will succeed. See FirrtlStage for a list of Phase that commonly run before this.
-
class
Compiler extends Phase with Translator[AnnotationSeq, Seq[CompilerRun]]
Runs the FIRRTL compilers on an AnnotationSeq.
Runs the FIRRTL compilers on an AnnotationSeq. If the input AnnotationSeq contains more than one circuit (i.e., more than one FirrtlCircuitAnnotation), then annotations will be broken up and each run will be executed in parallel.
The AnnotationSeq will be chunked up into compiler runs using the following algorithm. All annotations that occur before the first FirrtlCircuitAnnotation are treated as global annotations that apply to all circuits. Annotations after a circuit are only associated with their closest preceeding circuit. E.g., for the following annotations (where A, B, and C are some annotations):
A(a), FirrtlCircuitAnnotation(x), B, FirrtlCircuitAnnotation(y), A(b), C, FirrtlCircuitAnnotation(z)
Then this will result in three compiler runs:
- FirrtlCircuitAnnotation(x): A(a), B
- FirrtlCircuitAnnotation(y): A(a), A(b), C
- FirrtlCircuitAnnotation(z): A(a)
A(a) is a default, global annotation. B binds to FirrtlCircuitAnnotation(x). A(a), A(b), and C bind to FirrtlCircuitAnnotation(y). Note: A(b) may overwrite A(a) if this is a CompilerAnnotation. FirrtlCircuitAnnotation(z) has no annotations, so it only gets the default A(a).
Value Members
- object CatchExceptions
-
object
DriverCompatibility
Provides compatibility methods to replicate deprecated
Driver
semantics.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.
This is the documentation for Firrtl.