diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/scala/chisel3/Driver.scala | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/scala/chisel3/Driver.scala b/src/main/scala/chisel3/Driver.scala index 8a2256df..f3ba6534 100644 --- a/src/main/scala/chisel3/Driver.scala +++ b/src/main/scala/chisel3/Driver.scala @@ -146,10 +146,16 @@ object Driver extends BackendCompilationUtilities { af.write(circuit.annotations.toArray.toYaml.prettyPrint) af.close() - /* create custom transforms by finding the set of transform classes associated with annotations - * then instantiate them into actual transforms - */ - val transforms = circuit.annotations.map(_.transform).toSet.map { transformClass: Class[_ <: Transform] => + /** Find the set of transform classes associated with annotations then + * instantiate an instance of each transform + * @note Annotations targeting firrtl.Transform will not result in any + * transform being instantiated + */ + val transforms = circuit.annotations + .map(_.transform) + .distinct + .filterNot(_ == classOf[firrtl.Transform]) + .map { transformClass: Class[_ <: Transform] => transformClass.newInstance() } /* This passes the firrtl source and annotations directly to firrtl */ |
