← Back to Patent Explorer
US5511175A Expired / Lapsed US ⏱️ 0.0 years remaining

Method an apparatus for store-into-instruction-stream detection and maintaining branch prediction cache consistency

Assignee: Advanced Micro Devices Inc
•
Filing: 1994-10-20
•
Granted: 1996-04-23
•
Expires: 2014-10-20
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract The present invention provides for the updating of both the instructions in a branch prediction cache and instructions recently provided to an instruction pipeline from the cache when an instruction being executed attempts to change such instructions ("Store-Into-Instruction-Stream"). The branch prediction cache (BPC) includes a tag identifying the address of instructions causing a branch, a record of the target address which was branched to on the last occurrence of each branch instruction, and a copy of the first several instructions beginning at this target address. A separate instruction cache is provided for normal execution of instructions, and all of the instructions written into the branch prediction cache from the system bus must also be stored in the instruction cache. The instruction cache monitors the system bus for attempts to write to the address of an instruction contained in the instruction cache. Upon such a detection, that entry in the instruction cache is invalidated, and the corresponding entry in the branch prediction cache is invalidated. A subsequent attempt to use an instruction in the branch prediction cache which has been invalidated will detect that it is not valid, and will instead go to main memory to fetch the instruction, where it has been modified.

Inventors

  • 👤 John G. Favor
  • 👤 Korbin Van Dyke
  • 👤 David R. Stiles

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-11-05 09:10
CPC Classifications
G; G06; G06F; G06F9/00; G06F9/06; G06F9/30; G06F9/38; G06F9/3802; G06F9/3812; G06F9/3804; G06F9/3836; G06F9/3842; G06F9/3844; G06F9/3861; G06F9/3863

Claims Analysis

