diff options
| author | Jim Lawson | 2016-06-22 11:27:45 -0700 |
|---|---|---|
| committer | Jim Lawson | 2016-06-22 11:27:45 -0700 |
| commit | 47a8b0c8318a3bfe6e86da3398cd67dbfadd8758 (patch) | |
| tree | 89736c4eae2550cbdb5f64ca4dd2865bc79c481d /chiselFrontend/src | |
| parent | 3026dd214f3db3308eaf8f876d0fc03f75c577d3 (diff) | |
| parent | 70a41e5aed5dc3bc52133aecf46049a5946d33fe (diff) | |
Merge branch 'master' into renamechisel3
Diffstat (limited to 'chiselFrontend/src')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/BlackBox.scala | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/BlackBox.scala b/chiselFrontend/src/main/scala/chisel3/core/BlackBox.scala index eee8d598..f2d9558d 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/BlackBox.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/BlackBox.scala @@ -28,13 +28,21 @@ abstract class BlackBox extends Module { // Do not do reflective naming of internal signals, just name io override private[core] def setRefs(): this.type = { - for ((name, port) <- ports) { - port.setRef(ModuleIO(this, _namespace.name(name))) - } // setRef is not called on the actual io. // There is a risk of user improperly attempting to connect directly with io // Long term solution will be to define BlackBox IO differently as part of // it not descending from the (current) Module + for ((name, port) <- ports) { + port.setRef(ModuleIO(this, _namespace.name(name))) + } + // We need to call forceName and onModuleClose on all of the sub-elements + // of the io bundle, but NOT on the io bundle itself. + // Doing so would cause the wrong names to be assigned, since their parent + // is now the module itself instead of the io bundle. + for (id <- _ids; if id ne io) { + id.forceName(default="T", _namespace) + id._onModuleClose + } this } |
