summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorJack Koenig2017-05-30 11:25:11 -0700
committerJack Koenig2017-05-31 11:47:11 -0700
commitd359b47a461dd84937d1655803ddfae955da6a4e (patch)
treecaae8ba234a4838334417887e13c1044db04e3db /src/main
parent666512fa0418e25531b3f7f802d9769f0811cebd (diff)
Dont try to instantiate firrtl.Transform from Annotation
Also make transform instantiation deterministic
Diffstat (limited to 'src/main')
-rw-r--r--src/main/scala/chisel3/Driver.scala14
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 */