Generates a sequence of Transforms to lower a Firrtl circuit
Generates a sequence of Transforms to lower a Firrtl circuit
CircuitForm to lower from
CircuitForm to lower to
Sequence of transforms that will lower if outputForm is lower than inputForm
(Since version FIRRTL 1.3) Use a TransformManager requesting which transforms you want to run. This will be removed in 1.4.
Merge a Seq of lowering transforms with custom transforms
Merge a Seq of lowering transforms with custom transforms
Custom Transforms are inserted based on their Transform.inputForm and Transform.outputForm with any Emitters being scheduled last. Custom transforms are inserted in order at the last location in the Seq of transforms where previous.outputForm == customTransform.inputForm. If a customTransform outputs a higher form than input, getLoweringTransforms is used to relower the circuit.
(Since version FIRRTL 1.3) Use a TransformManager requesting which transforms you want to run. This will be removed in 1.4.
// Let Transforms be represented by CircuitForm => CircuitForm val A = HighForm => MidForm val B = MidForm => LowForm val lowering = List(A, B) // Assume these transforms are used by getLoweringTransforms // Some custom transforms val C = LowForm => LowForm val D = MidForm => MidForm val E = LowForm => HighForm // All of the following comparisons are true mergeTransforms(lowering, List(C)) == List(A, B, C) mergeTransforms(lowering, List(D)) == List(A, D, B) mergeTransforms(lowering, List(E)) == List(A, B, E, A, B) mergeTransforms(lowering, List(C, E)) == List(A, B, C, E, A, B) mergeTransforms(lowering, List(E, C)) == List(A, B, E, A, B, C) // Notice that in the following, custom transform order is NOT preserved (see note) mergeTransforms(lowering, List(C, D)) == List(A, D, B, C)
Order will be preserved for custom transforms so long as the inputForm of a latter transforms is equal to or lower than the outputForm of the previous transform.
(Since version FIRRTL 1.3) This will be removed in 1.4