IP Library › Granted Patent US 6,965,983
Granted Patent B2
US 6,965,983 · App. 10/248,769 · Granted Nov 15, 2005

Simultaneously setting prefetch address and fetch address pipelined stages upon branch

Assignee: Faraday Technology Corp.
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 6,965,983
App. No.
10/248,769
Granted
Nov 15, 2005
Kind
B2
Abstract

A pipelined CPU includes a pre-fetch (PF) stage for performing branch prediction, and an instruction fetch (IF) stage for fetching instructions that are to be later processed by an execution (EX) stage. The PF stage has a PF address (PFA) register for storing the address of an instruction being processed by the PF stage, and the IF stage has an IF address (IFA) register for storing the address of an instruction to be fetched for later execution. The CPU also includes address register control (ARC) circuitry for setting the contents of the PFA and the IFA. The ARC accepts branch-prediction results from the PF stage to determine the subsequent contents of the PFA and the IFA. If the PF stage predicts a branch, then the ARC sets the next address of the PFA to be sequentially after a predicted branch address, and simultaneously sets the next address of the IFA to be the predicted branch address.

Claims (25)

1. A pipelined central processing unit (CPU) comprising:

a pre-fetch (PF) stage for performing branch prediction, the PF stage comprising a PF address (PFA) register for storing the address of an instruction being processed by the PF stage;

an instruction fetch (IF) stage for fetching instructions that are to be later processed by an execution (EX) stage, the IF stage comprising an IF address (IFA) register for storing the address of an instruction to be fetched for later execution, and accepting a branch prediction result from the PF stage; and

address register control (ARC) circuitry for setting the contents of the PFA and the IFA, the ARC utilizing the branch prediction result held in the IF stage to determine the contents of the PFA and the IFA;

wherein if the branch prediction result held in the IF stage predicts no branching, then the ARC sets a next address of the PFA to be sequentially after a current address of the PFA and a next address of the IFA to be the current address of the PFA, and if the branch prediction result held in the IF stage predicts a branch, then the ARC sets the next address of the PFA to be sequentially after a predicted branch address and simultaneously sets the next address of the IFA to be the predicted branch address.

2. The pipelined CPU of claim 1 wherein the ARC comprises masking circuitry for ignoring a branch prediction result from the PF stage when the branch prediction result held in the IF stage predicts a branch.

3. The pipelined CPU of claim 1 wherein the PF stage immediately precedes the IF stage, and the EX stage is subsequent the IF stage.

4. The pipelined CPU of claim 3 wherein the ARC further accepts a result from the EX stage to set the contents of the IFA and the PFA, wherein if the EX stage determines that an executed instruction has an incorrect branch-prediction result, the ARC sets the next address of the IFA to be sequentially after the executed instruction and simultaneously sets the next address of the PFA to sequentially after the next address of the IFA.

5. The pipelined CPU of claim 3 wherein the ARC further accepts a result from the EX stage to set the contents of the IFA and the PFA, wherein if the EX stage determines that an executed instruction has an incorrect branch-prediction result, the ARC sets the next address of the IFA to a target instruction address as determined by the EX stage, and simultaneously sets the next address of the PFA to sequentially after the next address of the IFA.

6. The pipelined CPU of claim 4 wherein the ARC comprises masking circuitry for ignoring a branch prediction result from the PF stage when the EX stage contains an executed instruction having an incorrect branch-prediction result.

7. A method for pipelining instructions in a central processing unit (CPU), the method comprising:

providing a pre-fetch (PF) stage for performing branch prediction of an instruction pointed to by a pre-fetch address (PFA) register;

providing an instruction fetch (IF) stage for fetching an instruction pointed to by an instruction fetch address (IFA) register that is to be later executed by an execution (EX) stage;

providing a branch prediction result obtained by the PF stage to the IF stage;

setting a next address of the PFA register to be sequentially after a current address of the PFA register, and setting a next address of the IFA register to be the current address of the PFA register, if the branch prediction result predicts no branching; and

setting the next address of the PFA register to be sequentially after a predicted branch address, and simultaneously setting the next address of the IFA register to be the predicted branch address, if the branch prediction result predicts a branch.

8. The method of claim 7 further comprising ignoring a current branch prediction result from the PF stage when the previous branch prediction result predicts a branch.

9. The method of claim 7 wherein the PF stage immediately precedes the IF stage, and the EX stage is subsequent the IF stage.

10. The method of claim 9 further comprising:

if the EX stage determines that an executed instruction at a first address was incorrectly branch-predicted, setting the next address of the IFA register to a second address that is sequentially alter the first address, and simultaneously setting the next address of the PFA register to a third address that is sequentially after the second address.

11. The method claim 10 further comprising ignoring a current branch prediction result from the PF stage when the EX stage determines that the executed instruction at the first address was incorrectly branch-predicted.

12. The method of claim 9 further comprising:

if the EX stage determines that an executed instruction at a first address was incorrectly branch-predicted, setting the next address of the IFA register to a second address that is a target address as determined by the EX stage, and simultaneously setting the next address of the PFA register to a third address that is sequentially after the second address.

13. The method claim 12 further comprising ignoring a current branch prediction result from the PF stage when the EX stage determines that the executed instruction at the first address was incorrectly branch-predicted.

14. An electronic circuit for implementing the method of claim 7 .

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 5, 2017
From: FARADAY TECHNOLOGY CORP.
To: NOVATEK MICROELECTRONICS CORP.
Reel/Frame 041174/0755 →
CORRECTIVE ASSIGNMENT TO CORRECT THE NAME OF THE ASSIGNEE FILED ON 02-16-03 ROCORDED ON REEL 013428 FRAME 0662. Recorded Mar 23, 2005
From: LIN, HUNG-YU
To: FARADAY TECHNOLOGY CORP.
Reel/Frame 015949/0102 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 16, 2003
From: LIN, HUNG-YU
To: FARADAY TECHNOLOGY GROP.
Reel/Frame 013428/0662 →
Continuity (1)
Related Publication 20040168042A1 · Aug 26, 2004