diff options
| author | Chick Markley | 2016-12-14 15:31:31 -0800 |
|---|---|---|
| committer | Jack Koenig | 2016-12-14 15:31:31 -0800 |
| commit | 59a7c25d5c708305216532ec49c8120e59219f69 (patch) | |
| tree | a3e2540a9e77ecdd74e5044feafb381f1f73193f /src/main | |
| parent | 72e6c884b3f66a379982e5b3efc01afc563275cd (diff) | |
Final steps for annotations getting from chisel to firrtl (#405)
Pass transforms along with Annotations when calling firrtl compiler
This introduces new requirement that firrtl.Transform subclasses (that are associated with an annotation) do not have parameters in their default constructor
Add new test for NoDedup annotation that shows how to annotate a module instance
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/scala/chisel3/Driver.scala | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/scala/chisel3/Driver.scala b/src/main/scala/chisel3/Driver.scala index 646702c3..40c94b54 100644 --- a/src/main/scala/chisel3/Driver.scala +++ b/src/main/scala/chisel3/Driver.scala @@ -247,9 +247,17 @@ 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] => + transformClass.newInstance() + } /* This passes the firrtl source and annotations directly to firrtl */ optionsManager.firrtlOptions = optionsManager.firrtlOptions.copy( - firrtlSource = Some(firrtlString), annotations = circuit.annotations.toList) + firrtlSource = Some(firrtlString), + annotations = circuit.annotations.toList, + customTransforms = transforms.toList) val firrtlExecutionResult = if(chiselOptions.runFirrtlCompiler) { Some(firrtl.Driver.execute(optionsManager)) |
