summaryrefslogtreecommitdiff
path: root/chiselFrontend
diff options
context:
space:
mode:
authorJack Koenig2019-10-08 07:23:52 -0700
committerSchuyler Eldridge2019-10-08 10:23:52 -0400
commitfafd984a923591841917cd4c3a1f4c823dc485b4 (patch)
tree3b2fc032baa424351cc151e4ae2bb85eab51579b /chiselFrontend
parent98bfe2416676651b29cd40fc8388c16bfda467d6 (diff)
Fix direction of dynamic index in complex Vec (#1196)
Dynamically indexing a Vec of Flipped bidirectional Bundles would get the wrong directions on the elements of the Bundles Fixes #1192
Diffstat (limited to 'chiselFrontend')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/Aggregate.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/Aggregate.scala b/chiselFrontend/src/main/scala/chisel3/Aggregate.scala
index 4640cb0f..ba9afd5b 100644
--- a/chiselFrontend/src/main/scala/chisel3/Aggregate.scala
+++ b/chiselFrontend/src/main/scala/chisel3/Aggregate.scala
@@ -156,7 +156,9 @@ sealed class Vec[T <: Data] private[chisel3] (gen: => T, val length: Int)
child.bind(ChildBinding(this), resolvedDirection)
}
- direction = sample_element.direction
+ // Since all children are the same, we can just use the sample_element rather than all children
+ // .get is safe because None means mixed directions, we only pass 1 so that's not possible
+ direction = ActualDirection.fromChildren(Set(sample_element.direction), resolvedDirection).get
}
// Note: the constructor takes a gen() function instead of a Seq to enforce