scoreboard.c
void scoreboard_execution(stScoreboardCPU* a_pThis) {
	size_t i = 0;
	for (i=0; i<NUM_OF_REGISTERS; ++i) {
		if (a_pThis->registerResultStatus[i] != NULL) { /* Check for active FUs */
			int relatedPC = a_pThis->registerResultStatus[i]->relatedPC;
			if (a_pThis->instructionStatus[READ_REGISTERS_STAGE_IDX][relatedPC] != a_pThis->cycle) { /* Check that we are not executing in the same cycle as the read operands */
				if ((a_pThis->instructionStatus[READ_REGISTERS_STAGE_IDX][relatedPC] != 0) && a_pThis->registerResultStatus[i]->Busy && (a_pThis->registerResultStatus[i]->time_left != 0)) { /* Check the Execution conditions (and read operands stage is already done) */
					a_pThis->registerResultStatus[i]->time_left--;
					if (a_pThis->registerResultStatus[i]->time_left == 0) {
						a_pThis->instructionStatus[EXECUTE_END_STAGE_IDX][relatedPC] = a_pThis->cycle;
					}
				}
			}
		}
	}
}
/* This function performs the execution stage of the scorecoard.
 * This function is called until the execution is done */
This function performs the execution stage of the scorecoard.
This function is called until the execution is done
This function performs the execution stage of the scorecoard . This function is called until the execution is done
void scoreboard_execution(stScoreboardCPU* a_pThis) {
	size_t i = 0;
	for (i=0; i<NUM_OF_REGISTERS; ++i) {
		if (a_pThis->registerResultStatus[i] != NULL) { 
			int relatedPC = a_pThis->registerResultStatus[i]->relatedPC;
			if (a_pThis->instructionStatus[READ_REGISTERS_STAGE_IDX][relatedPC] != a_pThis->cycle) { 
				if ((a_pThis->instructionStatus[READ_REGISTERS_STAGE_IDX][relatedPC] != 0) && a_pThis->registerResultStatus[i]->Busy && (a_pThis->registerResultStatus[i]->time_left != 0)) { 
					a_pThis->registerResultStatus[i]->time_left--;
					if (a_pThis->registerResultStatus[i]->time_left == 0) {
						a_pThis->instructionStatus[EXECUTE_END_STAGE_IDX][relatedPC] = a_pThis->cycle;
					}
				}
			}
		}
	}
}
void scoreboard_execution ( stScoreboardCPU * a_pThis ) { size_t i = 0 ; for ( i = 0 ; i < NUM_OF_REGISTERS ; ++ i ) { if ( a_pThis -> registerResultStatus [ i ] != NULL ) { int relatedPC = a_pThis -> registerResultStatus [ i ] -> relatedPC ; if ( a_pThis -> instructionStatus [ READ_REGISTERS_STAGE_IDX ] [ relatedPC ] != a_pThis -> cycle ) { if ( ( a_pThis -> instructionStatus [ READ_REGISTERS_STAGE_IDX ] [ relatedPC ] != 0 ) && a_pThis -> registerResultStatus [ i ] -> Busy && ( a_pThis -> registerResultStatus [ i ] -> time_left != 0 ) ) { a_pThis -> registerResultStatus [ i ] -> time_left -- ; if ( a_pThis -> registerResultStatus [ i ] -> time_left == 0 ) { a_pThis -> instructionStatus [ EXECUTE_END_STAGE_IDX ] [ relatedPC ] = a_pThis -> cycle ; } } } } } }
This function performs the execution stage of the scorecoard.
This function performs the execution stage of the scorecoard .
/* Check for active FUs */ /* Check that we are not executing in the same cycle as the read operands */ /* Check the Execution conditions (and read operands stage is already done) */