Claims
- 1. A write queue for improving the efficiency of a branch target address cache (BTAC) in a microprocessor, the write queue comprising:
a request input, for receiving a request to update the BTAC, said request including a branch instruction target address; a plurality of storage elements, for storing said requests received on said request input; and control logic, coupled to said plurality of storage elements, for writing one of said requests stored in said plurality of storage elements to the BTAC in response to one or more predetermined conditions.
- 2. The write queue of claim 1, further comprising:
a cache idle input, coupled to said control logic, for specifying one of said one or more predetermined conditions in which the BTAC is not being read because an instruction cache accessed in parallel with the BTAC is idle.
- 3. The write queue of claim 1, further comprising:
an buffer full input, coupled to said control logic, for specifying one of said one or more predetermined conditions in which the BTAC is not being read because an instruction buffer is full, wherein said instruction buffer receives instructions from an instruction cache accessed in parallel with the BTAC.
- 4. The write queue of claim 1, further comprising:
a prediction override input, coupled to said control logic, for specifying one of said one or more predetermined conditions in which the BTAC is not being read because a first branch instruction prediction made by the BTAC is overridden by a second branch instruction prediction made by branch prediction logic in the microprocessor.
- 5. The write queue of claim 1, further comprising:
a branch misprediction input, coupled to said control logic, for specifying one of said one or more predetermined conditions in which the BTAC is not being read because a branch instruction misprediction made by the BTAC is detected.
- 6. The write queue of claim 1, further comprising:
a queue full signal, coupled to said control logic, for specifying one of said one or more predetermined conditions in which all of said plurality of storage elements are storing a request to be written to the BTAC.
- 7. The write queue of claim 1, further comprising:
a plurality of valid bits, coupled to said control logic, each for specifying whether said request stored in a corresponding one of said plurality of storage elements is valid.
- 8. The write queue of claim 1, wherein said request further includes a memory address of said branch instruction.
- 9. The write queue of claim 1, wherein the BTAC is an N-way set associative cache, wherein said request further includes information specifying which of said N ways in the BTAC said request is to be written into.
- 10. A microprocessor, comprising:
an instruction cache, for providing a cache line of instruction bytes in response to an instruction fetch address; a branch target address cache (BTAC), coupled to said instruction cache, for predicting a branch target address of a branch instruction stored in said cache line; and a write queue, coupled to said BTAC, for storing branch target addresses for updating said BTAC with.
- 11. The microprocessor of claim 10, wherein if said write queue is non-empty, said write queue updates said BTAC with one of said branch target addresses if said instruction cache is idle.
- 12. The microprocessor of claim 10, further comprising:
an instruction buffer, coupled to said instruction cache, for storing zero or more cache lines received from said instruction cache.
- 13. The microprocessor of claim 12, wherein if said write queue is non-empty, said write queue updates said BTAC with one of said branch target addresses if said instruction buffer indicates it is full.
- 14. The microprocessor of claim 10, further comprising:
branch prediction logic, coupled to said write queue, wherein subsequent to said BTAC making a first prediction of a branch instruction, said branch prediction logic makes a second prediction of said branch instruction, wherein the microprocessor overrides said first prediction with said second prediction.
- 15. The microprocessor of claim 14, wherein if said write queue is non-empty, said write queue updates said BTAC with one of said branch target addresses while the microprocessor overrides said first prediction with said second prediction.
- 16. The microprocessor of claim 10, further comprising:
branch resolution logic, coupled to said write queue, for correcting a misprediction of a branch instruction made by said BTAC.
- 17. The microprocessor of claim 16, wherein if said write queue is non-empty, said write queue updates said BTAC with one of said branch target addresses while the microprocessor corrects said misprediction of said branch instruction made by said BTAC.
- 18. The microprocessor of claim 10, wherein if said write queue becomes full, said write queue updates said BTAC with one of said branch target addresses.
- 19. The microprocessor of claim 10, wherein said BTAC generates a miss if read while said write queue is writing said BTAC.
- 20. The microprocessor of claim 10, wherein said BTAC comprises a single-ported memory array for storing a plurality of branch target addresses.
- 21. The microprocessor of claim 10, wherein said BTAC comprises a single-ported memory array for storing address tags of a plurality of branch instructions.
- 22. A method for updating a branch target address cache (BTAC) in a microprocessor, the method comprising:
generating a request to update the BTAC; storing the request in a queue; and updating the BTAC, subsequent to said storing, based on the request.
- 23. The method of claim 22, wherein said updating the BTAC is performed in a clock cycle of the microprocessor subsequent to said storing the request.
- 24. The method of claim 22, further comprising:
determining whether the BTAC is not being read; wherein said updating is,performed if the BTAC is not being read.
- 25. The method of claim 24, further comprising:
determining whether the BTAC is not being read because an instruction cache coupled to the BTAC is idle.
- 26. The method of claim 24, further comprising:
determining whether the BTAC is not being read because an instruction buffer is full, wherein the instruction buffer receives instructions from an instruction cache coupled to the BTAC.
- 27. The method of claim 22, further comprising:
determining whether a first branch instruction prediction made by the BTAC is overridden by a second branch instruction prediction made by other branch prediction logic in the microprocessor; wherein said updating is performed if the first branch instruction prediction made by the BTAC is overridden by the second branch instruction prediction.
- 28. The method of claim 22, further comprising:
determining whether the BTAC has made a branch instruction misprediction; wherein said updating is performed if the BTAC has made a branch instruction misprediction.
- 29. The method of claim 22, further comprising:
determining whether the queue is full; wherein said updating is performed if the queue is full.
- 30. A computer data signal embodied in a transmission medium, comprising:
computer-readable program code for providing a microprocessor, said program code comprising:
first program code for providing an instruction cache, for providing a cache line of instruction bytes in response to an instruction fetch address; second program code for providing a branch target address cache (BTAC), coupled to said instruction cache, for predicting a branch target address of a branch instruction stored in said cache line; and third program code for providing a write queue, coupled to said BTAC, for storing branch target addresses for updating said BTAC with.
PRIORITY INFORMATION
[0001] This application claims priority based on U.S. Provisional Application, Serial No. 60/440065, filed Jan. 14, 2003, entitled APPARATUS AND METHOD FOR EFFICIENTLY UPDATING BRANCH TARGET ADDRESS CACHE.
[0002] This application is related to co-pending U.S. Patent Applications entitled APPARATUS AND METHOD FOR INVALIDATION OF REDUNDANT BRANCH TARGET ADDRESS CACHE ENTRIES (docket cntr.2143) and APPARATUS AND METHOD FOR RESOLVING DEADLOCK FETCH CONDITIONS INVOLVING BRANCH TARGET ADDRESS CACHE (docket cntr.2144) and filed concurrently herewith.
Provisional Applications (1)
|
Number |
Date |
Country |
|
60440065 |
Jan 2003 |
US |