The present invention relates to an arbitration mechanism for awarding priority to one of a plurality of agents, in particular, a mechanism allowing the agent to dynamically determine the priority level to give to requests for access to a resource.
Where there is a single resource in a computing system whether the resource is a bus, an SRAM, a FIFO, etc., an arbitrator is required to control access to the resource from among a plurality of requesting agents. In accordance with many arbitration schemes, an arbiter assigns a priority level to each request made by the agents and decides which agents get access based on the assigned priority. Typically, requests with higher priority are given preferred access, preempting requests with lower priority. Agents making requests at the same priority level are given access in an equitable or round robin fashion. In these aforementioned arbitration schemes, however, the priority assigned to the agents is just a best guess as to what the current access needs of the agents are. As a result, agents whose access needs change over time (and thus requiring a higher priority) may be starved from access to the resource
In accordance with various embodiments of the invention a system and method are provided for dynamically determining the priority of requests for access to a resource taking into account changes in the access needs of agents over time.
According to one embodiment, a method is provided for determining the priority of requests to an arbiter for accessing a resource. A priority level is selected from a plurality of priority selections for a priority request. The priority request, including the selected priority level, is made to the arbiter. The priority request having the highest priority level receives access to the resource first. Two or more priority requests having the same priority level may be granted access round-robin. The priority selection may be dynamic. The dynamic priority level may be initially set to a first priority level. The selection of the dynamic priority level increases or decreases the priority level of a priority request based on when threshold values representing the number of work requests awaiting access in a work request queue are reached. The threshold values which cause the priority level to be increased may be higher than the threshold values which cause the priority level to be decreased to provide hysteresis.
According to a further embodiment of the invention, the dynamic priority selection starts a timer for timing a request for a predetermined time period. The request is changed to a higher priority level if the request has not received access to the resource before the timer expires.
A computing system embodiment of the invention includes a resource, a plurality of agents for making priority requests for access to the resource and an arbiter in communication with the agents and the resource. The agents may have a work request queue for storing work requests. The agents assign each priority request a priority level which may be selected from a configuration register. When the dynamic priority level is selected an agent may increase or decrease the priority level of a priority request when certain threshold levels are reached. The threshold levels may correspond to the number of work requests in the work request queue.
In accordance with another embodiment of the invention an agent is provided for determining the priority of requests for access to a resource. The agent includes a configuration register for storing a set of priority levels and a selector for selecting one of the priority levels to assign to a priority request for access. When the dynamic priority level is selected, the agent may automatically increase or decrease the priority level of a priority request based on the number of work requests in the agent's work request queue. The ability of the agent to dynamically change the priority of its own requests can help prevent the agent from being starved from access to the resource.
The foregoing features of the invention will be more readily understood by reference to the following detailed description, taken with reference to the accompanying drawings, in which:
Referring to
Work requests solicit the resource once the priority request has been awarded access to the resource. An agent may store multiple work requests that require resource access in a work request queue until the priority request is granted. Once the agent gains access to the resource the next work request in the work request queue is made for access to the resource.
In the computing system 100, agents 103 send signals to the arbiter indicating a priority request. Priority requests may be any one of several priority levels including low priority, medium priority or high priority. The arbiter 102 utilizes an algorithm employing fixed-priority arbitration among priority levels and round-robin arbitration within a priority level. In fixed-priority arbitration, the arbiter 102 grants first access to agents making high priority requests. If no agent makes a high priority request, then the arbiter 102 grants first access to agents making medium priority requests. If no agent makes a high or medium priority request, then the arbiter 102 grants access to agents making low priority requests. Agents making requests at the same priority share access in round-robin fashion (i.e., the agent which was not previously granted access by the arbiter has priority over the agent which was). Fixed-priority and round-robin arbitration algorithms for determining access are well known to those of ordinary skill in the art. Once priority is determined, the arbiter 102 sends a signal to the appropriate agent granting access to the resource.
Agents 103 determine the priority level of the requests sent to the arbiter using a request priority algorithm. An embodiment of an agent that may be used in the invention is shown in FIG. 2. As shown in
Configuration register 204 is divided into fields as shown in the table of FIG. 3. The ENABLE indicates whether or not an agent is able to make priority requests. The PRIORITY field stores priority levels (low, medium, high and dynamic). Each priority level is represented by a two-bit code. Depending on the request priority algorithm used, the agent 103 may be programmed to select a fixed priority level (i.e., low, medium or high). In the fixed request priority algorithm all priority requests will be sent to the arbiter at low, medium or high priority. In other embodiments, the agent may be programmed to select the dynamic priority level, that is, the agent automatically increases the priority level of requests as the access needs of the agent change over time. Once the dynamic priority level is selected, a priority request is sent to the arbiter at an initial predetermined priority level. L2M (low-to-medium priority), M2L (medium-to-low priority), M2H (medium-to-high priority) and H2M (high-to-medium priority) are work request queue fields utilized in the dynamic request priority algorithm. The dynamic request priority algorithm may be based upon queue entry threshold values in the work request queue fields. Each threshold value represents the number of work requests in the work request queue that will trigger the agent to change the priority request to a new priority level. In this embodiment, work request queue field L2M stores a first threshold value, M2L stores a second threshold value, M2H stores a third threshold value, and H2M stores a fourth threshold value.
As described above and in accordance with the various embodiments of the invention, the configuration register 204 and the selector 206 are programmable and may be implemented in hardware. The request priority algorithms may be implemented in software and are described below with respect to
Referring now to
Referring now to
In accordance with an embodiment of the present invention, the queue threshold values are programmable. Software instructions can be used to set the threshold values for each of the work request queue fields L2M, M2L, M2H and H2M. Although each work request queue field may be individually programmed with a desired threshold value it is generally advantageous to set the rising threshold values for fields L2M and M2H higher than the falling threshold values for fields M2L and H2M to provide a hysteresis effect. This prevents the agent from having to constantly shift priority levels due to minute changes in the queue. For example, if L2M has a threshold value of 5 and M2L has a threshold value of 2, the agent would increase the priority level of a priority request from low to medium when the queue reached five or more work requests and would not decrease the priority level from medium to low until the number of work requests in the queue fell to two. The initial priority level for the dynamic request priority algorithm may be programmed to be any fixed priority level.
In addition to the embodiments hereinbefore described, many modifications and refinements which do not depart from the true spirit and scope of the invention may be conceived by those of ordinary skill in the art. For example, the arbitration algorithms for the arbiter need not be limited to fixed and round-robin. The number of work request queue fields and the number of corresponding threshold values may be larger or smaller. It is intended that all such modifications, including but not limited to those set forth above, be covered by the following claims.
Number | Name | Date | Kind |
---|---|---|---|
5619661 | Crews et al. | Apr 1997 | A |
5862353 | Revilla et al. | Jan 1999 | A |
5884051 | Schaffer et al. | Mar 1999 | A |
5983302 | Christiansen et al. | Nov 1999 | A |
6088751 | Jaramillo | Jul 2000 | A |
6473817 | Jeddeloh | Oct 2002 | B1 |
6629220 | Dyer | Sep 2003 | B1 |
6647449 | Watts | Nov 2003 | B1 |
Number | Date | Country | |
---|---|---|---|
20030177296 A1 | Sep 2003 | US |