1
0

add vector hold waits

This commit is contained in:
Yunsup Lee 2012-03-11 16:28:56 -07:00
parent e42a4c767e
commit 113a94a21d
2 changed files with 57 additions and 49 deletions

View File

@ -195,6 +195,7 @@ class rocketProc(resetSignal: Bool = null) extends Component(resetSignal)
// fences
ctrl.io.vec_iface.vfence_ready := vu.io.vec_fence_ready
ctrl.io.vec_iface.vhold_ready := vu.io.vec_hold_ready
// exceptions
vu.io.xcpt.exception := ctrl.io.vec_iface.exception

View File

@ -39,6 +39,7 @@ class ioCtrlVecInterface extends Bundle
val vpfcntq_ready = Bool(INPUT)
val vfence_ready = Bool(INPUT)
val vhold_ready = Bool(INPUT)
val exception = Bool(OUTPUT)
val exception_ack_valid = Bool(INPUT)
@ -75,59 +76,59 @@ class rocketCtrlVec extends Component
// val vcmd vimm vimm2 | fn | | | | | | | | | | fence_cv
// | | | | | | | | | | | | | | | | | waitxcpt
// | | | | | | | | | | | | | | | | | |
List(N,VCMD_X, VIMM_X, VIMM2_X, N,VEC_X, N,N,N,N,N,N,N,N,N,N,N,N),Array(
VVCFGIVL-> List(Y,VCMD_I, VIMM_VLEN,VIMM2_X, Y,VEC_CFG,N,Y,Y,N,N,Y,Y,N,N,N,N,N),
VSETVL-> List(Y,VCMD_I, VIMM_VLEN,VIMM2_X, Y,VEC_VL, N,Y,Y,N,N,Y,Y,N,N,N,N,N),
VF-> List(Y,VCMD_I, VIMM_ALU, VIMM2_X, N,VEC_X, Y,Y,Y,N,N,N,N,N,N,N,N,N),
VMVV-> List(Y,VCMD_TX,VIMM_X, VIMM2_X, N,VEC_X, Y,Y,N,N,N,N,N,N,N,N,N,N),
VMSV-> List(Y,VCMD_TX,VIMM_ALU, VIMM2_X, N,VEC_X, Y,Y,Y,N,N,N,N,N,N,N,N,N),
VFMVV-> List(Y,VCMD_TF,VIMM_X, VIMM2_X, N,VEC_X, Y,Y,N,N,N,N,N,N,N,N,N,N),
FENCE_L_V-> List(Y,VCMD_F, VIMM_X, VIMM2_X, N,VEC_X,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List(Y,VCMD_X, VIMM_ALU, VIMM2_X, N,VEC_X, N,N,Y,N,N,N,Y,N,N,Y,N,N,N),
VENQIMM2-> List(Y,VCMD_X, VIMM_X, VIMM2_X, N,VEC_X, N,N,N,Y,N,N,N,Y,N,Y,N,N,N),
VENQCNT-> List(Y,VCMD_X, VIMM_X, VIMM2_X, N,VEC_X, N,N,N,N,Y,N,N,N,Y,Y,N,N,N),
VWAITXCPT-> List(Y,VCMD_X, VIMM_X, VIMM2_X, N,VEC_X, N,N,N,N,N,N,N,N,N,N,N,Y,N),
VWAITKILL-> List(Y,VCMD_X, VIMM_X, VIMM2_X, N,VEC_X, N,N,N,N,N,N,N,N,N,N,N,N,Y)
))
val wb_vec_val :: wb_sel_vcmd :: wb_sel_vimm :: wb_sel_vimm2 :: wb_vec_wen :: wb_vec_fn :: wb_vec_appvlmask :: veccs0 = veccs
val wb_vec_cmdq_enq :: wb_vec_ximm1q_enq :: wb_vec_ximm2q_enq :: wb_vec_cntq_enq :: veccs1 = veccs0
val wb_vec_pfcmdq_enq :: wb_vec_pfximm1q_enq :: wb_vec_pfximm2q_enq :: wb_vec_pfcntq_enq :: veccs2 = veccs1
val wb_vec_pfaq :: wb_vec_fence_cv :: wb_vec_waitxcpt :: Nil = veccs2
val wb_vec_pfaq :: wb_vec_fence_cv :: wb_vec_waitxcpt :: wb_vec_waithold :: Nil = veccs2
val valid_common = io.dpath.valid && io.sr_ev && wb_vec_val && !(wb_vec_appvlmask && io.dpath.appvl0)
@ -212,6 +213,12 @@ class rocketCtrlVec extends Component
io.iface.exception := io.exception && io.sr_ev
io.iface.exception_ack_ready := reg_waitxcpt
io.stalld := reg_waitxcpt
val reg_waithold = Reg(resetVal = Bool(false))
val do_waithold = valid_common && wb_vec_waithold && !io.replay
when (do_waithold) { reg_waithold := Bool(true) }
when (io.iface.vhold_ready) { reg_waithold := Bool(false) }
io.stalld := reg_waitxcpt || reg_waithold
io.vfence_ready := !io.sr_ev || io.iface.vfence_ready
}