搜尋 圖片 地圖 Play YouTube 新聞 Gmail 雲端硬碟 更多 »
進階專利搜尋 | 網頁紀錄 | 登入

專利

公開號US6272520 B1
出版類型授權
申請書編號09/001,545
發佈日期2001年8月7日
申請日期1997年12月31日
優先權日期1997年12月31日
公開號001545, 09001545, US 6272520 B1, US 6272520B1, US-B1-6272520, US6272520 B1, US6272520B1
發明人Harshvardhan Sharangpani, Rajiv Gupta, Judge K. Arora
原專利權人Intel Corporation, Hewlette Packard
外部連結: 美國專利商標局, 美國專利商標局專利轉讓訊息, 歐洲專利局
Method for detecting thread switch events
US 6272520 B1
摘要
A method for detecting thread switch conditions provides first and second scoreboard bits for each register in a register file. The first scoreboard bit associated with a register is set when a load is generated to return data to the register. The second scoreboard bit is set if the load misses in a selected processor cache. Register read instructions are monitored, and a thread switch condition is indicated when a register read instruction to the register is detected while its first and second scoreboard bits are set.
圖片(6)
Previous page
Next page
聲明
What is claimed is:
1. A method for detecting a thread switch condition on a multi-threaded processor, the method comprising:
setting a first bit associated with a register if data requested for the register is unavailable in a first cache;
setting a second bit associated with the register if a load to return the requested data misses in a second cache;
monitoring register read instructions; and
indicating a thread switch condition if an instruction attempts to read the register while the first and second bits are set.
2. The method of claim 1, further comprising seeking the requested data in the second cache if the data is unavailable in the first cache.
3. The method of claim 1, further comprising accessing the data from main memory if the load misses in the second cache.
4. A method for triggering thread switches in a multi-threaded processor, the method comprising:
generating a load to return data to a register;
setting a first scoreboard bit associated with the register if the data is unavailable in a low level cache;
generating a bus request to main memory and setting a second scoreboard bit if the data is unavailable in one or more higher level caches; and
indicating a thread switch operation if an instruction tries to read the register while the first and second scoreboard bits are set.
5. The method of claim 4, wherein generating a bus request and setting the second scoreboard bit further comprises:
identifying each register associated with the bus request when a corresponding load misses in the one or more higher level caches; and
setting the second scoreboard bit for each register associated with the bus request.
6. The method of claim 5, wherein indicating further comprises:
monitoring a register read queue; and
setting a thread switch signal when a register read targets a register having its first and second scoreboard bits set.
7. A system for processing multiple execution threads, the system comprising:
shadow register file, the shadow register file having multiple sets of registers for storing architectural state data for multiple threads;
a scoreboard that provides a first bit to indicate if data is available in a register of the register file and a second bit to indicate if a load that targets the data missed in a selected cache;
an execution pipeline;
a memory pipeline including one or more selected caches and a main memory to service loads from the execution pipeline; and
a thread switch system to monitor loads in the memory pipeline, to set the second bit responsive to a request that misses in the selected caches, and to trigger a thread switch operation if an instruction in the execution pipeline attempts to access the register while its first and second scoreboard bits are set.
8. The system of claim 7, wherein the thread switch system signals the shadow register file to access data from a different set of registers when a thread switch operation is triggered.
9. A system for detecting a thread switch condition on a multi-threaded processor, the method comprising:
tracking operations that return data to a register;
setting a scoreboard bit associated with the register if a tracked operation misses in a first cache;
setting a second bit associated with the register if a tracked operation misses in a second cache; and
indicating a thread switch condition when an instruction that reads the register is received while the first and second bits are set.
10. The method of claim 9, further comprising setting the first bit if a transcendental operation that returns data to the register is detected.
11. The method of claim 9, wherein the setting step comprises setting a scoreboard bit associated with the register when a load that returns data to the register misses in a selected processor cache.
12. The method of claim 9, further comprising setting the first bit if an interrupt time out is detected.
說明
BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to the processors, and in particular, to methods for implementing multithreading in processors.

2. Background Art

Modern high-performance processors are designed to execute a large number of instructions per clock, and to this end, they typically provide extensive execution resources. Additional execution resources are often provided on the processor to boost the absolute level of performance, even though the resources are not fully utilized across all the target applications of interest. Processor execution is often marred with stalls for instruction fetches, data cache misses, unresolved data-dependencies and branch latencies. On application workloads which stress the memory subsystem, the latency of delivering instructions and data from the next several levels of memory can be extremely high (100-200 clock cycles). This leads to long pipeline stalls, which leave execution resources on the chip under-utilized. For example, on contemporary processors, over 30% of the application time spent on OLTP-TPC-C (an on-line transaction processing benchmark) may be spent waiting for main memory to return instructions or data to the processor. This under-utilization of resources represents a loss in performance.

