Perform the transform, encode renaming with RenameMap, and can delete annotations Called by runTransform.
Perform the transform, encode renaming with RenameMap, and can delete annotations Called by runTransform.
Input Firrtl AST
A transformed Firrtl AST
The firrtl.CircuitForm that this transform requires to operate on
The firrtl.CircuitForm that this transform requires to operate on
A convenience function useful for debugging and error messages
A convenience function useful for debugging and error messages
The firrtl.CircuitForm that this transform outputs
The firrtl.CircuitForm that this transform outputs
Perform the transform and update annotations.
Perform the transform and update annotations.
Input Firrtl AST
A transformed Firrtl AST
A mathematical transform on some type
A mathematical transform on some type
an output object of the same type
Convenience method to get annotations relevant to this Transform
Convenience method to get annotations relevant to this Transform
The CircuitState form which to extract annotations
A collection of annotations
(Since version 1.1) Just collect the actual Annotation types the transform wants
AnalyzeCircuit Transform
Walks firrtl.ir.Circuit, and records the number of muxes and instances it finds, per module.
While the Firrtl parser emits a bare form of the IR (located in firrtl.ir._), it is often useful to have more information in these case classes. To do this, the Firrtl compiler has mirror "working" classes for the following IR nodes (which contain additional fields):
Take a look at ToWorkginIR in src/main/scala/firrtl/passes/Passes.scala to see how Firrtl IR nodes are replaced with working IR nodes.
Future lessons will explain the WIR's additional fields. For now, it is enough to know that the transform firrtl.ResolveAndCheck populates these fields, and checks the legality of the circuit. If your transform is creating new WIR nodes, use the following "unknown" values in the WIR node, and then call firrtl.ResolveAndCheck at the end of your transform:
The following firrtl.CircuitForms require WIR instead of IR nodes:
See the following links for more detailed explanations: IR vs Working IR