IP Library Granted Patent US 7,096,348
Granted Patent B2
US 7,096,348 · App. 10/736,393 · Granted Aug 22, 2006

Method and apparatus for allocating entries in a branch target buffer

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,096,348
App. No.
10/736,393
Granted
Aug 22, 2006
Kind
B2
Abstract

A method ( 200 ) and apparatus ( 100 ) for allocating entries in a branch target buffer (BTB) ( 144 ) in a pipelined data processing system includes: sequentially fetching instructions; determining that one of the instructions is a branch instruction ( 210, 215, 220 ); decoding the branch instruction to determine a branch target address; determining if the branch target address can be obtained without causing a stall condition in the pipelined data processing system; and selectively allocating an entry of the BTB ( 144 ) based on the determination. In one embodiment, an entry of the BTB ( 144 ) is allocated if the branch instruction is not loaded into a predetermined slot (S 1 ) of a prefetch buffer ( 102 ) and no other stall condition will occur. The method ( 200 ) and apparatus ( 100 ) combine the advantages of using a BTB ( 144 ) and branch lookahead to reduce stall conditions in the data processing system.

Claims (42)

1. A method for allocating entries in a branch target buffer (BTB) in a pipelined data processing system, comprising:

fetching instructions from a plurality of instructions;

determining that one of the plurality of instructions is a branch instruction;

decoding the branch instruction to determine a branch target address;

determining that the branch instruction was not loaded into a predetermined slot of a prefetch buffer and no other stall condition will occur;

selectively allocating a BTB entry based on the determination; and

loading a branch target address corresponding to the branch instruction into a predetermined entry of the BTB.

2. The method of claim 1 wherein determining if the branch target address location can be obtained further comprises examining a predetermined slot of a prefetch buffer having a plurality of slots to identify the branch instruction.

3. The method of claim 2 further comprising loading a branch target address corresponding to the branch instruction into a predetermined entry of the BTB.

4. The method of claim 2 wherein the predetermined slot of the prefetch buffer is characterized as being a first slot.

5. The method of claim 1 further comprising:

determining that a stall condition exists in the data processing system;

determining that a BTB entry will not be allocated because of the stall condition; and

waiting for the branch instruction to be fetched from a memory location.

6. The method of claim 1 further comprising using a first-in, first-out replacement algorithm to load the BTB.

7. A method for allocating entries in a branch target buffer (BTB) in a pipelined data processing system, comprising:

fetching instructions from a plurality of instructions;

determining that one of the plurality of instructions is a branch instruction;

decoding the branch instruction to determine a branch target address;

determining that the branch instruction was not loaded into a predetermined slot of a prefetch buffer and no other stall condition will occur; and

selectively allocating a BTB entry based on the determination.

8. The method of claim 7 further comprising loading a branch target address corresponding to the branch instruction into a predetermined entry of the BTB.

9. The method of claim 7 wherein the predetermined slot of the prefetch buffer is characterized as being a first slot.

10. The method of claim 7 wherein determining further comprises:

examining a predetermined slot of a prefetch buffer having a plurality of slots to identify the branch instruction; and

calculating the branch target address using a program counter value and a displacement field value of the branch instruction.

11. The method of claim 10 further comprising using the branch target address in the BTB entry to prefetch a target instruction.

12. The method of claim 7 further comprising using a first-in, first-out replacement algorithm to load the BTB.

13. A data processing system comprising:

a prefetch buffer having a plurality of slots for storing instructions;

a branch target buffer (BTB) having a plurality of entries;

a control logic unit coupled to the prefetch buffer and to the BTB, wherein the control logic unit causes an entry of the plurality of entries of the BTB to be allocated to receive a branch target address of a branch instruction if the branch instruction is not detected in a predetermined slot of the plurality of slots of the prefetch buffer.

14. The data processing system of claim 13 , wherein the predetermined slot of the plurality of slots is characterized as being a first slot having an output coupled to an input of an instruction register.

15. The data processing system of claim 13 , wherein a first-in, first-out replacement algorithm is used to load the BTB.

16. The data processing system of claim 13 , further comprising a multiplexer having a plurality of inputs, an input of the plurality of inputs coupled to one of the plurality of entries of the BTB, and an output for providing a selected one of plurality of entries in response to a control signal.

17. The data processing system of claim 16 , further comprising a comparator having a first input for receiving an address, a second input coupled to each of the plurality of entries of the BTB, and an output for providing the control signal to the multiplexer.

18. The data processing system of claim 13 , further comprising:

a program counter; and