One proposed solution to exploit under-utilized resources enhances the processor to execute instructions from multiple process threads simultaneously. This solution is commonly referred to as multi-processors (MP)-on-a-chip or simultaneous multi-threading (SMT). In MP-on-a-chip, a single physical processor chip (“chip”) appears as if it contains two or more logical processors, each executing its own process. In the following discussion, a distinct process executing on a distinct logical processor is referred to as a thread. The chip hardware resources are assigned to a new thread when a currently executing thread stalls waiting for dependent operations. Simultaneous multi-threading processors can even schedule resource utilization at the single instruction slot level.

Another approach to increasing resource utilization implements a coarse grained form of multi-threading. Coarse grained multi-threading switches utilization of chip resources from the currently executing thread to a new thread when the currently executing thread initiates a long latency operation. This reduces the likelihood of long pipeline stalls by allowing the second thread to execute while the long latency operation of the first thread completes.

Switching processor resources from one thread to another incurs a performance penalty, since the current thread's instructions must be flushed or drained from the pipeline, the thread's architectural state must be preserved, the new logical processor must be activated, and instructions from the new thread must be provided to the processor's resources. These steps can take tens of clock cycles (typically 20-40 clock cycles) to complete. Coarse-grained multi-threading thus enhances performance only when threads are switched on operations that would otherwise stall the processor longer than the time required to switch the threads.

Various events have been proposed for triggering thread switches. For example, long latency load operations, such as loads that miss in various stages of a processor's caches, may be used to trigger thread switches. However, not all such loads actually stall the pipeline, and even those operations that do stall the pipeline may not stall it long enough to justify the delay incurred by the thread switch operation. If the thread switch condition is not selected carefully, unnecessary thread switches can reduce or eliminate any performance advantage provided by multi-threading.

Thus, there is a need for methods that can trigger thread switches to avoid long pipeline stalls without generating unnecessary thread switches and maximize the benefits of course grained multithreading.

SUMMARY OF THE INVENTION

The present invention is a method for detecting thread switch conditions that support the efficient implementation of coarse-grained multi-threading.

In accordance with the present invention, a load generated to return data to a register is tracked, and a bit associated with the register is set if the load misses in a selected processor cache. Register read instructions are monitored, and a thread switch condition is indicated when a register read instruction to the register is detected while the associated bit is set.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention may be understood with reference to the following drawings in which like elements are indicated by like numbers. These drawings are provided to illustrate selected embodiments of the present invention and are not intended to limit the scope of the invention.

FIG. 1 is a block diagram of a cache system, register file, and memory suitable for implementing the present invention.

FIG. 2 is a block diagram of register and execute stages of a processor pipeline that is suitable for implementing the present invention.

FIG. 3 is a flow chart of the method of the present invention.

FIG. 4 is a block diagram of one embodiment of a multi-threaded processor in which the present invention may be implemented.

FIG. 5 is a block diagram of one embodiment of a shadow register storage element that is suitable for use in the processor of FIG. 4.

DETAILED DISCUSSION OF THE INVENTION

The following discussion sets forth numerous specific details to provide a thorough understanding of the invention. However, those of ordinary skill in the art, having the benefit of this disclosure, will appreciate that the invention may be practiced without these specific details. In addition, various well known methods, procedures, components, and circuits have not been described in detail in order to focus attention on the features of the present invention.

Coarse grained multi-threading provides its greatest performance advantage when thread switches are triggered for those operations that would otherwise stall the processor's pipeline for an interval that is significantly longer than the time required to switch threads. An exemplary thread switching processes may require on the order of 30 cycles to flush or drain the instructions of the current thread from the pipeline, preserve the thread's architectural state information, and retrieve instructions from the newly scheduled thread. Swapping out a thread when it stalls the pipeline for, e.g., 50 cycles or when it launches a long latency operation that never stalls the pipeline generates unnecessary thread switches.

Operations that trigger thread switches (thread switch events) ideally reflect both the latency of the operation and the likelihood that the pipeline will stall waiting for the operation to complete. Load operations that return data from the memory subsystem (“loads”) have a range of latencies, depending on which part of the memory hierarchy provides the data. Loads that hit in the caches of a processor system typically take between 2 and 30 clock cycles to return data to the core pipeline. Loads that must access the data from main memory can have latencies on the order of 200 clock cycles. Distinguishing between loads that access different structures in the memory subsystem is a first step for identifying suitable thread switch events.

Processors typically support only limited tracking of load operations. For example, many processors include a scoreboard that tracks the availability of data in each register of a register file. Conventional scoreboards indicate if a particular register is waiting for data, but they do not indicate how long the wait is likely to be. Once the data request enters the memory subsystem, it is typically tracked by modules that do not communicate with the scoreboard or recognize which registers may be awaiting data targeted by the request.

