1. Field of the Invention
The present invention is in the field of digital processing and pertains more particularly to apparatus and methods for fetching and dispatching instructions in dynamic multistreaming processors.
2. Background
Conventional pipelined single-stream processors incorporate fetch and dispatch pipeline stages, as is true of most conventional processors. In such processors, in the fetch stage, one or more instructions are read from an instruction cache and in the dispatch stage, one or more instructions are sent to execution units (EUs) to execute. These stages may be separated by one or more other stages, for example a decode stage. In such a processor the fetch and dispatch stages are coupled together such that the fetch stage generally fetches from the instruction stream in every cycle.
In multistreaming processors known to the present inventors, multiple instruction streams are provided, each having access to the execution units. Multiple fetch stages may be provided, one for each instruction stream, although one dispatch stage is employed. Thus, the fetch and dispatch stages are coupled to one another as in other conventional processors, and each instruction stream generally fetches instructions in each cycle. That is, if there are five instruction streams, each of the five fetches in each cycle, and there needs to be a port to the instruction cache for each stream, or a separate cache for each stream.
In a multistreaming processor multiple instruction streams share a common set of resources, for example execution units and/or access to memory resources. In such a processor, for example, there may be M instruction streams that share Q execution units in any given cycle. This means that a set of up to Q instructions is chosen from the M instruction streams to be delivered to the execution units in each cycle. In the following cycle a different set of up to Q instructions is chosen, and so forth. More than one instruction may be chosen from the same instruction stream, up to a maximum P, given that there are no dependencies between the instructions.
It is desirable in multistreaming processors to maximize the number of instructions executed in each cycle. This means that the set of up to Q instructions that is chosen in each cycle should be as close to Q as possible. Reasons that there may not be Q instructions available include flow dependencies, stalls due to memory operations, stalls due to branches, and instruction fetch latency.
What is clearly needed in the art is an apparatus and method to de-couple dispatch operations from fetch operations. The present invention, in several embodiments described in enabling detail below, provides a unique solution.
In a preferred embodiment of the present invention a pipelined multistreaming processor is provided, comprising an instruction source, a plurality of streams fetching instructions from the instruction source, a dispatch stage for selecting and dispatching instructions to a set of execution units, a set of instruction queues having one queue associated with each stream in the plurality of streams, and located in the pipeline between the instruction source and the dispatch stage, and a select system for selecting streams in each cycle to fetch instructions from the instruction source. The processor is characterized in that the number of streams selected for which to fetch instructions in each cycle is fewer than the number of streams in the plurality of streams.
In some embodiments the number of streams in the plurality of streams is eight, and the number of streams selected for which to fetch instructions in each cycle is two. Also in some embodiments the select system monitors a set of fetch program counters (FPC) having one FPC associated with each stream, and directs fetching of instructions beginning at addresses according to the program counters. In still other embodiments each stream selected to fetch is directed to fetch eight instructions from the instruction cache.
In some embodiments there is a set of execution units to which the dispatch stage dispatches instructions. In some embodiments the set of execution units comprises eight Arithmetic-Logic Units (ALS), and two memory units.
In another aspect of the invention, in a pipelined multistreaming processor having an instruction queue, a method for decoupling fetching from a dispatch stage is provided, comprising the steps of (a) placing a set of instruction queues, one for each stream, in the pipeline between the instruction queue and the dispatch stage; and (b) selecting one or more streams, fewer than the number of streams in the multistreaming processor, for which to fetch instructions in each cycle from an instruction source.
In some embodiments of the method the number of streams in the plurality of streams is eight, and the number of streams selected for which to fetch instructions in each cycle is two. In some embodiments the select system monitors a set of fetch program counters (FPC) having one FPC associated with each stream, and directs fetching of instructions beginning at addresses according to the program counters. In other embodiments each stream selected to fetch is directed to fetch eight instructions from the instruction source. In preferred embodiments, also, the dispatch stage dispatches instructions to a set of execution units, which may comprise eight Arithmetic-Logic Units (ALS), and two memory units.
In embodiments of the present invention, described in enabling detail below, for the first time apparatus and methods are provided for a decoupling fetch and dispatch in processors, and particularly in multistreaming processors.
In the simple architecture illustrated in
In a preferred embodiment of the present invention instruction queues 39 are provided, which effectively decouple fetch and dispatch stages in the pipeline. There are in this embodiment eight instruction queues, one for each stream. In the example of
Referring again to instruction cache 31 and the two ports to fetch stage 33, it was described above that eight instructions may be fetched to stage 33 via each port. Typically the eight instructions for one port are eight instructions from a single thread for a single stream. For example, the eight instructions fetched by one port in a particular cycle will typically be sequential instructions for a thread associated with one stream.
Determination of the two threads associated with two streams to be accessed in each cycle is made by selection logic 35. Logic 35 monitors a set of fetch program counters 37, which maintain a program counter for each stream, indicating at what address to find the next instruction for that stream. Select logic 35 also monitors the state of each queue in set 39 of instruction queues. Based at least in part on the state of instruction queues 39 select logic 35 determines the two threads from which to fetch instructions in a particular cycle. For example, if the instruction queue in set 39 for a stream is full, the probability of utilizing eight additional instructions into the pipeline from the thread associated with that stream is low. Conversely, if the instruction queue in set 39 for a stream is empty, the probability of utilizing eight additional instructions into the pipeline from the thread associated with that stream is high.
In this embodiment, in each cycle, four instructions are made available to dispatch stage 41 from each instruction queue. In practice, dispatch logic is provided for selecting from which queues to dispatch instructions. The dispatch logic has knowledge of many parameters, typically including priorities, instruction dependencies, and the like, and is also aware of the number of instructions in each queue.
As described above, there are in this preferred embodiment ten execution units, which include two memory units 43 and eight arithmetic logic units (ALUs) 45. Thus, in each cycle up to ten instructions may be dispatched to execution units.
In the system depicted by
Thus the instruction queue in the preferred embodiment allows fetched instructions to be buffered after fetch and before dispatch. The instruction queue read mechanism allows the head of the queue to be presented to dispatch in each cycle, allowing a variable number of instructions to be dispatched from each stream in each cycle. With the instruction queue, one can take advantage of instruction stream locality, while maximizing the efficiency of the fetch mechanism in the presence of stalls and branches. By providing a fetch mechanism that can support up to eight instructions from two streams, one can keep the instruction queues full while not having to replicate the fetch bandwidth across all streams.
The skilled artisan will recognize that there are a number of alterations that might be made in embodiments of the invention described above without departing from the spirit and scope of the invention. For example, the number of instruction queues may vary, the number of ports into the instruction cache may vary, the fetch logic may be implemented in a variety of ways, and the dispatch logic may be implemented in a variety of ways, among other changes that may be made within the spirit and scope of the invention. For these and other reasons the invention should be afforded the broadest scope, and should be limited only by the claims that follow.
This application is a continuation of U.S. application Ser. No. 11/539,322, filed Oct. 6, 2006, which is a continuation of U.S. application Ser. No. 09/706,154, filed Nov. 3, 2000 (now U.S. Pat. No. 7,139,898), all of which are incorporated by reference herein in their entirety.
Number | Name | Date | Kind |
---|---|---|---|
3771138 | Celtruda et al. | Nov 1973 | A |
4916652 | Schwarz et al. | Apr 1990 | A |
4924376 | Ooi | May 1990 | A |
5313600 | Kasai | May 1994 | A |
5404469 | Chung et al. | Apr 1995 | A |
5430851 | Hirata et al. | Jul 1995 | A |
5574939 | Keckler et al. | Nov 1996 | A |
5604909 | Joshi et al. | Feb 1997 | A |
5699537 | Sharangpani et al. | Dec 1997 | A |
5724565 | Dubey et al. | Mar 1998 | A |
5742782 | Ito et al. | Apr 1998 | A |
5745725 | Simpson | Apr 1998 | A |
5745778 | Alfieri | Apr 1998 | A |
5812811 | Dubey et al. | Sep 1998 | A |
5848268 | Matsuo | Dec 1998 | A |
5900025 | Sollars | May 1999 | A |
5907702 | Flynn et al. | May 1999 | A |
5913049 | Shiell et al. | Jun 1999 | A |
5933627 | Parady | Aug 1999 | A |
6092175 | Levy et al. | Jul 2000 | A |
6105053 | Kimmel et al. | Aug 2000 | A |
6105127 | Kimura et al. | Aug 2000 | A |
6141746 | Kawano et al. | Oct 2000 | A |
6219780 | Lipasti | Apr 2001 | B1 |
6343348 | Tremblay et al. | Jan 2002 | B1 |
6378063 | Corwin et al. | Apr 2002 | B2 |
6460130 | Trull et al. | Oct 2002 | B1 |
6470443 | Emer et al. | Oct 2002 | B1 |
6530042 | Davidson et al. | Mar 2003 | B1 |
6542987 | Fischer et al. | Apr 2003 | B1 |
6542991 | Joy et al. | Apr 2003 | B1 |
6622240 | Olson et al. | Sep 2003 | B1 |
6691221 | Joshi et al. | Feb 2004 | B2 |
6968444 | Kroesche et al. | Nov 2005 | B1 |
7035998 | Nemirovsky et al. | Apr 2006 | B1 |
7046677 | Monta et al. | May 2006 | B2 |
7139898 | Nemirovsky et al. | Nov 2006 | B1 |
7406586 | Nemirovsky et al. | Jul 2008 | B2 |
Number | Date | Country | |
---|---|---|---|
20080270757 A1 | Oct 2008 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 11539322 | Oct 2006 | US |
Child | 12173560 | US | |
Parent | 09706154 | Nov 2000 | US |
Child | 11539322 | US |