Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/main/scala/openLLC/chi/LinkLayer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -109,30 +109,34 @@ class RNLinkMonitor(implicit p: Parameters) extends LLCModule {
dontTouch(io.out)

def setSrcID[T <: Bundle](in: DecoupledIO[T], srcID: UInt): DecoupledIO[T] = {
val out = Wire(in.cloneType)
val out = Wire(chiselTypeOf(in))
out <> in
out.bits.elements.filter(_._1 == "srcID").head._2 := srcID
out
}

def setSrcID[T <: Bundle](in: ChannelIO[T], gen: T, srcID: UInt): ChannelIO[T] = {
val out = Wire(in.cloneType)
val flit = WireDefault(in.flit.asTypeOf(gen))
flit.elements.filter(_._1 == "srcID").head._2 := srcID
val out = Wire(chiselTypeOf(in))
out <> in
out.flit.asTypeOf(gen).elements.filter(_._1 == "srcID").head._2 := srcID
out.flit := flit.asUInt
out
}

def setTgtID[T <: Bundle](in: DecoupledIO[T], tgtID: UInt): DecoupledIO[T] = {
val out = Wire(in.cloneType)
val out = Wire(chiselTypeOf(in))
out <> in
out.bits.elements.filter(_._1 == "tgtID").head._2 := tgtID
out
}

def setTgtID[T <: Bundle](in: ChannelIO[T], gen: T, tgtID: UInt): ChannelIO[T] = {
val out = Wire(in.cloneType)
val flit = WireDefault(in.flit.asTypeOf(gen))
flit.elements.filter(_._1 == "tgtID").head._2 := tgtID
val out = Wire(chiselTypeOf(in))
out <> in
out.flit.asTypeOf(gen).elements.filter(_._1 == "tgtID").head._2 := tgtID
out.flit := flit.asUInt
out
}
}
Expand Down