In addition to the tracking problem, a long latency operation does not, by itself, mean that the pipeline will stall. Pipeline stalls only occur if the operation, e.g. load, does not return the requested data before the instruction that uses (consumes) the data issues. If the consuming instruction issues before the data is available, the pipeline stalls and remains stalled until the requested data is returned. For a load that hits in one of the processor's caches, the stall will typically be less than 30 clock cycles, since there is usually a delay of a couple of clock cycles between requesting the load and issuing the instruction that consumes the data provided by the load. The thread switch operation, which itself consumes 20 to 30 clock cycles, is not justified in these cases. On the other hand, load latencies of 200 clock cycles or more for accesses to main memory are more likely to stall the pipeline for significantly more than 30 clock cycles, since the instruction that consumes the data is likely to issue well within 200 clock cycles of the load. However, pipeline stalls are not guaranteed even in these cases. For example, the thread could enter a long loop before the consuming instruction issues. In the following discussion, “very long latency operations” refers to operations having latencies that are significantly longer than the latency of a particular thread switch operation. These are operations which, if they stall the pipeline, are likely to stall it long enough to justify a thread switch operation.

The present invention is a method for efficiently detecting very long latency pipeline stalls from among the many different types of operations that can lead to pipeline stalls. Data requests within the memory hierarchy are tracked and mapped back to the registers destined to received the requested data. A bit associated with a register is set when the mapping indicates that a request for data destined for the register misses in the processor's cache system. A thread switch condition is indicated if an issued instruction attempts to access data from a register for which the associated bit is set. Thread switches are thus initiated only for those loads that stall the pipeline and are likely to keep it stalled for periods in excess of the thread switch latency.

Referring now to FIG. 1, there is shown a block diagram of a cache system 100 suitable for detecting very long latency load operations. Also shown are a register file 160 and a main memory 180 that interact with cache system 100. In the disclosed embodiment, cache system 100 includes an L0 cache 110, an L1 cache 120, an L2 cache 130, and a cache management module 140. Cache management module 140 includes one or more buffer(s) 150 to track requests to caches 120, 130. In particular, buffer 150 stores information for mapping the data returned from load requests to specific registers 164 of register file 160.

Scoreboards are used to track the availability of data in each register of a register file when the data is returned by a longer latency, e.g. multicycle, operation. For shorter latency operations, e.g. those with latencies of 1-2 clock cycles, comparators are typically used to detect the availability of requested data, and the requested data is returned to the pipeline through staging latches and bypasses rather than through a register file. Shorter latency operations typically occur for simple arithmetic and logic unit (ALU) operations and loads that are satisfied from a low level cache. Since it is not efficient to trigger a thread switch unless the latency of the triggering operation exceeds the latency of the thread switch operation (approximately, 20-30 clock cycles), some method for detecting these very long latency operations is desirable.

In one embodiment of the present invention, a modified scoreboard 170 is associated with register file 160 and coupled to cache management module 140 to track data returns from very long latency operations. Scoreboard 170 includes first status register 174 for implementing the normal tracking function, i.e. tracking data availability in the register file. Each register, e.g. register 164(j), is associated with a status bit in first status register 174. The bit is set when a multicycle operation is generated to deliver data to associated register 164. In the disclosed embodiment, a bit in first status register 174 is set when a data request to an associated register 164 misses in cache 110 or when some other multicycle operation occurs.

A thread switch may be initiated if an instruction issues that consumes data in a register for which the associated bit in status register 174 is set. This approach, however, allows thread switches on loads that may hit in cache 120 or 130. An alternative approach is to indicate a thread switch when a load misses in cache 130 (or a higher level cache, if present), e.g. when cache management module 140 detects a load forwarded to main memory 180, which leads to a load operation of very long latency. While this approach is more efficient than the previous one, it also generates unnecessary thread switches, since the load will stall the processor's pipeline only if an instruction that consumes the data is issued before the data is returned by main memory 180.

In the present invention, scoreboard 170 is modified to detect only those very long latency events for which thread switching is very efficient. Scoreboard 170 includes a second status register 178 that contains a bit for each register 164 in register file 160. In this embodiment, cache management module 140 monitors load operations to determine when a load operation misses in (L2) cache 330. When such a cache miss is detected, the register(s) for which the requested data is destined is identified and a corresponding bit in second status register 178 is set. The register is determined using translation information in buffer(s) 150.

A thread switch module is coupled to monitor scoreboard 170 and execution pipeline (FIG. 2). If an instruction issues that consumes data in a register for which both bits of modified scoreboard 170 are set, the execution pipeline stalls. The present invention attributes the stall to a very long latency load operation to main memory 180, and the thread switch module initiates a thread switch operation. This allows a different thread to make use of the resources of the processor's pipeline while the load operation for the previous thread is completed.

In order to accommodate concurrent processing of multiple threads, scoreboard data must be tracked for each thread. In one embodiment of the present invention, status registers 174, 178 are replicated to track data availability for each thread.

FIG. 2 shows a portion of a processor pipeline 200 suitable for monitoring and updating register file 160 and scoreboard 170 in accordance with the present invention. In particular, register (REG) and execute (EXE) stages 204, 208, respectively, of processor pipeline 200 are shown. REG stage 204 includes a register file 160, an operand delivery and control (ODC) module 210, and an operand bypass MUX 230. A staging latch 205 couples data from REG stage 204 to EXE stage 208.

EXE stage 208 includes one or more execution units 240. Execution unit 240 implements instructions using data provided by register file 160 or by other execution units through bypass line 250. Data generated by instructions executed in EXE stage 208 is typically written back to register file 160 in DET stage 206. This writeback updates the architectural state of the currently executing thread in register file 160.

