// Function: executeStage // Description: E.icode is used as n index into the // funtionPtr[] array. // Params: none // Returns: nothing // Modifies: e_valE and e_CND void executeStage(forwardType * forward, statusType status) { //bools bool m_bubble = getmBubble(status); //decide if m_stat or W_stat depending on code unsigned int valE = functionPtr[E.icode](); int e_CND = computeCND(); unsigned int e_dstE = getEVdstE(e_CND); //forwarding forward->e_dstE = E.dstE; forward->e_valE = valE; if(m_bubble) { updateMregister(E.stat, NOP, FNONE, FNONE, FNONE, RNONE, RNONE); } /* updateMregister(E.stat, E.icode, 0, valE, E.valA, e_dstE, E.dstM); */ else { updateMregister(E.stat, E.icode, e_CND, valE, E.valA, e_dstE, E.dstM); } }
void executeStage(pipelineForward* forward, statusType stat, control* con) { // DR NORRIS SAID THIS IS OK unsigned int valE = executeAlu(stat); unsigned int Cnd = getCnd(); unsigned int dstE = getDstE(Cnd); forward->e_valE = valE; forward->e_dstE = dstE; con->E_icode = E.icode; con->E_dstM = E.dstM; con->e_Cnd = Cnd; // determines if the memory stage should be bubbled bool M_bubble = (stat.m_stat == SADR || stat.m_stat == SINS || stat.m_stat == SHLT) || (stat.W_stat == SADR || stat.W_stat == SINS || stat.W_stat == SHLT); if(M_bubble) { clearMregister(); } else { updateMregister(E.stat, E.icode, Cnd, valE, E.valA, dstE, E.dstM); } }
void executeStage(pipelineForward* forward, statusType stat) { // DR NORRIS SAID THIS IS OK unsigned int valE = executeAlu(stat); unsigned int Cnd = getCnd(); unsigned int dstE = getDstE(Cnd); forward->e_valE = valE; forward->e_dstE = dstE; bool M_bubble = (stat.m_stat == SADR || stat.m_stat == SINS || stat.m_stat == SHLT) || (stat.W_stat == SADR || stat.W_stat == SINS || stat.W_stat == SHLT); if(M_bubble) { clearMregister(); } else { updateMregister(E.stat, E.icode, Cnd, valE, E.valA, dstE, E.dstM); } }