From a57e4b1ea0970266aae8ce3bb5edaaf605057035 Mon Sep 17 00:00:00 2001 From: Richard Lin Date: Thu, 8 Feb 2018 10:50:35 -0800 Subject: Make uncloneable IO deprecated instead of error, improve error handling (#771) It appears #754 breaks more code than I thought, so this makes it a soft error (with a runtime deprecation warning - to get people to fix their stuff before we break it for real) for now. This additionally changes the autoclonetype errors to be more deterministic (reporting class names instead of object names) in the most common cases, to allow the deprecations manager to deduplicate warnings.--- chiselFrontend/src/main/scala/chisel3/core/Module.scala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'chiselFrontend/src/main/scala/chisel3/core/Module.scala') diff --git a/chiselFrontend/src/main/scala/chisel3/core/Module.scala b/chiselFrontend/src/main/scala/chisel3/core/Module.scala index 74479c6b..5ba6dbc8 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Module.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Module.scala @@ -255,7 +255,14 @@ abstract class BaseModule extends HasId { requireIsChiselType(iodef, "io type") // Clone the IO so we preserve immutability of data types - val iodefClone = iodef.cloneTypeFull + val iodefClone = try { + iodef.cloneTypeFull + } catch { + // For now this is going to be just a deprecation so we don't suddenly break everyone's code + case e: AutoClonetypeException => + Builder.deprecated(e.getMessage, Some(s"${iodef.getClass}")) + iodef + } _bindIoInPlace(iodefClone) iodefClone } -- cgit v1.2.3