Latch 202 couples register identification indicators (REG_IDs) from a previous stage 201 to REG stage 204. Stage 201 is typically a wordline decode (WLD) stage, that includes circuitry for decoding an instruction to determine which register(s) contains (or will eventually contain) the data needed by the instruction in EXE stage 208. The data is provided to register file 160 by loads from memory or through execution of a prior instruction in EXE stage 204. Where the data is generated by execution of a prior instruction, it is written to register file 160 by register write module 260 in DET stage 206. Occasionally, the data is required as soon as it is generated, in which case it may be provided directly from execution unit 240 through bypass line 250.

Movement of data into and out of register file 160 and through MUX 230 is monitored by ODC module 210. In the disclosed embodiment of pipeline 200, ODC module 210 includes scoreboard 170, comparators 212, and routing logic 214. ODC module 210 monitors REG_IDs from latch 202 and bypass line 254 to update scoreboard 170 and route data to execution unit 240 from register file 160 or, if necessary, through bypass line 250. In addition, status bits 174 of scoreboard 170 are updated to reflect loads or other multicycle operations for corresponding registers 164 and status bits 178 are updated to reflect any loads that miss in cache 130 (FIG. 1).

Comparator(s) 212 monitors REG_IDs from staging latches 202, 203 and the status of corresponding register 164 from scoreboard. 170. Comparator 212 triggers routing logic 214 if a read request targets a REG_ID (from latch 202) for which the requested data is not available in register file 160 but can be provided through bypass 250.

Pipeline stall module 280 is coupled to scoreboard 170 and comparator 212 to determine when pipeline 200 will stall. In particular, if data for an indicated REG_ID from latch 202 is not available in register file 160 (status bit 174 for specified REG_ID is set) or from bypass 250, pipeline 200 stalls. The present invention also checks the status bit 178 of scoreboard 170 to determine whether the data for which pipeline 200 is stalled is being provided by a long latency load, e.g. a load from main memory 180. If both scoreboard bits 174, 178 are set for a REG_ID for which pipeline 200 is stalled, a thread switch condition is indicated.

Referring now to FIG. 3, there is shown one embodiment of a method 300 in accordance with the present invention for triggering thread switches on read requests to registers awaiting data from very long latency load operations. Method 300 monitors 310 loads in a memory system, and determines 320 when a load misses in a low level cache(s). Here, low level caches refers to those caches in close proximity to the processor that have small access latencies, e.g. caches 110, 120 in the disclosed embodiment. When such a miss is detected 320, a bus request (REQ) is generated 330 to retrieve the data from a higher level structure(s) in the memory system. The bus REQ is mapped 340 to each register destined to receive data returned by the REQ, and a cache miss bit, e.g. second scoreboard bit 178, is set for each register identified by mapping step 340.

A register read queue is checked 360 to determine whether an instruction tries to access the register(s) for data. If an instruction tries to access 360 the data in a register for which both scoreboard bits are set, a thread switch condition is indicated 390. If no instruction tries to access the data, it is determined 370 whether the data has been returned from main memory. If it has been returned 370, the cache miss bit is reset 380 and method 300 returns to step 310. If the data has not been returned 370, method 300 continues checking 360, 370 for accesses to the data and its return from memory.

In FIG. 3, it is assumed that the first scoreboard bit is set for any register awaiting data from an operation that requires more than a couple of clock cycles to complete, i.e. any mulicycle operation. Method 300 may be modified for very long latency operations other than selected loads. For example, step 320 may represent detection of floating point transcendental functions that return data to a register. In this case, the register for which the second scoreboard bit is set is the target register to which the value of the transcendental function is returned. If step 320 is instead detection of an interrupt time out, the second scoreboard bits are set for all registers whose first scoreboard bits are set. Method 300 may be implemented in any of a variety of mutli-threaded processors. One multi-threaded processor for which method 200 is suitable is a course grained multi-threaded processor that employs a shadow register file to minimize the die cost of bookkeeping and storage structures necessary to track the status of multiple threads. A processor employing a shadow register file for multi-threading is also described in U.S. patent application Ser. No. 09/001,546, now abandoned, entitled Multiple Processors on a Chip Using a Shadow Register File, filed on even data herewith assigned to the same assignee.

The shadow register file is a multi-ported storage structure that provides access to multiple storage arrays, each capable of storing data representing the architectural state of an associated thread. The multiple data arrays share a common set of wires or access ports to couple data in and out of the register file. The use of multiple storage arrays with a common set of access ports allows the register file to accommodate multiple architectural states with low incremental cost. A select signal line specifies architectural state data in one of the multiple arrays for access. The use of a common set of wires for multiple data arrays allows the architectural state data for multiple threads to be stored on the processor (on chip) in a multi-ported register file that is not significantly larger than a conventional multi-ported register file.

The shadow register file provides multiple sets of storage cells into which architectural state data for multiple threads may be preloaded, without requiring additional read and write ports to access the architectural state data. A control line couples different sets of storage cells to the common set of wires, as and when architectural state data for the different threads is required. In effect, architectural state data for the currently executing thread is held in a set of foreground registers, while architectural state data for the other threads are held in one or more sets of background registers.

