Skip to content

Commit

Permalink
Add support for child refs that are banks and multiports
Browse files Browse the repository at this point in the history
  • Loading branch information
jhaye committed Aug 11, 2022
1 parent 023e6b1 commit d81d8a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions org.lflang/src/org/lflang/generator/rust/PortEmitter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ object PortEmitter : RustEmitterBase() {

if (isBank && !isMultiport) {
lhsPorts = "unsafe_iter_bank!($rustChildName # $rustFieldOnChildName)"
} else if (isBank && isMultiport) {
lhsPorts = "unsafe_iter_bank!($rustChildName # ($rustFieldOnChildName)+)"
}

if (isInput) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,10 @@ ${" | "..declareChildConnections()}
}
is ChildPortReference -> {
if (isMultiport || isBank) {
val width = if (isMultiport && !isBank) {
val width = if (!isBank && isMultiport) {
widthSpecMultiport
} else if (isBank && isMultiport) {
"$widthSpecBank * $widthSpecMultiport"
} else {
widthSpecBank
}
Expand Down

0 comments on commit d81d8a6

Please sign in to comment.