IP Library Granted Patent US 7,571,304
Granted Patent B2
US 7,571,304 · App. 11/084,655 · Granted Aug 4, 2009

Generation of multiple checkpoints in a processor that supports speculative execution

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,571,304
App. No.
11/084,655
Granted
Aug 4, 2009
Kind
B2
Abstract

One embodiment of the present invention provides a system which creates multiple checkpoints in a processor that supports speculative-execution. The system starts by issuing instructions for execution in program order during execution of a program in a normal-execution mode. Upon encountering a launch condition during an instruction which causes a processor to enter execute-ahead mode, the system performs an initial checkpoint and commences execution of instructions in execute-ahead mode. Upon encountering a predefined condition during execute-ahead mode, the system generates an additional checkpoint and continues to execute instructions in execute-ahead mode. Generating the additional checkpoint allows the processor to return to the additional checkpoint, instead of the previous checkpoint, if the processor subsequently encounters a condition that requires the processor to return to a checkpoint.

Claims (61)

1. A method for creating multiple checkpoints in a processor that supports speculative-execution, comprising:

issuing instructions for execution in program order during execution of a program in a normal-execution mode;

upon encountering a launch condition during an instruction which causes a processor to enter execute-ahead mode, performing an initial checkpoint and commencing execution of instructions in a execute-ahead mode, wherein instructions that cannot be executed because of the unresolved data dependency are deferred, and wherein other non-deferred instructions are executed in program order;

upon encountering a predefined condition during execute-ahead mode,

generating an additional checkpoint, and

continuing to execute instructions in execute-ahead mode,

wherein generating the additional checkpoint allows the processor to return to the additional checkpoint, instead of the previous checkpoint, if the processor subsequently encounters a condition that requires the processor to return to a checkpoint, thereby preventing the processor from having to re-execute instructions between the previous checkpoint and the additional checkpoint; and

upon encountering a non-data-dependent stall condition in normal-execution mode or in execute-ahead mode, commencing execution of instructions in scout-mode, wherein instructions are speculatively executed to prefetch future loads without committing the results of the instructions to the architectural state of the processor;

wherein the processor includes N copies of a register file, wherein each register has a HR pointer that indicates which copy of the register file contains the architecturally committed version of the register and an HW variable for each potential checkpoint, wherein the processor sets a corresponding HW variable when the register is speculatively written following the generation of a checkpoint;

wherein reading from a register in normal-execution mode, execute-ahead mode, or scout mode involves determining which register to read from by computing (HR+HW) % N, wherein HW is either zero or equal to a value of a checkpoint after which a most recently set HW variable was set for the register.

2. The method of claim 1 , wherein the number of copies N of the register file is equal to the number of checkpoints supported by the processor, plus one for the architecturally committed copy of the register file.

3. The method of claim 2 , wherein the HR pointer for each register may point at a different copy of the register file.

4. The method of claim 3 , wherein the processor maintains a state machine which holds an offset value specifying the number of checkpoints that have been generated, and wherein the offset value is zero during normal-execution mode.

5. The method of claim 4 , wherein when writing to a register, the processor locates the register within the copies of the register file using the HR pointer and the offset value.

6. The method of claim 4 , wherein generating a checkpoint involves:

storing the program counter;

advancing the state machine; and

tagging store buffer entries with pending stores with a checkpoint identifier which causes the processor to block global visibility of stores generated during speculative execution.

7. The method of claim 6 , wherein when the condition which caused the processor to take the checkpoint clears, the processor “joins” the results of the instructions executed in speculative-execution mode with the current architectural state of the processor by:

shifting the HR pointer for each register to point at the register file copy used during the checkpoint if the associated HW variable for that register is set;

unsetting the associated HW variables;

releasing the store buffer entries associated with this checkpoint to become globally visible; and

clearing the copy of the program counter associated with the checkpoint.

8. The method of claim 1 , wherein a predefined condition includes:

an independent load miss;

an unresolvable data dependent predicted branch;

a memory barrier or atomic instruction;

