scoreboard.c
void scoreboard_performOper(stScoreboardCPU* a_pThis, stFunctionalUnit* pFU) {
	switch (pFU->m_op) {
		case OPCODE_LD: pFU->tempRegister = scoreboard_convertIntToFloat(a_pThis->pMemory[pFU->tempImmidiate]); /* Convert int to Single-precision floating-point format */
				break;
		case OPCODE_ST: a_pThis->pMemory[pFU->tempImmidiate] = scoreboard_convertFloatToInt(a_pThis->Register[pFU->Fk]); /* Convert Single-precision floating-point format to int */
				break;
		case OPCODE_ADD:pFU->tempRegister = a_pThis->Register[pFU->Fj] + a_pThis->Register[pFU->Fk];
				break;
		case OPCODE_SUB:pFU->tempRegister = a_pThis->Register[pFU->Fj] - a_pThis->Register[pFU->Fk];
				break;
		case OPCODE_MULT:pFU->tempRegister = a_pThis->Register[pFU->Fj] * a_pThis->Register[pFU->Fk];
				break;
		case OPCODE_DIV:pFU->tempRegister = a_pThis->Register[pFU->Fj] / a_pThis->Register[pFU->Fk];
				break;
		default:
			break;
	}
}
/* This function performs the operation of the Functional unit */
This function performs the operation of the Functional unit
This function performs the operation of the Functional unit
void scoreboard_performOper(stScoreboardCPU* a_pThis, stFunctionalUnit* pFU) {
	switch (pFU->m_op) {
		case OPCODE_LD: pFU->tempRegister = scoreboard_convertIntToFloat(a_pThis->pMemory[pFU->tempImmidiate]); 
				break;
		case OPCODE_ST: a_pThis->pMemory[pFU->tempImmidiate] = scoreboard_convertFloatToInt(a_pThis->Register[pFU->Fk]); 
				break;
		case OPCODE_ADD:pFU->tempRegister = a_pThis->Register[pFU->Fj] + a_pThis->Register[pFU->Fk];
				break;
		case OPCODE_SUB:pFU->tempRegister = a_pThis->Register[pFU->Fj] - a_pThis->Register[pFU->Fk];
				break;
		case OPCODE_MULT:pFU->tempRegister = a_pThis->Register[pFU->Fj] * a_pThis->Register[pFU->Fk];
				break;
		case OPCODE_DIV:pFU->tempRegister = a_pThis->Register[pFU->Fj] / a_pThis->Register[pFU->Fk];
				break;
		default:
			break;
	}
}
void scoreboard_performOper ( stScoreboardCPU * a_pThis , stFunctionalUnit * pFU ) { switch ( pFU -> m_op ) { case OPCODE_LD : pFU -> tempRegister = scoreboard_convertIntToFloat ( a_pThis -> pMemory [ pFU -> tempImmidiate ] ) ; break ; case OPCODE_ST : a_pThis -> pMemory [ pFU -> tempImmidiate ] = scoreboard_convertFloatToInt ( a_pThis -> Register [ pFU -> Fk ] ) ; break ; case OPCODE_ADD : pFU -> tempRegister = a_pThis -> Register [ pFU -> Fj ] + a_pThis -> Register [ pFU -> Fk ] ; break ; case OPCODE_SUB : pFU -> tempRegister = a_pThis -> Register [ pFU -> Fj ] - a_pThis -> Register [ pFU -> Fk ] ; break ; case OPCODE_MULT : pFU -> tempRegister = a_pThis -> Register [ pFU -> Fj ] * a_pThis -> Register [ pFU -> Fk ] ; break ; case OPCODE_DIV : pFU -> tempRegister = a_pThis -> Register [ pFU -> Fj ] / a_pThis -> Register [ pFU -> Fk ] ; break ; default : break ; } }
This function performs the operation of the Functional unit
This function performs the operation of the Functional unit
/* Convert int to Single-precision floating-point format */ /* Convert Single-precision floating-point format to int */