summaryrefslogtreecommitdiff
path: root/core/src/main/scala/chisel3/experimental/package.scala
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/scala/chisel3/experimental/package.scala')
-rw-r--r--core/src/main/scala/chisel3/experimental/package.scala34
1 files changed, 34 insertions, 0 deletions
diff --git a/core/src/main/scala/chisel3/experimental/package.scala b/core/src/main/scala/chisel3/experimental/package.scala
index 9b9c83f4..b1d9cae4 100644
--- a/core/src/main/scala/chisel3/experimental/package.scala
+++ b/core/src/main/scala/chisel3/experimental/package.scala
@@ -160,8 +160,42 @@ package object experimental {
* }
* }}}
*/
+ @deprecated(
+ "@chiselName and NoChiselNamePrefix have been replaced by the compiler plugin and AffectsChiselPrefix. Use these instead",
+ "Chisel 3.5"
+ )
trait NoChiselNamePrefix
+ /** Generate prefixes from values of this type in the Chisel compiler plugin
+ *
+ * Users can mixin this trait to tell the Chisel compiler plugin to include the names of
+ * vals of this type when generating prefixes for naming `Data` and `Mem` instances.
+ * This is generally useful whenever creating a `class` that contains `Data`, `Mem`,
+ * or `Module` instances but does not itself extend `Data` or `Module`.
+ *
+ * @see See [[https://www.chisel-lang.org/chisel3/docs/explanations/naming.html the compiler plugin documentation]] for more information on this process.
+ *
+ * @example {{{
+ * import chisel3._
+ * import chisel3.experimental.AffectsChiselPrefix
+ *
+ * class MyModule extends Module {
+ * // Note: This contains a Data but is not a named component itself
+ * class NotAData extends AffectsChiselPrefix {
+ * val value = Wire(Bool())
+ * }
+ *
+ * // Name with AffectsChiselPrefix: "nonData_value"
+ * // Name without AffectsChiselPrefix: "value"
+ * val nonData = new NotAData
+ *
+ * // Name with AffectsChiselPrefix: "nonData2_value"
+ * // Name without AffectsChiselPrefix: "value_1"
+ * val nonData2 = new NotAData
+ * }
+ */
+ trait AffectsChiselPrefix
+
object BundleLiterals {
implicit class AddBundleLiteralConstructor[T <: Record](x: T) {
def Lit(elems: (T => (Data, Data))*)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): T = {