Referring now to FIG. 4, there is shown a block diagram of one embodiment of a processor 400 suitable for implementing the thread switch method of the present invention. Processor 400 includes a fetch/execution (core) pipeline 420, a shadow register file 460 coupled to the core pipeline 420, and a thread switch module 480 coupled to shadow register file 460. Shadow register file 460 is capable of storing architectural state data for multiple threads. In particular, shadow register file 460 comprises m columns 402 of n cells 450, where each cell 450 includes multiple storage elements 454(a)-454(l) (collectively, storage elements 454). By providing multiple storage elements 454 for each cell 450, each row 404 of cells effectively provides 1 registers 408(a)-408(l) of storage capacity, and shadow register file 460 provides storage capacity for architectural state data from l threads. Architectural state data for a jth thread may be stored in a selected storage elements, e.g. 454(j), of each cell 450 and accessed according to a signal controlled by thread switch module 470.

Also shown in FIG. 4 are system, control and status (S/C/S) registers 470(1)-470(l), one for each of the 1 threads that may be scheduled concurrently on processor 400. In the disclosed embodiment of processor 400, separate S/C/S registers 470 are provided for each thread, since replicating these smaller registers does not significantly increase the die area of the processor. In this embodiment, integer and floating point architectural state data for a given thread is preloaded into a set of storage elements, e.g. storage elements 454(j), while system, control, and status architectural state data is preloaded into S/C/S registers 470(j).

An alternative embodiment of processor 400 may implement S/C/S registers 470 as a single shadow register file, similar to that described above. In this embodiment, S/C/S register files 470(1)-470(l) are replaced with a single, shadow S/C/S register file in each of a plurality of storage arrays that share a common set of wires are preloaded with system, control, and status architectural state data for one of the multiple threads.

Thread switch module 480 monitors the status of core pipeline 420 for a thread switch event during processing of the currently scheduled thread. In the present invention, thread switch module 480 initiates a thread switch when a load initiated by the current thread misses in the caches (FIG. 1) of processor 400, and a consumer instruction stalls waiting for the requested data. When such a thread switch event is detected, thread switch module 480 passes control of core pipeline 420 to a new thread and reconfigures shadow register file 460 to bring to the foreground the architectural data associated with the new thread. Architectural state data is deemed to be in the foreground when it is accessible through the common wires of shadow register file 460. As discussed below, this may be accomplished by transferring the desired architectural state data from its current array of storage elements 454, e.g. elements 454(j), to a selected array of storage elements 454, e.g. elements 454(a) that is coupled to the common wires (FIG. 4A). Alternatively, the array of elements 454 containing the desired architectural state data may be coupled to the common wires.

To switch threads, core pipeline 420 is flushed or drained of instructions from the currently executing thread, the new logical processor is activated by bringing the architectural state of the corresponding thread into the foreground, and fetch engine 424 is resteered to fetch instructions indicated by the instruction pointer of the new thread. However, the thread switch does not wait for previously issued memory accesses from the current thread to complete, nor are these accesses flushed or drained from the memory pipeline. Rather, these accesses overlap with execution of instructions from a new thread. In particular, these accesses continue to execute in the memory subsystem and return data to staging memory buffers while the new thread executes on core pipeline 420. The returned data may be transferred to the appropriate array of shadow register file 460 when the corresponding thread is next granted control of core pipeline 420 and the array is accessible through the common wires of shadow register file 460.

Referring now to FIG. 5, there is shown one embodiment of a cell 450 having 1 storage elements 454(a)-454(l). Cell 450 includes a foreground storage element 454(a) and (l-1) background storage elements 454(b)-454(l). A pair of transfer elements 510(1), 510(2) and a pair of pass gates 520(a), 522(a), couple foreground element 454(a) to background elements 454(b)-454(l). Pass gates 520(a) and 522(a) are driven by transfer signals φ1 and φ2, respectively. Switches 540 and 544 couple foreground storage element 354(a) to a read line 532 and write line 536, respectively. Switches 540 and 544 are activated by a WR line 520 and a WW line 524, respectively.

It is understood that for multiple-ported shadow register file 460, e.g. h-read ports, k-write ports, switch 544, WR line 520, and read line 532 comprise h-switches 540, h-WR lines 520, and h-read lines 532, respectively. Each of h-switches 540 is driven by one of h-WR lines 520 to couple cell 550 to one of h-read lines 532. Similarly, switch 544, WW line 524, and write line 536 comprise k-switches 544, k-WW lines 524, and k-write lines 536.

Background elements 454(b)-454(l) are similarly coupled to transfer elements 510(1), 510(2) through pairs of pass gates 520(b), 522(b) to 520(l), 522(l), respectively. φ2 is selectively coupled to pass gates 520(b)-520(l) through a select module 530(1). Similarly, φ1 is selectively coupled to pass gates 522(b)-522(l) through a select module 530(2). Select modules 530(1), 530(2) are driven by control signal 560 to apply φ2 and φ1 to one of pass gates 520 and 522, respectively.

