Commit a88b2842 by Luis Vega Committed by Jared Roesch

[VTA] [Chisel] make dram offset configurable for uops different than 4-bytes (#3654)

parent 6970fc30
...@@ -40,6 +40,9 @@ case class CoreParams ( ...@@ -40,6 +40,9 @@ case class CoreParams (
outMemDepth: Int = 512, outMemDepth: Int = 512,
instQueueEntries: Int = 32 instQueueEntries: Int = 32
) )
{
require (uopBits % 8 == 0, s"\n\n[VTA] [CoreParams] uopBits must be byte aligned\n\n")
}
case object CoreKey extends Field[CoreParams] case object CoreKey extends Field[CoreParams]
......
...@@ -69,6 +69,7 @@ class LoadUop(debug: Boolean = false)(implicit p: Parameters) extends Module { ...@@ -69,6 +69,7 @@ class LoadUop(debug: Boolean = false)(implicit p: Parameters) extends Module {
}) })
val numUop = 2 // store two uops per sram word val numUop = 2 // store two uops per sram word
val uopBits = p(CoreKey).uopBits val uopBits = p(CoreKey).uopBits
val uopBytes = uopBits / 8
val uopDepth = p(CoreKey).uopMemDepth / numUop val uopDepth = p(CoreKey).uopMemDepth / numUop
val dec = io.inst.asTypeOf(new MemDecode) val dec = io.inst.asTypeOf(new MemDecode)
...@@ -129,7 +130,7 @@ class LoadUop(debug: Boolean = false)(implicit p: Parameters) extends Module { ...@@ -129,7 +130,7 @@ class LoadUop(debug: Boolean = false)(implicit p: Parameters) extends Module {
when (offsetIsEven) { when (offsetIsEven) {
raddr := io.baddr + dec.dram_offset raddr := io.baddr + dec.dram_offset
} .otherwise { } .otherwise {
raddr := io.baddr + dec.dram_offset - 4.U raddr := io.baddr + dec.dram_offset - uopBytes.U
} }
} .elsewhen (state === sReadData && xcnt === xlen && xrem =/= 0.U) { } .elsewhen (state === sReadData && xcnt === xlen && xrem =/= 0.U) {
raddr := raddr + xmax_bytes raddr := raddr + xmax_bytes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment