Methods and systems for inter-pipeline data hazard avoidance
Abstract
Methods and parallel processing units for avoiding inter-pipeline data hazards identified at compile time. For each identified inter-pipeline data hazard the primary instruction and secondary instruction(s) thereof are identified as such and are linked by a counter which is used to track that inter-pipeline data hazard. When a primary instruction is output by the instruction decoder for execution the value of the counter associated therewith is adjusted to indicate that there is hazard related to the primary instruction, and when primary instruction has been resolved by one of multiple parallel processing pipelines the value of the counter associated therewith is adjusted to indicate that the hazard related to the primary instruction has been resolved. When a secondary instruction is output by the decoder for execution, the secondary instruction is stalled in a queue associated with the appropriate instruction pipeline if at least one counter associated with the primary instructions from which it depends indicates that there is a hazard related to the primary instruction.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 29 · Forward citations: 0.
Claims (8 — 1 Independent, 7 Dependent)
- Claim 1Independent Claim
A method of processing instructions in a parallel processing unit comprising a plurality of instruction pipelines, the method comprising: tracking data hazards using a plurality of counters, the plurality of counters comprising a first set of counters associated with high latency data hazards and a second set of counters associated with low latency data hazards; receiving an instruction for execution that indicates (i) whether the instruction is a secondary instruction that depends on at least one primary instruction, and (ii) if the instruction is a secondary instruction, a counter of the plurality of counters associated with each primary instruction from which the instruction depends; determining whether the instruction is a secondary instruction; in response to determining that the instruction is a secondary instruction, analysing the counter associated with each primary instruction from which the instruction depends to determine whether the instruction relates to at least one high
- Claim 2Depends on #1
The method of claim 1, wherein the instruction further indicates (a) whether the instruction is a primary instruction from which at least one other instruction is dependent, and (b) if the instruction is a primary instruction, a counter of the plurality of counters associated with the primary instruction, and the method further comprising: prior to forwarding the instruction to the queue preceding the appropriate instruction pipeline, determining whether the instruction is a primary instruction; and in response to determining that the instruction is a primary instruction, causing the counter associated with the primary instruction to be adjusted to indicate that there is a hazard for that primary instruction.
- Claim 3Depends on #2
The method of claim 2, further comprising, in response to determining that the hazard for a primary instruction has been resolved, causing the counter associated with the primary instruction to be adjusted to indicate that the hazard for the primary instruction has been resolved.
- Claim 4Depends on #2
The method of claim 2, further comprising, in response to determining that the instruction is a primary instruction, determining whether a wait counter corresponding to the counter associated with the primary instruction indicates that there is at least one secondary instruction waiting on results of that counter; only causing the counter associated with the primary instruction to be adjusted to indicate that there is a hazard for the primary instruction and forwarding the instruction to the queue, in response to determining that the wait counter corresponding to the counter associated with the primary instruction indicates that there are no secondary instructions waiting on the results of that counter; in response to determining that the wait counter corresponding to the counter associated with the primary instruction indicates that there is at least one secondary instruction waiting on the results of the counter, causing the instruction to be de-scheduled until the wait counter corre
- Claim 5Depends on #1
The method of claim 1, wherein the instruction further indicates (a) whether the instruction is a primary instruction from which at least one other instruction is dependent, and (b) if the instruction is a primary instruction, a counter of the plurality of counters associated with the primary instruction, and the method further comprising: in response to determining that the instruction is not a secondary instruction, determining whether the instruction is a primary instruction; and in response to determining that the instruction is a primary instruction, causing the counter associated with the primary instruction to be adjusted to indicate that there is a hazard for that primary instruction and forwarding the instruction to the queue preceding the appropriate instruction pipeline.
- Claim 6Depends on #1
The method of claim 1, wherein the instruction comprises a secondary instruction field that indicates (i) whether the instruction is a secondary instruction and (ii) if the instruction is a secondary instruction, the counter of the plurality of counters associated with each primary instructions from which the instruction depends.
- Claim 7Depends on #6
The method of claim 6, wherein the secondary instruction field is configured to hold a bit mask, wherein each bit of the bit mask corresponds to a counter of the plurality of counters and when a bit of the bit mask is set, that bit indicates that the instruction is a secondary instruction that is dependent on the primary instruction associated with the corresponding counter.
- Claim 8Depends on #6
The method of claim 6, wherein the received instruction has been generated by a complier configured to identify data hazards within a set of related instructions, allocate a counter to each identified data hazard, and generate computer executable instructions that include secondary instruction fields that are configured based on the identifications and counter allocations.
Technical Overview & Description
CROSS-REFERENCE TO RELATED APPLICATIONS AND CLAIM OF PRIORITY This application is a continuation under 35 U.S.C. 120 of copending application Ser. No. 18/220,048 filed Jul. 10, 2023, now U.S. Pat. No. 11,900,122, which is a continuation of prior application Ser. No. 17/523,633 filed Nov. 10, 2021, now U.S. Pat. No. 11,698,790, which is a continuation of prior application Ser. No. 17/070,316 filed Oct. 14, 2020, now U.S. Pat. No. 11,200,064, which is a continuation of prior application Ser. No. 16/009,358 filed Jun. 15, 2018, now U.S. Pat. No. 10,817,301, which claims foreign priority under 35 U.S.C. 119 from United Kingdom Application Nos. 1709598.5 filed Jun. 16, 2017, and 1720408.2 filed Dec. 7, 2017, the contents of which are incorporated herein by reference in their entirety. BACKGROUND OF THE INVENTION As is known to those of skill in the art, a data hazard is created in a processing unit with an instruction pipeline when the pipelining of instructions changes the order of read and write accesses to instruction operands so that the order differs from the order that would occur from sequentially executing the instructions one-by-one. There are three classes of data hazards: read after write (RAW); write after read (WAR); and write after write (WAW) — which are named after the ordering in the program that must be preserved by the pipeline. A RAW data hazard is the most common type of data hazard and occurs when a later instruction (with respect to the order of the instructions in the program) tries to read a source operand before an earlier instruction writes to that source operand. This results in the later instruction getting the old value of the operand. For example, if there is the following set of instructions: R 1 = R 2 + R 3 R 4 = R 1 - R 5 wherein the first instruction causes the sum of the values of register 2 (R 2 ) and register 3 (R 3 ) to be stored in register 1 (R
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (29)
Non-Patent Literature (10)
- Lee et al.,
- “
- Dynamically Scheduling VLIW Instructions with Dependency Information,
- ”
- Proceedings of the Sixth Annual Workshop on Interaction between Compilers and Computer Architectures, IEEE 2002, pp. 15-23.
- “
- Register Dataflow,
- ”
- Superscalar Microprocessor Design, Jan. 1, 1991, pp. 103-126.
- *(Note: NPL in parent app'n).