diff options
| author | Jim Lawson | 2016-08-19 12:02:10 -0700 |
|---|---|---|
| committer | Jim Lawson | 2016-08-19 12:02:10 -0700 |
| commit | 119e6c7bb9096bbd163a439de09d4932303d0140 (patch) | |
| tree | 9b77a55d72a03da48be3ba783e9520a9c77bbd76 /chiselFrontend/src/main/scala/chisel3/core | |
| parent | 471a9e2d15d4c968fc6eca9a86c232c6c9c9322d (diff) | |
Simplify autioIOWrap code in computePorts().
As a side-effect, handle BlackBoxes correctly.
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/Module.scala | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Module.scala b/chiselFrontend/src/main/scala/chisel3/core/Module.scala index 24dabcbe..19063664 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Module.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Module.scala @@ -111,17 +111,18 @@ extends HasId { ("clk", clock), ("reset", reset), ("io", io) ) - private[core] def computePorts: Seq[firrtl.Port] = - for((name, port) <- ports) yield { - // If we're auto-wrapping IO definitions, do so now. - if (compileOptions.autoIOWrap && name == "io" && !ioDefined) { - IO(port) - } + private[core] def computePorts: Seq[firrtl.Port] = { + // If we're auto-wrapping IO definitions, do so now. + if (compileOptions.autoIOWrap && !ioDefined) { + IO(io) + } + for ((name, port) <- ports) yield { // Port definitions need to know input or output at top-level. // By FIRRTL semantics, 'flipped' becomes an Input val direction = if(Data.isFirrtlFlipped(port)) Direction.Input else Direction.Output firrtl.Port(port, direction) } + } private[core] def setupInParent(implicit sourceInfo: SourceInfo): this.type = { _parent match { |
