Package

firrtl.stage

phases

Permalink

package phases

Visibility
  1. Public
  2. All

Type Members

  1. class AddCircuit extends Phase

    Permalink

    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:

    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..

  2. class AddDefaults extends Phase

    Permalink

    Phase that adds default FirrtlOption Annotations.

    Phase that adds default FirrtlOption Annotations. This is a part of the preprocessing done by FirrtlStage.

  3. class AddImplicitEmitter extends Phase

    Permalink

    Phase that adds a EmitCircuitAnnotation derived from a CompilerAnnotation if one does not already exist.

  4. class AddImplicitOutputFile extends Phase

    Permalink

    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:

    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).

  5. class Checks extends Phase

    Permalink

    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.

  6. class Compiler extends Phase with Translator[AnnotationSeq, Seq[CompilerRun]]

    Permalink

    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).

  7. class WriteEmitted extends Phase

    Permalink

    Phase that writes any EmittedAnnotations in an input AnnotationSeq to one or more files.

    Phase that writes any EmittedAnnotations in an input AnnotationSeq to one or more files. The input AnnotationSeq is viewed as both FirrtlOptions and StageOptions to determine the output filenames in the following way:

    This does no sanity checking of the input AnnotationSeq. This simply writes any modules or circuits it sees to files. If you need additional checking, then you should stack an appropriate checking phase before this.

    Any annotations written to files will be deleted.

Value Members

  1. object DriverCompatibility

    Permalink

    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 the main 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.

Ungrouped