diff options
| author | Jack | 2022-01-12 04:27:19 +0000 |
|---|---|---|
| committer | Jack | 2022-01-12 04:27:19 +0000 |
| commit | 29df513e348cc809876893f650af8180f0190496 (patch) | |
| tree | 06daaea954b4e5af7113f06e4bdbb78b33515cb3 /src/main/scala/chisel3/util/TransitName.scala | |
| parent | 5242ce90659decb9058ee75db56e5c188029fbf9 (diff) | |
| parent | 747d16311bdf185d2e98e452b14cb5d8ccca004c (diff) | |
Merge branch 'master' into 3.5-release
Diffstat (limited to 'src/main/scala/chisel3/util/TransitName.scala')
| -rw-r--r-- | src/main/scala/chisel3/util/TransitName.scala | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main/scala/chisel3/util/TransitName.scala b/src/main/scala/chisel3/util/TransitName.scala index 97c13696..cc8f2456 100644 --- a/src/main/scala/chisel3/util/TransitName.scala +++ b/src/main/scala/chisel3/util/TransitName.scala @@ -42,24 +42,23 @@ object TransitName { * @param to the thing that will receive the "good" name * @return the `from` parameter */ - def apply[T<:HasId](from: T, to: HasId): T = { + def apply[T <: HasId](from: T, to: HasId): T = { // To transit a name, we need to hook on both the suggestName and autoSeed mechanisms - from.addSuggestPostnameHook((given_name: String) => {to.suggestName(given_name)}) - from.addAutoPostnameHook((given_name: String) => {to.autoSeed(given_name)}) + from.addSuggestPostnameHook((given_name: String) => { to.suggestName(given_name) }) + from.addAutoPostnameHook((given_name: String) => { to.autoSeed(given_name) }) from } - /** Transit a name from one type to another ''and add a suffix'' * @param suffix the suffix to append * @param from the thing with a "good" name * @param to the thing that will receive the "good" name * @return the `from` parameter */ - def withSuffix[T<:HasId](suffix: String)(from: T, to: HasId): T = { + def withSuffix[T <: HasId](suffix: String)(from: T, to: HasId): T = { // To transit a name, we need to hook on both the suggestName and autoSeed mechanisms - from.addSuggestPostnameHook((given_name: String) => {to.suggestName(given_name + suffix)}) - from.addAutoPostnameHook((given_name: String) => {to.autoSeed(given_name + suffix)}) + from.addSuggestPostnameHook((given_name: String) => { to.suggestName(given_name + suffix) }) + from.addAutoPostnameHook((given_name: String) => { to.autoSeed(given_name + suffix) }) from } |
