Fix FIRRTL direction calculations for Vec and OpaqueType (backport #2956) (#2963)
* Fix calculuation of firrtl directions for Vecs For ports of type Vec, the direction of both the Vec itself and the direction of its elements can affect the direction of the FIRRTL port. Previously, we did not handle the fact that the Vec's elements could, themselves, be Vecs, thus making this directionality calculation recursive. Also, the logic was only applying to regular RawModules and Modules. The fix now applies to BlackBoxes and ExtModules as well. (cherry picked from commit b501b699) # Conflicts: # core/src/main/scala/chisel3/RawModule.scala # src/test/scala/chiselTests/Direction.scala * Fix calculation of firrtl directions for OpaqueTypes Similarly to Vecs, both the direction of the OpaqueType itself and the direction of its element can affect the direction of the resulting firrtl port. Since OpaqueTypes can wrap other OpaqueTypes, this direction calculation needs to be recursive. The same basic principle applies to calculating firrtl flip for OpaqueTypes that are elements of other Records. (cherry picked from commit c4ec45b3 ) # Conflicts: # src/test/scala/chiselTests/RecordSpec.scala * Resolve backport conflicts --------- Co-authored-by:Jack Koenig <koenig@sifive.com>
parent
1e751546
Please register or sign in to comment