diff --git a/core/src/main/scala/chisel3/ModuleImpl.scala b/core/src/main/scala/chisel3/ModuleImpl.scala index cb64f152553..7d76885fef6 100644 --- a/core/src/main/scala/chisel3/ModuleImpl.scala +++ b/core/src/main/scala/chisel3/ModuleImpl.scala @@ -936,7 +936,7 @@ package experimental { case Some(c) => getRef.fullName(c) } - /** Additional module prefix, applies to this module if defined (unless localModulePrefix is false) and all children. + /** Additional module prefix, applies to this module if defined (unless localModulePrefixAppliesToSelf is false) and all children. */ def localModulePrefix: Option[String] = None @@ -944,14 +944,14 @@ package experimental { * * Users should override to false if [[localModulePrefix]] should apply only to children. */ - def localPrefixAppliesToSelf: Boolean = true + def localModulePrefixAppliesToSelf: Boolean = true /** The resolved module prefix used for this Module. * - * Includes [[localModulePrefix]] if defined and if [[localPrefixAppliesToSelf]] is true. + * Includes [[localModulePrefix]] if defined and if [[localModulePrefixAppliesToSelf]] is true. */ final val modulePrefix: String = - withModulePrefix(localModulePrefix.filter(_ => localPrefixAppliesToSelf).getOrElse("")) { + withModulePrefix(localModulePrefix.filter(_ => localModulePrefixAppliesToSelf).getOrElse("")) { Builder.getModulePrefix } diff --git a/docs/src/explanations/moduleprefix.md b/docs/src/explanations/moduleprefix.md index ec61b8c15be..59451cf7c78 100644 --- a/docs/src/explanations/moduleprefix.md +++ b/docs/src/explanations/moduleprefix.md @@ -63,14 +63,14 @@ class Sub extends Module { This results in two module definitions: `Foo_Top` and `Foo_Sub`. -You can also override `localPrefixAppliesToSelf` to `false` to only apply the prefix to the children. +You can also override `localModulePrefixAppliesToSelf` to `false` to only apply the prefix to the children. ```scala mdoc:silent:reset import chisel3._ class Top extends Module { override def localModulePrefix = Some("Foo") - override def localPrefixAppliesToSelf = false + override def localModulePrefixAppliesToSelf = false val sub = Module(new Sub) } @@ -124,7 +124,7 @@ class Top extends Module { class Mid extends Module { // You can mix withModulePrefix and localModulePrefix. override def localModulePrefix = Some("Bar") - override def localPrefixAppliesToSelf = false + override def localModulePrefixAppliesToSelf = false val sub = Module(new Sub) } diff --git a/src/test/scala/chiselTests/ModulePrefixSpec.scala b/src/test/scala/chiselTests/ModulePrefixSpec.scala index d24b407be7d..862c3b9fe06 100644 --- a/src/test/scala/chiselTests/ModulePrefixSpec.scala +++ b/src/test/scala/chiselTests/ModulePrefixSpec.scala @@ -302,14 +302,14 @@ class ModulePrefixSpec extends ChiselFlatSpec with ChiselRunners with Utils with matchesAndOmits(chirrtl)(lines: _*)() } - it should "set the prefix for a Module's children but not the Module itself if localPrefixAppliesToSelf is false" in { + it should "set the prefix for a Module's children but not the Module itself if localModulePrefixAppliesToSelf is false" in { class Foo extends RawModule class Bar extends RawModule class Top extends RawModule { override def localModulePrefix = Some("Prefix") - override def localPrefixAppliesToSelf = false + override def localModulePrefixAppliesToSelf = false val foo = Module(new Foo) val bar = Module(new Bar) }