Skip to content

Commit

Permalink
Update SRAM.scala to improve perf on non-full sized reads
Browse files Browse the repository at this point in the history
Change a_sublane to not count sublanes if it's a read. Reads return full data width, no matter if the A channel size is not the data width
  • Loading branch information
Kevin99214 committed Apr 10, 2024
1 parent dbcb06a commit 6ce53a1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/scala/tilelink/SRAM.scala
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,15 @@ class TLRAM(
val r_ready = !d_wb && !r_replay && (!d_full || d_ready) && (!r_respond || (!d_win && in.d.ready))
in.a.ready := !(d_full && d_wb) && (!r_full || r_ready) && (!r_full || !(r_atomic || r_sublane))

// ignore sublane if mask is all set
// ignore sublane if it is a read or mask is all set
val a_read = in.a.bits.opcode === TLMessages.Get
val a_sublane = if (eccBytes == 1) false.B else
((in.a.bits.opcode === TLMessages.PutPartialData) && (~in.a.bits.mask.andR)) ||
in.a.bits.size < log2Ceil(eccBytes).U
~a_read &&
(((in.a.bits.opcode === TLMessages.PutPartialData) && (~in.a.bits.mask.andR)) ||
in.a.bits.size < log2Ceil(eccBytes).U)
val a_atomic = if (!atomics) false.B else
in.a.bits.opcode === TLMessages.ArithmeticData ||
in.a.bits.opcode === TLMessages.LogicalData
val a_read = in.a.bits.opcode === TLMessages.Get

// Forward pipeline stage from R to D
when (d_ready) { d_full := false.B }
Expand Down

0 comments on commit 6ce53a1

Please sign in to comment.