Application of signals φ1 and φ2 to pass gates 520, 522 allows data in one of background storage elements 454(b)-454(l) to be moved to foreground storage element 454(a), where it may be accessed by read, write lines 532, 536, respectively. Control signal 560 determines which of background storage cells 454(b)-454(l) is coupled to foreground storage element 454(a). For example, applying φ1 to pass gates 520(a) and 522(b) moves data from foreground storage element 454(a) and background storage element 454(b) into transfer elements 510(1) and 510(2), respectively. Applying φ2 to pass gates 522(a) and 520(b) moves the data in transfer elements 510(2) and 510(1) into foreground element 454(a) and background element 454(b), respectively. Applying this process to each cell 450, moves architectural state data for a thread into foreground storage elements 354(a), where it can be read and written under control of the thread. This is done simultaneously for all cells of the register file.

In one embodiment of cell 450, signals φ1 and φ2 are successive phases of a clock signal. In another embodiment of cell 450, signals φ1 and φ2 are successive cycles of a clock signal.

There has thus been provided a method for detecting long latency pipeline stalls suitable for triggering a thread switch in a multi-threaded processor. The method employs a modified scoreboard to track the availability of data in specific registers and the status of loads that return data destined for these registers. A first scoreboard bit associated with a register is set when a multicycle operation that returns data to the register, such as a load to the processor's lower level caches, is detected. A second scoreboard bit (a load miss bit) associated with the register is set if the load misses in the lower level caches, indicating a very long latency operation, such as a request to memory, is required. A register read queue is monitored to determine whether an instruction needs the data being accessed by the long latency operation. A thread switch condition is indicated when an instruction tries to access a register which is awaiting data from a very long latency read operation, e.g. when the register's first and second scoreboard bits are set.

The present invention has been described using loads from main memory as exemplary very long latency operations. However, other very long latency operations may be used to set the second scoreboard bits of effected registers in the register file. For example, floating point transcendental operations, such as logarithms, sines, cosines and the like, can take on the order of 200 clock cycles to return data. When these operations are detected, the second scoreboard bit for the registers to which they return data may be set. A thread switch condition then occurs if a subsequent instruction tries to read the register (whose first and second scoreboard bits are set). In addition, other non-register specific operations may be used to set the second scoreboard bit. The very long latency operations include, for example, interrupt time outs and serialization conditions in multi-processor systems.

