diff options
| author | Jack Koenig | 2019-10-08 07:23:52 -0700 |
|---|---|---|
| committer | Schuyler Eldridge | 2019-10-08 10:23:52 -0400 |
| commit | fafd984a923591841917cd4c3a1f4c823dc485b4 (patch) | |
| tree | 3b2fc032baa424351cc151e4ae2bb85eab51579b /chiselFrontend/src/main/scala | |
| parent | 98bfe2416676651b29cd40fc8388c16bfda467d6 (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/src/main/scala')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/Aggregate.scala | 4 |
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 |
