summaryrefslogtreecommitdiff
path: root/chiselFrontend/src
diff options
context:
space:
mode:
authorJim Lawson2016-08-19 12:02:10 -0700
committerJim Lawson2016-08-19 12:02:10 -0700
commit119e6c7bb9096bbd163a439de09d4932303d0140 (patch)
tree9b77a55d72a03da48be3ba783e9520a9c77bbd76 /chiselFrontend/src
parent471a9e2d15d4c968fc6eca9a86c232c6c9c9322d (diff)
Simplify autioIOWrap code in computePorts().
As a side-effect, handle BlackBoxes correctly.
Diffstat (limited to 'chiselFrontend/src')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/Module.scala13
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 {