From 0d00420ba2d00a957ace9112ab570fe52abea9d3 Mon Sep 17 00:00:00 2001 From: Jim Lawson Date: Thu, 28 Mar 2019 09:32:42 -0700 Subject: Make core.DontCare private to chisel3 (#1054) Force clients to access 'DontCare' through the chisel3 package to ensure it's created as a chisel3 object and not a client object.--- chiselFrontend/src/main/scala/chisel3/core/Data.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'chiselFrontend') diff --git a/chiselFrontend/src/main/scala/chisel3/core/Data.scala b/chiselFrontend/src/main/scala/chisel3/core/Data.scala index ee8c90a1..daa89045 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Data.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Data.scala @@ -670,9 +670,10 @@ object WireDefault { /** RHS (source) for Invalidate API. * Causes connection logic to emit a DefInvalid when connected to an output port (or wire). */ -object DontCare extends Element { +private[chisel3] object DontCare extends Element { // This object should be initialized before we execute any user code that refers to it, // otherwise this "Chisel" object will end up on the UserModule's id list. + // We make it private to chisel3 so it has to be accessed through the package object. private[chisel3] override val width: Width = UnknownWidth() -- cgit v1.2.3