object DriverCompatibility
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.
- Alphabetic
- By Inheritance
- DriverCompatibility
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
class
AddImplicitAnnotationFile extends Phase with PreservesAll[Phase]
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:
- If an InputAnnotationFileAnnotation already exists, then nothing is modified
- If the derived topName (the
main
in a Circuit) is discernable (see below) and a file calledtopName.anno
(exactly, nottopName.anno.json
) exists, then this will add an InputAnnotationFileAnnotation using thattopName.anno
- If any of this doesn't work, then the the AnnotationSeq is unmodified
The precedence for determining the
topName
is the following (first one wins):- The
topName
in a TopNameAnnotation - The
main
FirrtlCircuitAnnotation - The
main
in a parsed FirrtlSourceAnnotation - The
main
in the first FirrtlFileAnnotation using either ProtoBuf or parsing as determined by file extension
- returns
output annotations
-
class
AddImplicitFirrtlFile extends Phase with PreservesAll[Phase]
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:
- If an annotation subclassing CircuitOption exists, do nothing
- If a TopNameAnnotation exists, use that to derive a FirrtlFileAnnotation and append it
- Do nothing
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.
-
class
AddImplicitEmitter extends Phase with PreservesAll[Phase]
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.
- Annotations
- @deprecated
- Deprecated
(Since version 1.2) AddImplicitEmitter should only be used to build Driver compatibility wrappers. Switch to Stage.
-
class
AddImplicitOutputFile extends Phase with PreservesAll[Phase]
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.
- Annotations
- @deprecated
- Deprecated
(Since version 1.2) AddImplicitOutputFile should only be used to build Driver compatibility wrappers. Switch to Stage.
-
case class
TopNameAnnotation(topName: String) extends NoTargetAnnotation with Product with Serializable
Holds the name of the top (main) module in an input circuit
Holds the name of the top (main) module in an input circuit
- Annotations
- @deprecated
- Deprecated
(Since version 1.2) "top-name" is deprecated as part of the Stage/Phase refactor. Use explicit input/output files.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
object
EmitOneFilePerModuleAnnotation extends NoTargetAnnotation with Product with Serializable
Indicates that the implicit emitter, derived from a CompilerAnnotation should be an EmitAllModulesAnnotation as opposed to an EmitCircuitAnnotation.
- object TopNameAnnotation extends Serializable
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.
-
def
firrtlResultView(annotations: AnnotationSeq): FirrtlExecutionResult
Convert an AnnotationSeq to a deprecated FirrtlExecutionResult.
Convert an AnnotationSeq to a deprecated FirrtlExecutionResult.
- annotations
a sequence of Annotation
- Annotations
- @deprecated
- Deprecated
(Since version 1.2) FirrtlExecutionResult is deprecated as part of the Stage/Phase refactor. Migrate to FirrtlStage.
This is the documentation for Firrtl.