a branch address calculator for calculating a branch target address of the branch instruction using a value from the program counter and a displacement field of the branch instruction.

19. The data processing system of claim 13 , wherein the data processing system is a pipelined data processing system implemented on a single integrated circuit.

20. The data processing system of claim 13 , wherein each entry of the plurality of entries of the BTB includes a first bit field for storing an address value related to the address of the branch instruction and a second bit field for storing a branch target address.

21. The data processing system of claim 13 , wherein the predetermined slot of the plurality of slots is characterized as being a second slot having an output coupled to a first slot characterized as not being coupled to an input of an instruction register.

Assignments (19)
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 11759915 AND REPLACE IT WITH APPLICATION 11759935 PREVIOUSLY RECORDED ON REEL 040925 FRAME 0001. ASSIGNOR(S) HEREBY CONFIRMS THE RELEASE OF SECURITY INTEREST. Recorded Feb 17, 2020
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP, B.V. F/K/A FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 052917/0001 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 11759915 AND REPLACE IT WITH APPLICATION 11759935 PREVIOUSLY RECORDED ON REEL 040928 FRAME 0001. ASSIGNOR(S) HEREBY CONFIRMS THE RELEASE OF SECURITY INTEREST. Recorded Jan 17, 2020
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP B.V.
Reel/Frame 052915/0001 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 11759915 AND REPLACE IT WITH APPLICATION 11759935 PREVIOUSLY RECORDED ON REEL 037486 FRAME 0517. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS. Recorded Dec 10, 2019
From: CITIBANK, N.A.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 053547/0421 →
CORRECTIVE ASSIGNMENT TO CORRECT THE TO CORRECT THE APPLICATION NO. FROM 13,883,290 TO 13,833,290 PREVIOUSLY RECORDED ON REEL 041703 FRAME 0536. ASSIGNOR(S) HEREBY CONFIRMS THE THE ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS.. Recorded Feb 20, 2019
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: SHENZHEN XINGUODU TECHNOLOGY CO., LTD.
Reel/Frame 048734/0001 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE PATENTS 8108266 AND 8062324 AND REPLACE THEM WITH 6108266 AND 8060324 PREVIOUSLY RECORDED ON REEL 037518 FRAME 0292. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS. Recorded Feb 1, 2017
From: CITIBANK, N.A.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 041703/0536 →
RELEASE OF SECURITY INTEREST Recorded Nov 7, 2016
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP B.V.
Reel/Frame 040928/0001 →
RELEASE OF SECURITY INTEREST Recorded Sep 21, 2016
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP, B.V., F/K/A FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 040925/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 4, 2016
From: FREESCALE SEMICONDUCTOR, INC.
To: NORTH STAR INNOVATIONS INC.
Reel/Frame 037694/0264 →
ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS Recorded Jan 13, 2016
From: CITIBANK, N.A.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 037518/0292 →
ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS Recorded Jan 12, 2016
From: CITIBANK, N.A.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 037486/0517 →
PATENT RELEASE Recorded Dec 21, 2015
From: CITIBANK, N.A., AS COLLATERAL AGENT
To: FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 037354/0225 →
PATENT RELEASE Recorded Dec 21, 2015
From: CITIBANK, N.A., AS COLLATERAL AGENT
To: FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 037356/0143 →
PATENT RELEASE Recorded Dec 21, 2015
From: CITIBANK, N.A., AS COLLATERAL AGENT
To: FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 037356/0553 →
SECURITY AGREEMENT Recorded Nov 6, 2013
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS NOTES COLLATERAL AGENT
Reel/Frame 031591/0266 →
SECURITY AGREEMENT Recorded Jun 18, 2013
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS NOTES COLLATERAL AGENT
Reel/Frame 030633/0424 →
SECURITY AGREEMENT Recorded May 13, 2010
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS COLLATERAL AGENT
Reel/Frame 024397/0001 →
SECURITY AGREEMENT Recorded Feb 2, 2007
From: FREESCALE SEMICONDUCTOR, INC.; FREESCALE ACQUISITION CORPORATION; FREESCALE ACQUISITION HOLDINGS CORP.; FREESCALE HOLDINGS (BERMUDA) III, LTD.
To: CITIBANK, N.A. AS COLLATERAL AGENT
Reel/Frame 018855/0129 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 7, 2004
From: MOTOROLA, INC
To: FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 015360/0718 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 15, 2003
From: MOYER, WILLIAM C.; SCOTT, JEFFREY W.
To: MOTOROLA, INC.
Reel/Frame 014809/0266 →