summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main/scala/chisel3/core/Module.scala
diff options
context:
space:
mode:
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/Module.scala')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/Module.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Module.scala b/chiselFrontend/src/main/scala/chisel3/core/Module.scala
index ba0720a4..bbed4d9f 100644
--- a/chiselFrontend/src/main/scala/chisel3/core/Module.scala
+++ b/chiselFrontend/src/main/scala/chisel3/core/Module.scala
@@ -94,8 +94,11 @@ extends HasId {
private[core] val _ids = ArrayBuffer[HasId]()
Builder.currentModule = Some(this)
- /** Name of the instance. */
- val name = Builder.globalNamespace.name(getClass.getName.split('.').last)
+ /** Desired name of this module. */
+ def desiredName = this.getClass.getName.split('.').last
+
+ /** Legalized name of this module. */
+ final val name = Builder.globalNamespace.name(desiredName)
/** IO for this Module. At the Scala level (pre-FIRRTL transformations),
* connections in and out of a Module may only go through `io` elements.