From 1bfca502c69a26edca86d716a1ca9d24e6789e59 Mon Sep 17 00:00:00 2001 From: Richard Lin Date: Fri, 2 Feb 2018 23:30:56 -0800 Subject: Autoclonetype will clone args that are of type data (#768) --- chiselFrontend/src/main/scala/chisel3/core/Aggregate.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'chiselFrontend/src/main/scala') 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 { -- cgit v1.2.3