a write of a cache line based on a prediction of the proper write status;

a predetermined number of instructions passing in the speculative-execution mode; or

a condition which has a high probability of forcing the processor to return to a checkpoint.

9. An apparatus for creating multiple checkpoints in a processor that supports speculative-execution, comprising:

an execution mechanism within the processor;

wherein the execution mechanism is configured to issue instructions for execution in program order during execution of a program in a normal-execution mode;

upon encountering a launch condition during an instruction which causes a execution mechanism to enter execute-ahead mode, the execution mechanism is configured to perform an initial checkpoint and commence execution of instructions in a execute-ahead mode, wherein instructions that cannot be executed because of the unresolved data dependency are deferred, and wherein other non-deferred instructions are executed in program order;

upon encountering a predefined condition during execute-ahead mode, the execution mechanism is configured to

generate an additional checkpoint, and

continue to execute instructions in execute-ahead mode,

wherein generating the additional checkpoint allows the execution mechanism to return to the additional checkpoint, instead of the previous checkpoint, if the execution mechanism subsequently encounters a condition that requires the execution mechanism to return to a checkpoint, thereby preventing the execution mechanism from having to re-execute instructions between the previous checkpoint and the additional checkpoint; and

upon encountering a non-data-dependent stall condition in normal-execution mode or in execute-ahead mode, the execution mechanism is configured to commence execution of instructions in scout-mode, wherein instructions are speculatively executed to prefetch future loads without committing the results of the instructions to the architectural state of the processor;

wherein the processor includes N copies of a register file, wherein each register has a HR pointer that indicates which copy of the register file contains the architecturally committed version of the register and an HW variable for each potential checkpoint, wherein the processor sets a corresponding HW variable when the register is speculatively written following the generation of a checkpoint;

wherein when reading from a register in normal-execution mode, execute-ahead mode, or scout mode, the execution mechanism is configured to determine which register to read from by computing (HR+HW) % N, wherein HW is either zero or equal to a value of a checkpoint after which a most recently set HW variable was set for the register.

10. The apparatus of claim 9 , wherein the number of copies N of the register file is equal to the number of checkpoints supported by the execution mechanism, plus one for the architecturally committed copy of the register file.

11. The apparatus of claim 10 , wherein the HR pointer for each register may point at a different copy of the register file.

12. The apparatus of claim 11 , wherein the execution mechanism is configured to maintain a state machine which holds an offset value specifying the number of checkpoints that have been generated, and wherein the offset value is zero during normal-execution mode.

13. The apparatus of claim 12 , wherein when writing to a register the execution mechanism is configured to locate the register within the copies of the register file using the HR pointer and the offset value.

14. The apparatus of claim 12 , wherein the execution mechanism is configured to generate a checkpoint by:

storing the program counter;

advancing the state machine; and

tagging store buffer entries with pending stores with a checkpoint identifier which causes the execution mechanism to block global visibility of stores generated during speculative execution.

15. The apparatus of claim 14 , wherein when the condition which caused the execution mechanism to take the checkpoint clears, the execution mechanism is configured to “join” the results of the instructions executed in speculative-execution mode with current the architectural state of the execution mechanism by:

shifting the HR pointer for each register to point at the register file copy used during the checkpoint if the associated HW variable for that register is set;

unsetting the associated HW variables;

releasing the store buffer entries associated with this checkpoint to become globally visible; and

clearing the copy of the program counter associated with the checkpoint.

16. The apparatus of claim 9 , wherein the execution mechanism is configured so that a predefined condition includes:

an independent load miss;

an unresolvable data dependent predicted branch;

a memory barrier or atomic instruction;

a write of a cache line based on a prediction of the proper write status;

a predetermined number of instructions passing in the speculative-execution mode; or

a condition which has a high probability of forcing the processor to return to a checkpoint.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037304/0183 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 18, 2005
From: CHAUDHRY, SHAILENDER; TREMBLAY, MARC; CAPRIOLI, PAUL
To: SUN MICROSYSTEMS, INC.
Reel/Frame 016405/0348 →