Total Claims: 15
Claim 1
Independent Claim 199 words
An apparatus for preventing malfunction of pipeline processing associated with a program that modifies an instruction queued for execution, said apparatus comprising: an instruction pipeline which performs overlapped processing of a plurality of executing instructions and aborts processing of selected ones Of said executing instructions; a prefetch buffer, when active said prefetch buffer holding a plurality of instructions queued for possible execution by said pipeline; an address storage holding a first address value that identifies a block of addressee including said plurality of instructions held in said prefetch buffer; a comparator having e first input coupled to receive said first address value from said address storage and a second input coupled to receive a second address value from said pipeline; and a control circuit coupled to said comparator and to said pipeline, said control circuit aborting further processing of said selected ones of said executing instructions when said program includes a store instruction and said pipeline generates said second address for said store instruction and said comparator detects that said second address value corresponds to said first address value, thereby restarting said pipeline when said program modifies an instruction in a block of instructions that includes said queued instructions.
Claim 2
Independent Claim 199 words
An apparatus for preventing malfunction of pipeline processing associated with a program that modifies an instruction queued for execution, said apparatus comprising: an instruction pipeline which performs overlapped processing of a plurality of executing instructions and aborts processing of selected ones Of said executing instructions; a prefetch buffer, when active said prefetch buffer holding a plurality of instructions queued for possible execution by said pipeline; an address storage holding a first address value that identifies a block of addressee including said plurality of instructions held in said prefetch buffer; a comparator having e first input coupled to receive said first address value from said address storage and a second input coupled to receive a second address value from said pipeline; and a control circuit coupled to said comparator and to said pipeline, said control circuit aborting further processing of said selected ones of said executing instructions when said program includes a store instruction and said pipeline generates said second address for said store instruction and said comparator detects that said second address value corresponds to said first address value, thereby restarting said pipeline when said program modifies an instruction in a block of instructions that includes said queued instructions.
Claim 3
Dependent Claim 54 words
The apparatus of claim 1 further comprising: a second profetch buffer, holding, when active, a plurality of instructions queued for possible execution by said pipeline; said address storage holding a third address value that identifies a second block of addressee including addressee corresponding to said plurality of instructions held in said second prefetch buffer.
Claim 4
Independent Claim 267 words
An apparatus comprising: a system bus; an instruction cache, coupled to said system bus, including, for each entry, an instruction address tag, instruction data, and an instruction cache entry validity bit for indicating whether an entry is valid; means for detecting when a store signal on said system bus matches an instruction address tag for an entry in said instruction cache; means for setting said instruction cache entry validity bit for an entry in said instruction cache to invalid when said means for detecting detects a store signal on said system bus which matches the instruction address tag for that entry; a randomly addressable branch prediction cache including, for each entry, a branch instruction address tag, a branch target address, branch target instruction data and a branch prediction cache entry validity bit; means for comparing an instruction address tag of an instruction cache entry to said branch prediction, cache branch target addresses; control means for writing target instructions into said branch prediction cache only if said instructions are also written into said instruction cache and for removing target instructions from said branch prediction cache whenever said instructions are removed from said instruction cache; and means for setting said branch prediction cache entry validity bit for a branch prediction cache entry to invalid when the branch target address matches the address of an instruction cache entry with said instruction cache entry validity bit in an invalid state; such that a store-into-instruction-stream will be detected by said instruction cache and will result in the invalidation of any corresponding entries in both said instruction cache and said branch prediction cache.
Claim 5
Independent Claim 267 words
An apparatus comprising: a system bus; an instruction cache, coupled to said system bus, including, for each entry, an instruction address tag, instruction data, and an instruction cache entry validity bit for indicating whether an entry is valid; means for detecting when a store signal on said system bus matches an instruction address tag for an entry in said instruction cache; means for setting said instruction cache entry validity bit for an entry in said instruction cache to invalid when said means for detecting detects a store signal on said system bus which matches the instruction address tag for that entry; a randomly addressable branch prediction cache including, for each entry, a branch instruction address tag, a branch target address, branch target instruction data and a branch prediction cache entry validity bit; means for comparing an instruction address tag of an instruction cache entry to said branch prediction, cache branch target addresses; control means for writing target instructions into said branch prediction cache only if said instructions are also written into said instruction cache and for removing target instructions from said branch prediction cache whenever said instructions are removed from said instruction cache; and means for setting said branch prediction cache entry validity bit for a branch prediction cache entry to invalid when the branch target address matches the address of an instruction cache entry with said instruction cache entry validity bit in an invalid state; such that a store-into-instruction-stream will be detected by said instruction cache and will result in the invalidation of any corresponding entries in both said instruction cache and said branch prediction cache.
Claim 6
Dependent Claim 87 words
The apparatus of claim 3 wherein said instruction cache further includes an attention bit for each entry and control means for setting said attention bit, said attention bit being set by said control means only when said entry is also written into said branch prediction cache, said control means causing said branch target addresses to be compared to said instruction cache entry address tags when said instruction cache entry has its instruction cache entry validity bit set to an invalid state and said attention bit is set.
Claim 7
Dependent Claim 19 words
The apparatus of claim 3 wherein said instruction cache is direct-mapped and said branch prediction cache is fully associative.
Claim 8
Dependent Claim 41 words
The apparatus of claim 5 further comprising means for comparing the index bits of an address for an instruction block being written into said instruction cache to said branch target addresses and invalidating any, branch prediction cache entry having a match.
Claim 9
Independent Claim 219 words
An apparatus for preventing malfunction of pipeline processing associated with a program that modifies an instruction queued for execution, said apparatus comprising: an instruction pipeline which performs overlapped processing of a plurality of executing instructions and aborts processing of selected ones of said executing instructions; a profetch buffer, when active said profetch buffer holding a plurality of instructions queued for possible execution by said pipeline; an address storage holding a first address value that identifies a block of addresses including said plurality of instructions held in said profetch buffer; a comparator having a first input coupled to receive said first address value from said address storage and a second input coupled to receive a second address value from said pipeline; and a control circuit coupled to said comparator and to said pipeline said control circuit aborting further processing of said selected ones of said executing instructions when said program includes a store instruction and said pipeline generates said second address for said store instruction and said comparator detects that said second address value corresponds to said first address value, thereby restarting said pipeline when said program modifies an instruction in a block of instructions that includes said queued instructions; wherein said block of instructions consists of 32 bytes and said address values each consist of at least 27 bit.
Claim 10
Independent Claim 219 words
An apparatus for preventing malfunction of pipeline processing associated with a program that modifies an instruction queued for execution, said apparatus comprising: an instruction pipeline which performs overlapped processing of a plurality of executing instructions and aborts processing of selected ones of said executing instructions; a profetch buffer, when active said profetch buffer holding a plurality of instructions queued for possible execution by said pipeline; an address storage holding a first address value that identifies a block of addresses including said plurality of instructions held in said profetch buffer; a comparator having a first input coupled to receive said first address value from said address storage and a second input coupled to receive a second address value from said pipeline; and a control circuit coupled to said comparator and to said pipeline said control circuit aborting further processing of said selected ones of said executing instructions when said program includes a store instruction and said pipeline generates said second address for said store instruction and said comparator detects that said second address value corresponds to said first address value, thereby restarting said pipeline when said program modifies an instruction in a block of instructions that includes said queued instructions; wherein said block of instructions consists of 32 bytes and said address values each consist of at least 27 bit.
Claim 11
Dependent Claim 16 words
The apparatus of claim 7 wherein said pro-fetch buffer is located in a branch prediction cache.
Claim 12
Dependent Claim 16 words
The apparatus of claim 7 further comprising validity bits for said instructions in said pre-fetch buffer.
Claim 13
Independent Claim 178 words
An apparatus comprising: an instruction pipeline for overlapping execution of a plurality of sequential instructions; a pre-fetch queue for holding a plurality of instructions to be executed; means for detecting a store to an address for a given instruction in said pre-fetch queue and generating a store-into-instruction-stream signal; control means for flushing and restarting said instruction pipeline when said store-into-instruction-stream signal is detected from at least said given instruction onward; an instruction cache holding a plurality of instruction entries, each instruction entry having an instruction address tag, instruction data and an entry validity bit for indicating whether a corresponding instruction is valid; means for setting said entry validity bit to invalid when a store is detected to an address matching the instruction address tag; and a branch prediction cache holding a plurality of branch instruction addresses, wherein said branch prediction cache includes a branch validity bit for each of said branch instruction addresses, and further comprising means for setting said branch validity bit to invalid when a store is detected to an address matching the branch instruction address.
Claim 14
Independent Claim 178 words
An apparatus comprising: an instruction pipeline for overlapping execution of a plurality of sequential instructions; a pre-fetch queue for holding a plurality of instructions to be executed; means for detecting a store to an address for a given instruction in said pre-fetch queue and generating a store-into-instruction-stream signal; control means for flushing and restarting said instruction pipeline when said store-into-instruction-stream signal is detected from at least said given instruction onward; an instruction cache holding a plurality of instruction entries, each instruction entry having an instruction address tag, instruction data and an entry validity bit for indicating whether a corresponding instruction is valid; means for setting said entry validity bit to invalid when a store is detected to an address matching the instruction address tag; and a branch prediction cache holding a plurality of branch instruction addresses, wherein said branch prediction cache includes a branch validity bit for each of said branch instruction addresses, and further comprising means for setting said branch validity bit to invalid when a store is detected to an address matching the branch instruction address.
Claim 15
Dependent Claim 16 words
The apparatus of claim 1 wherein said pre-fetch buffer is located in a branch prediction cache.

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 1999-04-23 1999-10-23 2000-04-23 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2003-04-23 2003-10-23 2004-04-23 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2007-04-23 2007-10-23 2008-04-23 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag