diff options
| author | Jack Koenig | 2020-10-22 18:40:54 -0700 |
|---|---|---|
| committer | GitHub | 2020-10-22 18:40:54 -0700 |
| commit | 0745dedefea901df029e65aa59846d8b561dfd31 (patch) | |
| tree | c887b28eaa896af282ad91809fac5c511aac3b8a /core/src/main/scala/chisel3/BlackBox.scala | |
| parent | 26deb7703389b78a9b2a61f7e191f3f0e2a6623b (diff) | |
Use Data refs for name prefixing with aggregate elements (#1616)
* Use Data refs for name prefixing with aggregate elements
Vecs set the refs of their elements upon construction of those elements.
In the past, Records haven't set their elements refs until module close,
but it can be done sooner. Doing it upon binding means that refs will at
least be available for Records used in hardware elements. Since only
bound Data can be connected to anyway, Aggregate elements being
connected to will always have a ref which we can then use for creating
naming prefixes.
* Add tighter correctness checks
* Handle more cases in connection prefixing
Add support for forcing setRef to override a previous setting. This
is only used by BlackBox ports which need to drop their io prefix.
Also add a Try() around Data.bindingToString which sometimes throws
exceptions when being used to .toString a Data in an error message.
* Strip trailing spaces in names in compiler plugin
Diffstat (limited to 'core/src/main/scala/chisel3/BlackBox.scala')
| -rw-r--r-- | core/src/main/scala/chisel3/BlackBox.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/src/main/scala/chisel3/BlackBox.scala b/core/src/main/scala/chisel3/BlackBox.scala index b204e301..1b093ee1 100644 --- a/core/src/main/scala/chisel3/BlackBox.scala +++ b/core/src/main/scala/chisel3/BlackBox.scala @@ -165,7 +165,8 @@ abstract class BlackBox(val params: Map[String, Param] = Map.empty[String, Param // Long term solution will be to define BlackBox IO differently as part of // it not descending from the (current) Module for ((name, port) <- namedPorts) { - port.setRef(ModuleIO(this, _namespace.name(name))) + // We have to force override the _ref because it was set during IO binding + port.setRef(ModuleIO(this, _namespace.name(name)), force = true) } // We need to call forceName and onModuleClose on all of the sub-elements |
