Skip to content

Commit

Permalink
[VTA] [Chisel] make dram offset configurable for uops different than …
Browse files Browse the repository at this point in the history
…4-bytes (apache#3654)
  • Loading branch information
vegaluisjose authored and jroesch committed Jul 29, 2019
1 parent 6970fc3 commit a88b284
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions vta/hardware/chisel/src/main/scala/core/Core.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ case class CoreParams (
outMemDepth: Int = 512,
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]

Expand Down
3 changes: 2 additions & 1 deletion vta/hardware/chisel/src/main/scala/core/LoadUop.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class LoadUop(debug: Boolean = false)(implicit p: Parameters) extends Module {
})
val numUop = 2 // store two uops per sram word
val uopBits = p(CoreKey).uopBits
val uopBytes = uopBits / 8
val uopDepth = p(CoreKey).uopMemDepth / numUop

val dec = io.inst.asTypeOf(new MemDecode)
Expand Down Expand Up @@ -129,7 +130,7 @@ class LoadUop(debug: Boolean = false)(implicit p: Parameters) extends Module {
when (offsetIsEven) {
raddr := io.baddr + dec.dram_offset
} .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) {
raddr := raddr + xmax_bytes
Expand Down

0 comments on commit a88b284

Please sign in to comment.