專利引用
引用的專利申請日期發佈日期 申請者專利名稱
US5361337 *1992年5月8日1994年11月1日Sun Microsystems, Inc.Method and apparatus for rapidly switching processes in a computer system
US5835705 *1997年3月11日1998年11月10日International Business Machines CorporationMethod and system for performance per-thread monitoring in a multithreaded processor
US5918033 *1997年1月8日1999年6月29日Intel CorporationMethod and apparatus for dynamic location and control of processor resources to increase resolution of data dependency stalls
US5933627 *1996年7月1日1999年8月3日Sun MicrosystemsThread switch on blocked load or store using instruction thread field
US6018759 *1997年12月22日2000年1月25日International Business Machines CorporationThread switch tuning tool for optimal performance in a computer processor
US6088788 *1996年12月27日2000年7月11日International Business Machines CorporationBackground completion of instruction and associated fetch request in a multithread processor
非專利引用
參考文獻
1"Characterization of Alpha AXP Performance Using TP and SPEC Workload." Zarka Cvetanovic et al., IEEE, 1994.*
2"Converting Thread-Level Parallelism To Instruction-Level Parallelism Via Simultaneous Multithreading", Lo, et al., Dept. of Computer Science and Engineering, Seattle, WA, pp. 1-25.
3"Evaluation of Multithreaded Uniprocessors for Commercial Application Environment", Richard J. Eickemeyer, et al., 1996.*
4"Exploiting Choice: Instruction Fetch and Issue on an Implementable Simultaneous Multithreading Processor", Tullsen, et al., Dept. of Computer Science and Engineering, Seattle WA, pp. 1-12.
5"Reducing Memory Latency via Non-blocking and Prefetching Caches" Tien-Fu Chen and Jean-Loup Baer, 1992 Seattle, WA, Univ. of Washington, Dep. of Comp. Science.*
6"Simultaneous Multithreading: A Platform For Next-Generation Processors", Eggers, et al., Dept. of Computer Science and Engineering, Seattle, WA, pp. 1-15.
7"Simultaneous Multithreading: Maximizing On-Chip Parallelism", Tullsen, et al., Dept. of Computer Science and Engineering, Seattle, WA, pp. 1-12.
8Compilation Issues For A Simultaneous Multithreading Processor, Lo, et al., Dept. of Computer Science and Engineering, Seattle, WA, 2 pp.
9Increasing Superscalar Performance Through Multistreaming:, Yamamoto, et al., Proceedings of the IFIP WG10.3 Working Conference on Parallel Architectures and Compilation Techniques, pp. 1-10.
被以下專利引用
引用本專利申請日期發佈日期 申請者專利名稱
US6694425 *2000年5月4日2004年2月17日International Business Machines CorporationSelective flush of shared and other pipeline stages in a multithread processor
US68570462002年3月28日2005年2月15日Cisco Technology, Inc.Caching for context switching applications
US6952827 *1998年11月13日2005年10月4日Cray Inc.User program and operating system interface in a multithreaded environment
US70511812005年1月14日2006年5月23日Cisco Technology, Inc.Caching for context switching applications
US7146490 *2003年8月7日2006年12月5日Hewlett-Packard Development Company, L.P.Processing system and method for efficiently enabling detection of data hazards for long latency instructions
US7191321 *2003年8月19日2007年3月13日Intel CorporationMicroengine for parallel processor architecture
US71914442003年9月16日2007年3月13日Cray Inc.Stream management in a multithreaded environment
US72069222003年12月30日2007年4月17日Cisco Systems, Inc.Instruction memory hierarchy for an embedded processor
US72099962002年10月16日2007年4月24日Sun Microsystems, Inc.Multi-core multi-thread processor
US72901162004年6月30日2007年10月30日Sun Microsystems, Inc.Level 2 cache index hashing to avoid hot spots
US73600642003年12月10日2008年4月15日Cisco Technology, Inc.Thread interleaving in a multithreaded embedded processor
US73602212003年9月10日2008年4月15日Cray Inc.Task swap out in a multithreaded environment
US73668292004年6月30日2008年4月29日Sun Microsystems, Inc.TLB tag parity checking without CAM read
US73925252003年10月1日2008年6月24日Cray Inc.Inter-thread long jumps in a multithreaded environment
US74267322003年10月10日2008年9月16日Cray Inc.Placing a task of a multithreaded environment in a known state
US74306432004年12月30日2008年9月30日Sun Microsystems, Inc.Multiple contexts for efficient use of translation lookaside buffer
US74411012004年2月5日2008年10月21日Cisco Technology, Inc.Thread-aware instruction fetching in a multithreaded embedded processor
US7444641 *1998年12月17日2008年10月28日Agere Systems Inc.Context controller having context-specific event selection mechanism and processor employing the same
US74902302005年3月22日2009年2月10日Mips Technologies, Inc.Fetch director employing barrel-incrementer-based round-robin apparatus for use in multithreading microprocessor
US7502913 *2006年6月16日2009年3月10日Microsoft CorporationSwitch prefetch in a multicore computer chip
US75061402005年3月22日2009年3月17日Mips Technologies, Inc.Return data selector employing barrel-incrementer-based round-robin apparatus
US75094472006年12月14日2009年3月24日Mips Technologies, Inc.Barrel-incrementer-based round-robin apparatus and instruction dispatch scheduler employing same for use in multithreading microprocessor
US7509484 *2004年6月30日2009年3月24日Sun Microsystems, Inc.Handling cache misses by selectively flushing the pipeline
US75197962004年6月30日2009年4月14日Sun Microsystems, Inc.Efficient utilization of a store buffer using counters
US7529916 *2006年8月16日2009年5月5日Arm LimitedData processing apparatus and method for controlling access to registers
US7536690 *2003年9月16日2009年5月19日Cray Inc.Deferred task swapping in a multithreaded environment
US75431322004年6月30日2009年6月2日Sun Microsystems, Inc.Optimizing hardware TLB reload performance in a highly-threaded processor with multiple page sizes
US75712842004年6月30日2009年8月4日Sun Microsystems, Inc.Out-of-order memory transactions in a fine-grain multithreaded/multi-core processor
US76139042005年2月4日2009年11月3日Mips Technologies, Inc.Interfacing external thread prioritizing policy enforcing logic with customer modifiable register to processor internal scheduler
US76140562003年9月12日2009年11月3日Sun Microsystems, Inc.Processor specific dispatching in a heterogeneous configuration
US76311302005年3月22日2009年12月8日Mips Technologies, IncBarrel-incrementer-based round-robin apparatus and instruction dispatch scheduler employing same for use in multithreading microprocessor
US7653906 *2002年10月23日2010年1月26日Intel CorporationApparatus and method for reducing power consumption on simultaneous multi-threading systems
US76539122003年5月30日2010年1月26日Steven FrankVirtual processor methods and apparatus with unified event notification and consumer-producer memory operations
US76578832005年3月22日2010年2月2日Mips Technologies, Inc.Instruction dispatch scheduler employing round-robin apparatus supporting multiple thread priorities for use in multithreading microprocessor
US76578912005年2月4日2010年2月2日Mips Technologies, Inc.Multithreading microprocessor with optimized thread scheduler for increasing pipeline utilization efficiency
US76609692007年1月5日2010年2月9日Mips Technologies, Inc.Multithreading instruction scheduler employing thread group priorities
US7664936 *2005年2月4日2010年2月16日Mips Technologies, Inc.Prioritizing thread selection partly based on stall likelihood providing status information of instruction operand register usage at pipeline stages
US76810142005年7月27日2010年3月16日Mips Technologies, Inc.Multithreading instruction scheduler employing thread group priorities
US76856072003年12月12日2010年3月23日Steven FrankGeneral purpose embedded processor
US77526272005年2月4日2010年7月6日Mips Technologies, Inc.Leaky-bucket thread scheduler in a multithreading microprocessor
US77607482006年9月16日2010年7月20日Mips Technologies, Inc.Transaction selector employing barrel-incrementer-based round-robin apparatus supporting dynamic priorities in multi-port switch
US77736212006年9月16日2010年8月10日Mips Technologies, Inc.Transaction selector employing round-robin apparatus supporting dynamic priorities in multi-port switch
US7836317 *2008年1月29日2010年11月16日Altera Corp.Methods and apparatus for power control in a scalable array of processor elements
US78537772005年2月4日2010年12月14日Mips Technologies, Inc.Instruction/skid buffers in a multithreading microprocessor that store dispatched instructions to avoid re-fetching flushed instructions
US7865702 *2009年8月17日2011年1月4日Sony Computer Entertainment Inc.Stall prediction thread management
US79248282004年8月31日2011年4月12日Netlogic Microsystems, Inc.Advanced processor with mechanism for fast packet queuing operations
US79375352007年2月22日2011年5月3日Arm LimitedManaging cache coherency in a data processing apparatus
US79416032009年11月30日2011年5月10日Netlogic Microsystems, Inc.Method and apparatus for implementing cache coherency of a processor
US7941646 *2007年12月31日2011年5月10日Freescale Semicondoctor, Inc.Completion continue on thread switch based on instruction progress metric mechanism for a microprocessor
US79617232004年8月31日2011年6月14日Netlogic Microsystems, Inc.Advanced processor with mechanism for enforcing ordering between information sent on two independent networks
US79617452006年9月16日2011年6月14日Mips Technologies, Inc.Bifurcated transaction selector supporting dynamic priorities in multi-port switch
US79842682004年7月23日2011年7月19日Netlogic Microsystems, Inc.Advanced processor scheduling in a multithreaded system
US79909892006年9月16日2011年8月2日Mips Technologies, Inc.Transaction selector employing transaction queue group priorities in multi-port switch
US79919772007年12月20日2011年8月2日Netlogic Microsystems, Inc.Advanced processor translation lookaside buffer management in a multithreaded system
US80109662006年9月27日2011年8月30日Cisco Technology, Inc.Multi-threaded processing using path locks
US80155672004年8月31日2011年9月6日Netlogic Microsystems, Inc.Advanced processor with mechanism for packet distribution at high line rate
US80372242007年7月31日2011年10月11日Netlogic Microsystems, Inc.Delegating network processor operations to star topology serial bus interfaces
US8041929 *2006年6月16日2011年10月18日Cisco Technology, Inc.Techniques for hardware-assisted multi-threaded processing
US80654562008年1月24日2011年11月22日Netlogic Microsystems, Inc.Delegating network processor operations to star topology serial bus interfaces
US80788402008年12月30日2011年12月13日Mips Technologies, Inc.Thread instruction fetch based on prioritized selection from plural round-robin outputs for different thread states
US80870342009年10月26日2011年12月27日Steven J. FrankVirtual processor methods and apparatus with unified event notification and consumer-produced memory operations
US80995562005年9月13日2012年1月17日Arm LimitedCache miss detection in a data processing apparatus
US8099586 *2008年12月30日2012年1月17日Oracle America, Inc.Branch misprediction recovery mechanism for microprocessors
US81512682010年1月8日2012年4月3日Mips Technologies, Inc.Multithreading microprocessor with optimized thread scheduler for increasing pipeline utilization efficiency
US81762982004年8月31日2012年5月8日Netlogic Microsystems, Inc.Multi-core multi-threaded processing systems with instruction reordering in an in-order pipeline
US81857242006年3月3日2012年5月22日Arm LimitedMonitoring values of signals within an integrated circuit
US82719972010年2月4日2012年9月18日Steven J. FrankGeneral purpose embedded processor
US8327122 *2007年3月2日2012年12月4日Samsung Electronics Co., Ltd.Method and system for providing context switch using multiple register file
US20070226474 *2007年3月2日2007年9月27日Samsung Electronics Co., Ltd.Method and system for providing context switch using multiple register file
CN1310139C *2004年4月14日2007年4月11日国际商业机器公司Method and system for implementing queue instruction in multi-threaded microprocessor
DE112004002296B4 *2004年11月19日2010年7月8日Intel Corporation, Santa ClaraAnwenderprogrammierbares Multithreading mit geringem Overhead
WO2003036482A22002年10月21日2003年5月1日Sun Microsystems, Inc.Multi-core multi-thread processor
WO2007031696A1 *2005年9月13日2007年3月22日Arm LimitedCache miss detection in a data processing apparatus
分類
美國專利分類號718/108, 718/102, 712/E09.53, 712/229, 712/205, 712/23, 712/E09.46
國際專利分類號G06F9/38
合作分類G06F9/3851, G06F9/3824, G06F9/3838
歐洲分類號G06F9/38E1, G06F9/38E4, G06F9/38D