diff options
| author | Richard Lin | 2018-02-02 23:30:56 -0800 |
|---|---|---|
| committer | GitHub | 2018-02-02 23:30:56 -0800 |
| commit | 1bfca502c69a26edca86d716a1ca9d24e6789e59 (patch) | |
| tree | a5c035ee45c3cd66e2d9b63c74aca75575f78f83 /chiselFrontend/src | |
| parent | 639617ea42c777b8dd1f4300d42784e45f294d76 (diff) | |
Autoclonetype will clone args that are of type data (#768)
Diffstat (limited to 'chiselFrontend/src')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/Aggregate.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Aggregate.scala b/chiselFrontend/src/main/scala/chisel3/core/Aggregate.scala index e45f6d72..6a2e68e0 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Aggregate.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Aggregate.scala @@ -702,7 +702,11 @@ class Bundle(implicit compileOptions: CompileOptions) extends Record { " Use chisel types instead: use the value before it is turned to a hardware type (with Wire(...), Reg(...), etc) or use chiselTypeOf(...) to extract the chisel type.") } - val ctorParamsVals = ctorParamsNameVals.map{ case (_, paramVal) => paramVal } + // Clone unbound parameters in case they are being used as bundle fields. + val ctorParamsVals = ctorParamsNameVals.map { + case (_, paramVal: Data) => paramVal.cloneTypeFull + case (_, paramVal) => paramVal + } // Invoke ctor val classMirror = outerClassInstance match { |
