chiselfirrtl

How to convert a deprecated low Firrtl Transform to the Dependency API


I am updating a Firrtl transform that looks like this

class RetimeTransform extends Transform {
  override def inputForm: CircuitForm = LowForm
  override def outputForm: CircuitForm = LowForm
  
  ...

to the new Dependency API. Changed the transform to this

class RetimeTransform extends Transform with DependencyAPIMigration {

but now it does not run the transform in the same order as before. Is there a simple way to specify the dependencies so I get the original behavior?


Solution

  • Many thanks to the Chisel team. It seems the answer is to do the conversion like this.

    class RetimeTransform extends Transform with DependencyAPIMigration {
    
      override def prerequisites: Seq[TransformDependency] = Forms.LowForm
      override def optionalPrerequisites: Seq[TransformDependency] = Forms.LowFormOptimized
      override def optionalPrerequisiteOf: Seq[TransformDependency] = Forms.LowEmitters