Skip to content

Commit

Permalink
[VTA] Parameterization and bug fix in TensorLoad module (#3841)
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfu authored and tmoreau89 committed Aug 27, 2019
1 parent 891ee3c commit 347e3d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vta/hardware/chisel/src/main/scala/core/TensorLoad.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class TensorLoad(tensorType: String = "none", debug: Boolean = false)
val xPadCtrl0 = Module(new TensorPadCtrl(padType = "XPad0", sizeFactor))
val xPadCtrl1 = Module(new TensorPadCtrl(padType = "XPad1", sizeFactor))

val tag = Reg(UInt(8.W))
val set = Reg(UInt(8.W))
val tag = Reg(UInt(log2Ceil(tp.numMemBlock).W))
val set = Reg(UInt(log2Ceil(tp.tensorLength).W))

val sIdle :: sYPad0 :: sXPad0 :: sReadCmd :: sReadData :: sXPad1 :: sYPad1 :: Nil = Enum(7)
val state = RegInit(sIdle)
Expand Down Expand Up @@ -193,7 +193,7 @@ class TensorLoad(tensorType: String = "none", debug: Boolean = false)
tag := tag + 1.U
}

when (state === sIdle || state === sReadCmd || (set === (tp.tensorLength - 1).U && tag === (tp.numMemBlock - 1).U)) {
when (state === sIdle || dataCtrlDone || (set === (tp.tensorLength - 1).U && tag === (tp.numMemBlock - 1).U)) {
set := 0.U
} .elsewhen ((io.vme_rd.data.fire() || isZeroPad) && tag === (tp.numMemBlock - 1).U) {
set := set + 1.U
Expand Down

0 comments on commit 347e3d9

Please sign in to comment.