diff options
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/scala/chisel3/Driver.scala | 10 | ||||
| -rw-r--r-- | src/main/scala/chisel3/util/Decoupled.scala | 5 |
2 files changed, 12 insertions, 3 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)) diff --git a/src/main/scala/chisel3/util/Decoupled.scala b/src/main/scala/chisel3/util/Decoupled.scala index fcda6943..4a97724a 100644 --- a/src/main/scala/chisel3/util/Decoupled.scala +++ b/src/main/scala/chisel3/util/Decoupled.scala @@ -37,12 +37,13 @@ object ReadyValidIO { dat } - /** Indicate no enqueue occurs. Valid is set to false, and all bits are set to zero. + /** Indicate no enqueue occurs. Valid is set to false, and bits are + * connected to an uninitialized wire */ def noenq(): Unit = { target.valid := false.B // We want the type from the following, not any existing binding. - target.bits := target.bits.cloneType.fromBits(0.asUInt) + target.bits := Wire(target.bits.cloneType) } /** Assert ready on this port and return the associated data bits. |
