/// <summary> /// Checks the Execution unit to see if it is finished, if so moves the instruction /// and clears the unit. /// </summary> /// <param name="unit"></param> /// <returns>True if the unit is finished, false otherwise</returns> private bool handleUnitCycle(ExecutionUnit unit) { // First make sure that there is an instruction in there if (unit.busy) { // Then run the cycle and see if it finishes if (unit.runCycle()) { // TODO: Move the Cycle / Update the RRF // The the reservation station entry should hold the RRF entry index so taht we know which one to update int rrfEntryIndex = CPU.rob.executionFinished(unit.entry); CPU.rrf.executionFinished(rrfEntryIndex); // Update the Reservation Stations updateReservationStation(rrfEntryIndex, CPU.issueStage.branchStation); updateReservationStation(rrfEntryIndex, CPU.issueStage.fpStation); updateReservationStation(rrfEntryIndex, CPU.issueStage.integerStation); updateReservationStation(rrfEntryIndex, CPU.issueStage.memStation); updateReservationStation(rrfEntryIndex, CPU.issueStage.multDivStation); // Tell Everyone that the reservation station entry is now available unit.entry.busy = false; return(true); } } return(false); }
/// <summary> /// Checks the Execution unit to see if it is finished, if so moves the instruction /// and clears the unit. /// </summary> /// <param name="unit"></param> /// <returns>True if the unit is finished, false otherwise</returns> private bool handleUnitCycle(ExecutionUnit unit) { // First make sure that there is an instruction in there if (unit.busy) { // Then run the cycle and see if it finishes if (unit.runCycle()) { // TODO: Move the Cycle / Update the RRF // The the reservation station entry should hold the RRF entry index so taht we know which one to update int rrfEntryIndex = CPU.rob.executionFinished(unit.entry); CPU.rrf.executionFinished(rrfEntryIndex); // Update the Reservation Stations updateReservationStation(rrfEntryIndex, CPU.issueStage.branchStation); updateReservationStation(rrfEntryIndex, CPU.issueStage.fpStation); updateReservationStation(rrfEntryIndex, CPU.issueStage.integerStation); updateReservationStation(rrfEntryIndex, CPU.issueStage.memStation); updateReservationStation(rrfEntryIndex, CPU.issueStage.multDivStation); // Tell Everyone that the reservation station entry is now available unit.entry.busy = false; return true; } } return false; }