From 1ba5e7b8650c427017de8dbdcfbdd75c78a0e762 Mon Sep 17 00:00:00 2001 From: Yunsup Lee Date: Sun, 11 Mar 2012 21:38:47 -0700 Subject: [PATCH] changes to the vector exception interface --- rocket/src/main/scala/cpu.scala | 6 +- rocket/src/main/scala/ctrl.scala | 1 + rocket/src/main/scala/ctrl_vec.scala | 115 +++++++++++++-------------- 3 files changed, 62 insertions(+), 60 deletions(-) diff --git a/rocket/src/main/scala/cpu.scala b/rocket/src/main/scala/cpu.scala index 4ad88674..08ef77fa 100644 --- a/rocket/src/main/scala/cpu.scala +++ b/rocket/src/main/scala/cpu.scala @@ -193,9 +193,13 @@ class rocketProc(resetSignal: Bool = null) extends Component(resetSignal) ctrl.io.vec_iface.vpfximm2q_ready := vu.io.vec_pfximm2q.ready ctrl.io.vec_iface.vpfcntq_ready := vu.io.vec_pfcntq.ready + // user level vector command queue ready signals + ctrl.io.vec_iface.vcmdq_user_ready := vu.io.vec_cmdq_user_ready + ctrl.io.vec_iface.vximm1q_user_ready := vu.io.vec_ximm1q_user_ready + ctrl.io.vec_iface.vximm2q_user_ready := vu.io.vec_ximm2q_user_ready + // 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 diff --git a/rocket/src/main/scala/ctrl.scala b/rocket/src/main/scala/ctrl.scala index 4cd4e94a..49683f96 100644 --- a/rocket/src/main/scala/ctrl.scala +++ b/rocket/src/main/scala/ctrl.scala @@ -627,6 +627,7 @@ class rocketCtrl extends Component io.vec_dpath <> vec.io.dpath io.vec_iface <> vec.io.iface + vec.io.s := io.dpath.status(SR_S) vec.io.sr_ev := io.dpath.status(SR_EV) vec.io.exception := wb_reg_exception diff --git a/rocket/src/main/scala/ctrl_vec.scala b/rocket/src/main/scala/ctrl_vec.scala index 48ea0d60..20dfa34a 100644 --- a/rocket/src/main/scala/ctrl_vec.scala +++ b/rocket/src/main/scala/ctrl_vec.scala @@ -38,8 +38,10 @@ class ioCtrlVecInterface extends Bundle val vpfcntq_valid = Bool(OUTPUT) val vpfcntq_ready = Bool(INPUT) + val vcmdq_user_ready = Bool(INPUT) + val vximm1q_user_ready = Bool(INPUT) + val vximm2q_user_ready = Bool(INPUT) val vfence_ready = Bool(INPUT) - val vhold_ready = Bool(INPUT) val exception = Bool(OUTPUT) val exception_ack_valid = Bool(INPUT) @@ -50,6 +52,7 @@ class ioCtrlVec extends Bundle { val dpath = new ioCtrlDpathVec() val iface = new ioCtrlVecInterface() + val s = Bool(INPUT) val sr_ev = Bool(INPUT) val exception = Bool(INPUT) val replay = Bool(OUTPUT) @@ -76,59 +79,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,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,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,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,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,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,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,N), - FENCE_L_V-> List(Y,VCMD_F, VIMM_X, VIMM2_X, N,VEC_X, N,Y,N,N,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M_ALU, VIMM2_X, N,VEC_X, N,N,Y,N,N,N,Y,N,N,Y,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), + VENQCNT-> List(Y,VCMD_X, VIMM_X, VIMM2_X, N,VEC_X, N,N,N,N,Y,N,N,N,Y,Y,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), + VWAITKILL-> List(Y,VCMD_X, VIMM_X, VIMM2_X, N,VEC_X, 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 :: wb_vec_waithold :: Nil = veccs2 + val wb_vec_pfaq :: wb_vec_fence_cv :: wb_vec_waitxcpt :: Nil = veccs2 val valid_common = io.dpath.valid && io.sr_ev && wb_vec_val && !(wb_vec_appvlmask && io.dpath.appvl0) @@ -137,9 +140,9 @@ class rocketCtrlVec extends Component val wb_vec_pfximm2q_enq_mask_pfq = wb_vec_pfximm2q_enq && (!wb_vec_pfaq || io.dpath.pfq) val wb_vec_pfcntq_enq_mask_pfq = wb_vec_pfcntq_enq && (!wb_vec_pfaq || io.dpath.pfq) - val mask_wb_vec_cmdq_ready = !wb_vec_cmdq_enq || io.iface.vcmdq_ready - val mask_wb_vec_ximm1q_ready = !wb_vec_ximm1q_enq || io.iface.vximm1q_ready - val mask_wb_vec_ximm2q_ready = !wb_vec_ximm2q_enq || io.iface.vximm2q_ready + val mask_wb_vec_cmdq_ready = !wb_vec_cmdq_enq || io.s && io.iface.vcmdq_ready || !io.s && io.iface.vcmdq_user_ready + val mask_wb_vec_ximm1q_ready = !wb_vec_ximm1q_enq || io.s && io.iface.vximm1q_ready || !io.s && io.iface.vximm1q_user_ready + val mask_wb_vec_ximm2q_ready = !wb_vec_ximm2q_enq || io.s && io.iface.vximm2q_ready || !io.s && io.iface.vximm2q_user_ready val mask_wb_vec_cntq_ready = !wb_vec_cntq_enq || io.iface.vcntq_ready val mask_wb_vec_pfcmdq_ready = !wb_vec_pfcmdq_enq_mask_pfq || io.iface.vpfcmdq_ready val mask_wb_vec_pfximm1q_ready = !wb_vec_pfximm1q_enq_mask_pfq || io.iface.vpfximm1q_ready @@ -213,12 +216,6 @@ class rocketCtrlVec extends Component io.iface.exception := io.exception && io.sr_ev io.iface.exception_ack_ready := 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.stalld := reg_waitxcpt io.vfence_ready := !io.sr_ev || io.iface.vfence_ready }