diff --git a/rocket/src/main/scala/ctrl_vec.scala b/rocket/src/main/scala/ctrl_vec.scala index a7526e14..e2d1f9d8 100644 --- a/rocket/src/main/scala/ctrl_vec.scala +++ b/rocket/src/main/scala/ctrl_vec.scala @@ -24,6 +24,14 @@ class ioCtrlVecInterface extends Bundle val vximm1q_ready = Bool(INPUT) val vximm2q_valid = Bool(OUTPUT) val vximm2q_ready = Bool(INPUT) + + val vpfcmdq_valid = Bool(OUTPUT) + val vpfcmdq_ready = Bool(INPUT) + val vpfximm1q_valid = Bool(OUTPUT) + val vpfximm1q_ready = Bool(INPUT) + val vpfximm2q_valid = Bool(OUTPUT) + val vpfximm2q_ready = Bool(INPUT) + val vackq_valid = Bool(INPUT) val vackq_ready = Bool(OUTPUT) } @@ -45,75 +53,111 @@ class rocketCtrlVec extends Component ListLookup(io.dpath.inst, // appvlmask // | vcmdq - // wen | | vximm1q - // val vcmd vimm | fn | | | vximm2q - // | | | | | | | | | cpfence - // | | | | | | | | | | - List(N,VCMD_X, VIMM_X, N,VEC_X ,N,N,N,N,N),Array( - VVCFGIVL-> List(Y,VCMD_I, VIMM_VLEN,Y,VEC_CFG,N,Y,Y,N,N), - VSETVL-> List(Y,VCMD_I, VIMM_VLEN,Y,VEC_VL ,N,Y,Y,N,N), - VF-> List(Y,VCMD_I, VIMM_ALU, N,VEC_X ,Y,Y,Y,N,N), - VMVV-> List(Y,VCMD_TX,VIMM_X, N,VEC_X ,Y,Y,N,N,N), - VMSV-> List(Y,VCMD_TX,VIMM_ALU, N,VEC_X ,Y,Y,Y,N,N), - VFMVV-> List(Y,VCMD_TF,VIMM_X, N,VEC_X ,Y,Y,N,N,N), - FENCE_L_V-> List(Y,VCMD_F, VIMM_X, N,VEC_X ,N,Y,N,N,N), - FENCE_G_V-> List(Y,VCMD_F, VIMM_X, N,VEC_X ,N,Y,N,N,N), - FENCE_L_CV->List(Y,VCMD_F, VIMM_X, N,VEC_X ,N,Y,N,N,Y), - FENCE_G_CV->List(Y,VCMD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IMM_ALU, N,VEC_X ,Y,Y,Y,Y,N), - VLSTB-> List(Y,VCMD_MX,VIMM_ALU, N,VEC_X ,Y,Y,Y,Y,N), - VLSTBU-> List(Y,VCMD_MX,VIMM_ALU, N,VEC_X ,Y,Y,Y,Y,N), - VSSTD-> List(Y,VCMD_MX,VIMM_ALU, N,VEC_X ,Y,Y,Y,Y,N), - VSSTW-> List(Y,VCMD_MX,VIMM_ALU, N,VEC_X ,Y,Y,Y,Y,N), - VSSTH-> List(Y,VCMD_MX,VIMM_ALU, N,VEC_X ,Y,Y,Y,Y,N), - VSSTB-> List(Y,VCMD_MX,VIMM_ALU, N,VEC_X ,Y,Y,Y,Y,N), - VFLSTD-> List(Y,VCMD_MF,VIMM_ALU, N,VEC_X ,Y,Y,Y,Y,N), - VFLSTW-> List(Y,VCMD_MF,VIMM_ALU, N,VEC_X ,Y,Y,Y,Y,N), - VFSSTD-> List(Y,VCMD_MF,VIMM_ALU, N,VEC_X ,Y,Y,Y,Y,N), - VFSSTW-> List(Y,VCMD_MF,VIMM_ALU, N,VEC_X ,Y,Y,Y,Y,N) + // | | vximm1q + // | | | vximm2q + // | | | | vpfcmdq + // wen | | | | | vpximm1q + // val vcmd vimm | fn | | | | | | vpximm2q + // | | | | | | | | | | | | cpfence + // | | | | | | | | | | | | | + List(N,VCMD_X, VIMM_X, N,VEC_X ,N,N,N,N,N,N,N,N),Array( + VVCFGIVL-> List(Y,VCMD_I, VIMM_VLEN,Y,VEC_CFG,N,Y,Y,N,N,N,N,N), + VSETVL-> List(Y,VCMD_I, VIMM_VLEN,Y,VEC_VL ,N,Y,Y,N,N,N,N,N), + VF-> List(Y,VCMD_I, VIMM_ALU, N,VEC_X ,Y,Y,Y,N,N,N,N,N), + VMVV-> List(Y,VCMD_TX,VIMM_X, N,VEC_X ,Y,Y,N,N,N,N,N,N), + VMSV-> List(Y,VCMD_TX,VIMM_ALU, N,VEC_X ,Y,Y,Y,N,N,N,N,N), + VFMVV-> List(Y,VCMD_TF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_X ,Y,Y,Y,Y,Y,Y,Y,N) )) val wb_vec_val :: wb_sel_vcmd :: wb_sel_vimm :: 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_cpfence :: Nil = veccs0 + val wb_vec_cmdq_enq :: wb_vec_ximm1q_enq :: wb_vec_ximm2q_enq :: veecs1 = veecs0 + val wb_vec_pfcmdq_enq :: wb_vec_pfximm1q_enq :: wb_vec_pfximm2q_enq :: wb_vec_cpfence :: Nil = veccs1 val valid_common = io.dpath.valid && io.sr_ev && wb_vec_val.toBool && !(wb_vec_appvlmask.toBool && io.dpath.appvl0) 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_pfcmdq_ready = !wb_vec_pfcmdq_enq || io.iface.vpfcmdq_ready + val mask_wb_vec_pfximm1q_ready = !wb_vec_pfximm1q_enq || io.iface.vpfximm1q_ready + val mask_wb_vec_pfximm2q_ready = !wb_vec_pfximm2q_enq || io.iface.vpfximm2q_ready io.dpath.wen := wb_vec_wen.toBool io.dpath.fn := wb_vec_fn io.dpath.sel_vcmd := wb_sel_vcmd io.dpath.sel_vimm := wb_sel_vimm - io.iface.vcmdq_valid := valid_common && wb_vec_cmdq_enq && mask_wb_vec_ximm1q_ready && mask_wb_vec_ximm2q_ready - io.iface.vximm1q_valid := valid_common && mask_wb_vec_cmdq_ready && wb_vec_ximm1q_enq && mask_wb_vec_ximm2q_ready - io.iface.vximm2q_valid := valid_common && mask_wb_vec_cmdq_ready && mask_wb_vec_ximm1q_ready && wb_vec_ximm2q_enq + io.iface.vcmdq_valid := + valid_common && + wb_vec_cmdq_enq && mask_wb_vec_ximm1q_ready && mask_wb_vec_ximm2q_ready && + mask_wb_vec_pfcmdq_enq && mask_wb_vec_pfximm1q_ready && mask_wb_vec_pfximm2q_ready + + io.iface.vximm1q_valid := + valid_common && + mask_wb_vec_cmdq_ready && wb_vec_ximm1q_enq && mask_wb_vec_ximm2q_ready && + mask_wb_vec_pfcmdq_enq && mask_wb_vec_pfximm1q_ready && mask_wb_vec_pfximm2q_ready + + io.iface.vximm2q_valid := + valid_common && + mask_wb_vec_cmdq_ready && mask_wb_vec_ximm1q_ready && wb_vec_ximm2q_enq && + mask_wb_vec_pfcmdq_enq && mask_wb_vec_pfximm1q_ready && mask_wb_vec_pfximm2q_ready + + io.iface.vpfcmdq_valid := + valid_common && + mask_wb_vec_cmdq_ready && mask_wb_vec_ximm1q_ready && mask_wb_vec_ximm2q_ready && + wb_vec_pfcmdq_enq && mask_wb_vec_pfximm1q_ready && mask_wb_vec_pfximm2q_ready + + io.iface.vpfximm1q_valid := + valid_common && + mask_wb_vec_cmdq_ready && mask_wb_vec_ximm1q_ready && mask_wb_vec_ximm2q_ready && + mask_wb_vec_pfcmdq_enq && wb_vec_pfximm1q_ready && mask_wb_vec_pfximm2q_ready + + io.iface.vpfximm2q_valid := + valid_common && + mask_wb_vec_cmdq_ready && mask_wb_vec_ximm1q_ready && mask_wb_vec_ximm2q_ready && + mask_wb_vec_pfcmdq_enq && mask_wb_vec_pfximm1q_ready && wb_vec_pfximm2q_ready io.replay := valid_common && ( wb_vec_cmdq_enq && !io.iface.vcmdq_ready || wb_vec_ximm1q_enq && !io.iface.vximm1q_ready || - wb_vec_ximm2q_enq && !io.iface.vximm2q_ready + wb_vec_ximm2q_enq && !io.iface.vximm2q_ready || + wb_vec_pfcmdq_enq && !io.iface.vpfcmdq_ready || + wb_vec_pfximm1q_enq && !io.iface.vpfximm1q_ready || + wb_vec_pfximm2q_enq && !io.iface.vpfximm2q_ready || ) io.cpfence := valid_common && wb_vec_cpfence && !io.replay }