diff options
| author | mergify[bot] | 2022-08-16 16:57:34 +0000 |
|---|---|---|
| committer | GitHub | 2022-08-16 16:57:34 +0000 |
| commit | 96830a4ad502019ff1040889a89375ff1e3a6c6b (patch) | |
| tree | a312c8e5041c02d1fb24f46849362ecf9e3111e4 /core/src/main/scala/chisel3 | |
| parent | 21415b11f1005c3cdfdc07fc02294849ce1c81a4 (diff) | |
Add a cookbook and publicly visible scaladoc for prefix, noPrefix (#2687) (#2690)
* Add a cookbook and publicly visible scaladoc for prefix, noPrefix
(cherry picked from commit ae7dc30b3b99f1fbd91c35f54bc19be7c55f74a3)
Co-authored-by: Megan Wachs <megan@sifive.com>
Diffstat (limited to 'core/src/main/scala/chisel3')
| -rw-r--r-- | core/src/main/scala/chisel3/experimental/package.scala | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/core/src/main/scala/chisel3/experimental/package.scala b/core/src/main/scala/chisel3/experimental/package.scala index b1d9cae4..39131943 100644 --- a/core/src/main/scala/chisel3/experimental/package.scala +++ b/core/src/main/scala/chisel3/experimental/package.scala @@ -235,9 +235,33 @@ package object experimental { } } - // Use to add a prefix to any component generated in input scope + /** Use to add a prefix to any components generated in the provided scope. + * + * @example {{{ + * + * val x1 = prefix("first") { + * // Anything generated here will be prefixed with "first" + * } + * + * val x2 = prefix(mysignal) { + * // Anything generated here will be prefixed with the name of mysignal + * } + * + * }}} + */ val prefix = chisel3.internal.prefix - // Use to remove prefixes not in provided scope + + /** Use to clear existing prefixes so no signals within the scope are prefixed + * by signals/names outside the scope + * + * @example {{{ + * + * val x1 = prefix("first") { + * // Anything generated here will have no prefix. + * // The result returned from this would *still* be called `x1` however. + * } + * }}} + */ val noPrefix = chisel3.internal.noPrefix // ****************************** Hardware equivalents of Scala Tuples ****************************** |
