Skip to content

Commit

Permalink
Add IO Connections for Custom User Field in TL Channels within Xbar
Browse files Browse the repository at this point in the history
 DontCare should come first before waiveAll so that matching userfield
 bewteen bundles can be connected
 Please refer to the issue page below.
 ucb-bar/chipyard#1888
  • Loading branch information
ksungkeun84 authored and jerryz123 committed Aug 12, 2024
1 parent 14ba271 commit 5a73e15
Showing 1 changed file with 4 additions and 28 deletions.
32 changes: 4 additions & 28 deletions src/main/scala/tilelink/Xbar.scala
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,8 @@ object TLXbar
val r = inputIdRanges(i)

if (connectAIO(i).exists(x=>x)) {
in(i).a.squeezeAll.waiveAll :<>= io_in(i).a.squeezeAll.waiveAll
in(i).a.bits.user := DontCare
// If there are user defined bundles in both sides, connect them.
io_in(i).a.bits.user.keydata.foreach { case (io_in_key, io_in_bundle) =>
in(i).a.bits.user.lift(io_in_key).foreach { in_bundle =>
in_bundle <> io_in_bundle
}
}
in(i).a.squeezeAll.waiveAll :<>= io_in(i).a.squeezeAll.waiveAll
in(i).a.bits.source := io_in(i).a.bits.source | r.start.U
} else {
in(i).a := DontCare
Expand All @@ -188,14 +182,8 @@ object TLXbar
}

if (connectCIO(i).exists(x=>x)) {
in(i).c.squeezeAll.waiveAll :<>= io_in(i).c.squeezeAll.waiveAll
in(i).c.bits.user := DontCare
// If there are user defined bundles in both sides, connect them.
io_in(i).c.bits.user.keydata.foreach { case (io_in_key, io_in_bundle) =>
in(i).c.bits.user.lift(io_in_key).foreach { in_bundle =>
in_bundle <> io_in_bundle
}
}
in(i).c.squeezeAll.waiveAll :<>= io_in(i).c.squeezeAll.waiveAll
in(i).c.bits.source := io_in(i).c.bits.source | r.start.U
} else {
in(i).c := DontCare
Expand Down Expand Up @@ -230,14 +218,8 @@ object TLXbar
val r = outputIdRanges(o)

if (connectAOI(o).exists(x=>x)) {
io_out(o).a.squeezeAll.waiveAll :<>= out(o).a.squeezeAll.waiveAll
out(o).a.bits.user := DontCare
// If there are user defined bundles in both sides, connect them.
out(o).a.bits.user.keydata.foreach { case (out_key, out_bundle) =>
io_out(o).a.bits.user.lift(out_key).foreach { io_out_bundle =>
io_out_bundle <> out_bundle
}
}
io_out(o).a.squeezeAll.waiveAll :<>= out(o).a.squeezeAll.waiveAll
} else {
out(o).a := DontCare
io_out(o).a := DontCare
Expand All @@ -255,14 +237,8 @@ object TLXbar
}

if (connectCOI(o).exists(x=>x)) {
io_out(o).c.squeezeAll.waiveAll :<>= out(o).c.squeezeAll.waiveAll
out(o).c.bits.user := DontCare
// If there are user defined bundles in both sides, connect them.
out(o).c.bits.user.keydata.foreach { case (out_key, out_bundle) =>
io_out(o).c.bits.user.lift(out_key).foreach { io_out_bundle =>
io_out_bundle <> out_bundle
}
}
io_out(o).c.squeezeAll.waiveAll :<>= out(o).c.squeezeAll.waiveAll
} else {
out(o).c := DontCare
io_out(o).c := DontCare
Expand Down

0 comments on commit 5a73e15

Please sign in to comment.