Method and Apparatus of Arranging Priority Queue and Arbitrating for Memory Access Requests
A method and an apparatus of memory access request priority queue arbitration comprises sorting the requests into plurality of different priority levels firstly. The priority queues of different priority levels are arranged respectively according to the following steps: counting the cycles and latencies of each access request; counting the total cycles; comparing the latencies of each access request and total cycles respectively, if the total cycles is larger than the latency of a request, then arranging one more the same request in the priority queue, else executing the priority queue in order.
Latest VIA TECHNOLOGIES, INC. Patents:
1. Field of the Invention
The present invention generally relates to a method and an apparatus of priority arbitration, and more particularly to a method and an apparatus of arranging priority queue for an arbiter within a memory access interface.
2. Description of the Related Art
As the requirement of consumer media electronic products increasing, in order to enhance the product competition, the concept of SoC (System On Chip, SoC) has become a trend. Due to the device integrated, the chip with SoC concept have less power consumption, greater heat dissipation, and better signal sending quality. Moreover, the concept of SoC is to put more and more devices into one single chip, so each device in this chip have to be integrated or reduced its size in order to meet the concept of SoC. With the integration of devices, the use of devices and substrates can be reduced. Due to the reduction of size of devices, the volume of chip is reduced, and also the package is reduced, so the cost of the chip designed with the concept of SoC can be reduced. One of the most widely used consumer media electronic products is multi-media player.
In order to process different video and audio signals, a well-known multi-media player comprises many microprocessors with different functions, for example, to process video signals, a video decoder unit is necessary; to process audio signals, a digital signal processor (DSP) is necessary. Additionally, amounts of memory modules are needed for a well-known multi-media player to handle large data transportation and storage of firmware.
A memory interface existing between each microprocessor and it's corresponding memory modules is for establishing contact in order to processing the access. To manage requests accessing efficiently, the memory interface comprises an arbiter, arbitrating which one of the access requests asked by the microprocessor has the priority and arbitrating which one of the access requests can use the bus bandwidth. Before arbitrating the priority of bus bandwidth, a standard of bus bandwidth sequence which is called priority queue must be setup. It decides which one of the access requests has the priority to use bus bandwidth based on priority queue when a plurality of access requests are asked at the same time.
A well-known arrangement of queue is shown in
Because of the trend of the concept of SoC (System On Chip) and reduction of memory space in systems, a invention of sharing memory address and data buses is provided earlier, where some parts of system with same functions are integrated or shared. All microprocessors have to access shared memory and data buses via a shard memory interface in the system. Therefore a better method of arranging priority queue and an efficiency arbitrative apparatus is necessary to decide the request priority of a system with amounts of access requests. Furthermore, system performance is increased.
SUMMARY OF THE INVENTIONThe present invention provides a method and an apparatus of priority arbitration deciding which one of the access requests has the priority and which one of the access requests can use bus bandwidth when a large of access requests are asked at the same time without increasing accessing speed and bus bandwidth.
The present invention also provides a method of arranging priority queue. When a higher priority access request exists in the highest level priority queue, it prevents system fail if the higher priority access request is not executed at a certain time.
A preferred embodiment of present invention firstly separates a plurality of access requests into a plurality of priority levels. A plurality of access requests of each priority level are arranged into a priority queue, and the arranging method comprises the following steps: counting cycles and latency of each access request; counting total cycles of all access requests; comparing latency and total cycles of each access request, if latency of an access request is smaller than total cycle, then additionally arranging the same access request into the priority queue once again, else executing the plurality of access requests according to the sequence of priority queue.
A preferred embodiment of the present invention provides an arbiter, comprising of three arbitrative apparatus which have different priority levels, and each arbitrative apparatus with its own priority level at least comprises of: a plurality of request multiplexers for selecting a plurality of access requests of the priority level; and an ownership selector for arranging priority queue. In addition, an arbitrative apparatus with its own priority level further comprises of: an OR gate coupled to the arbitrative apparatus of one higher priority level for informing the priority level whether there is any access request is asked, if there is, then arranging the access request into the last position of the priority queue of the higher priority level; and a AND gate coupled to the ownership selector of one lower priority level for asking the lower priority level to point out the next access request when the next access request is at the last position of the priority queue.
BRIEF DESCRIPTION OF THE DRAWINGSThe accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention. In the drawings,
The present invention provides a method of arranging priority queue for an arbiter of a memory interface in multi-media player, also provides an apparatus and a method for arbitrating of different priority levels. In this way, when amounts of access requests are asked at the same time, system finds the one access request which is needed to be executed immediately according to the respected priority of each access request and prevents access request fail or system function fail.
A preferred embodiment is given as the following to enable one skilled in the art to make and use the present invention as provided within the context of a particular application and its requirements. Various modifications to the preferred embodiment will, however, be apparent to one skilled in the art, and the general principles defined herein may be applied to other embodiments. Therefore the present invention is not intended to be limited to the particular embodiments shown and described herein, but is to be accorded the widest herein disclosed.
Firstly, separating a plurality of access requests asked from at least one microprocessor into three different priority levels: high priority level, normal priority level and low priority level respectively. A plurality of access requests in each different priority level are arranged as a priority queue and each access request has a corresponding request number. Priority level of an access request can be dynamically adjusted according to the use condition, for example, request access priority of servo controller when playing VCD (Video Compact Disk) is higher than playing DVD (Digital Versatile Disk) due to the higher frequency of reading disk data; request access priority of MPEG (Moving Picture Experts Group) decoder when playing DVD is higher than playing VCD due to the higher requirements of MPEG decoder.
Then executing the access requests according to the sequence of high level priority queue, simultaneously the next access request which has the priority is asked and wait. When one access request is in turn to be executed but it is not asked, then executing the next access request. After total access requests of high priority level are once executed, check if there any access request is asked in normal priority level, if there hasn't, then going back to execute high level priority queue; if there has, then executing one access request of normal priority level then going back to high level priority queue. That is to say, when finishing executing a cycle of high priority queue, then executing one access request of normal priority level and going back to execute high level priority queue; after finishing executing a cycle of normal priority queue, then executing one access request of low priority level and going back to execute high level priority queue.
The flow chart is as the following and shown in
- 220 executing the n-th access request of high level priority queue;
- 230 estimating if n=N?;
- if not, then n=n+1 and go back to step 220;
- if yes, then:
- 240 initial value n′=0;
- 250 executing the n′-th access request of normal level priority queue;
- 260 estimating if n′=N?
- if not, then n′=n′+1 and go back to step 210;
- if yes, then:
- 270 initial value n″=0; and
- 280 executing the n″-th access request of low level priority queue, and then back to step 210.
A well-known method of arranging priority queue is shown in
In the present invention, additional request No. 10 is arranged into the high level priority queue once again (shown in
The method of arranging priority queue in the present invention comprises the following steps: counting latency and cycles of all access requests of each priority queue (cycles means the spending time of executing an access request; latency means the longest waiting time before an access request is accepted, and if the access request is not accepted in its latency, the access request will fail, so that the system function fail; both units are Ts); counting total cycles of all access requests in priority queue; comparing latency of each access request with total cycles under the worse case respectively, if latency of an access request is smaller than total cycles, then the same access request should be additional arranged into the priority queue once again (the access request is called nonsatisfied access request in which the latency is smaller than total cycles of all access requests in priority queue), else executing access requests according to the sequence of priority queue. However, when an additional access request is arranged in priority queue, then counting the maximum during cycles between the two same access requests; then comparing the latency with the maximum during cycles, if the latency is still smaller than the maximum during cycles, then another the same access request is arranged into the priority again. Repeat this step (recounting maximum during cycles and comparing with the latency between two same access requests), until the nonsatisfied access request can be successfully executed in time. Finally, as some additional access requests are arranged into the priority queue, recounting new total cycle, and comparing with latency again and following the steps above until all access requests in priority queue can be executed successfully during total cycles. Further, the position of the additional access request is the position which has the average during cycles between two same access requests.
The method of arranging priority queue in present invention is as the following and shown in
- 310 counting cycles and latency of each access request;
- 320 counting total cycles of all access requests in priority queue;
- 330 comparing that latency of each access request is larger than the total cycles;
- If yes, then:
- 340 executing access requests according to the sequence of priority queue;
- If no, then:
- 350 additionally arranging the nonsatisfied access request into the priority queue once again;
- 360 counting the maximum during cycles between the two same access requests;
- 370 comparing whether the latency is larger than the maximum during cycles;
- If latency is larger than the maximum during cycles;
- If no, then go back to step 350, step 360 and step 370;
- If yes, then:
- 380 recounting new total cycles; and executing the step 330.
Every time when an additional access request is arranged into the priority queue, the new total cycles are recounted, then comparing with latencies again until all access requests in priority queue can be executing during total cycles.
As the method of arranging priority queue described above, the method can be used in an arbitrative apparatus. An arbiter of the present invention is shown in
Refer to
Refer to
Refer to
Furthermore, the high level arbitrative apparatus 410 comprises a 2-input AND gate 505 with one input coupled to the ownership selector 503, estimating if the asking point out signal is sent, and another input coupled to a estimation signal, estimating if the next ownership selector unit 504 points to the last position of the high level priority queue (the position for arranging an access request of normal priority level), and an output coupled to the ownership selector 603 of normal level arbitrative apparatus 420. When an asking point out signal is sent out (true), and the next ownership selector unit 504 points to the last position of high level priority queue (true), then outputting an asking point out signal to normal priority level to ask for pointing out the position of the next access request.
Furthermore, the normal level arbitrative apparatus 420 comprises an OR gate 607 with multi-inputs coupled to each output of each access request MUXs 601, and an output coupled to the ownership selector 503 of high level arbitrative apparatus 410; when an access request of normal priority level is going to be asked, arranging this access request into the last position of high level priority queue. Additionally, the normal level arbitrative apparatus 420 also comprises a 2-input AND gate 605 with one input coupled to the ownership selector 603, estimating if the asking point out signal is sent, and another input coupled to a estimation signal, estimating if the next ownership selector unit 604 points to the last position of the normal level priority queue (the position for arranging an access request of low priority level), and an output coupled to the ownership selector 703 of low level arbitrative apparatus 430. When an asking point out signal is sent out (true), and the next ownership selector unit 604 points to the last position of normal level priority queue (true), then outputting an asking point out signal to low priority level to ask for pointing out the position of the next access request.
Furthermore, the low level arbitrative apparatus 430 comprises an OR gate 707 with multi-inputs coupled to each output of each access request MUXs 701, and an output coupled to the ownership selector 603 of normal level arbitrative apparatus 420; when an access request of low priority level is going to be asked, arranging this access request into the last position of normal level priority queue.
As the description above, without increasing accessing speed and bus bandwidth, the present invention provides a better method of arranging priority queue and the present invention also provides an apparatus and a method for arbitrating of different priority levels. An arbitrative mechanism with the concept of the present invention can arbitrate large of access requests efficiently, and if there has a higher priority access request in the highest level priority queue, the higher priority access request can be accessed in a short time, thus the access request and system do not fail due to long waiting time.
Finally, those skilled in the art should appreciate that they can readily use the disclosed conception and specific embodiment as a basis for designing or modifying other structures for carrying put the same purpose of the present invention without departing from the spirit and scope of the invention as defined by the appended claims.
Claims
1. A method for arranging a priority queue, comprising the following steps:
- counting latency and cycle of each of the plurality of access requests in the priority queue;
- counting total cycles of all access requests in the priority queue; and
- comparing latency of each of the plurality of access requests with the total cycles;
- wherein if a latency of an access request is smaller than the total cycles, then arranging the nonsatisfied access request into the priority queue once again, the access request is called nonsatisfied access request in which the latency is smaller than total cycles of all access requests in priority queue.
2. As the method of claim 1, wherein if the latency of each access request in the priority queue is larger than the total cycles, executing the plurality of access requests according to the sequence of the priority queue.
3. As the method of claim 1, further comprising:
- counting the maximum during cycles between two same access requests and comparing with said latency when said nonsatisfied access request is arranged, if said latency is smaller than said maximum during cycles, then arranging said access request into said priority queue again.
4. As the method of claim 1, further comprising:
- recounting new total cycles when said nonsatisfied access request is arranged, and comparing with said latency of each access request, if the latency of another access request is smaller than said new total cycles, then arranging said access request into the priority once again, else executing the plurality of access requests according to the sequence of the priority queue.
5. As the method of claim 1, wherein the positions of additional arranged access requests are the positions which can let interval of each during cycle of these same access requests equally.
6. As the method of claim 1, wherein the method can be used in an arbitrative mechanism.
7. A method of arbitration for different priority levels, comprising the following steps:
- receiving a plurality of access requests;
- separating the plurality of access requests into a plurality of different priority levels; and
- arranging the plurality of access requests of each priority level as a priority queue;
- wherein the priority level of the plurality access requests can be dynamically adjusted according to the different requirements of the system.
8. As the method of claim 7, wherein the steps of arranging the priority queue of each priority level comprising:
- counting each cycle and latency of a plurality of access requests;
- counting total cycles of all access requests; and
- comparing latency of each of the plurality of access requests with the total cycles;
- wherein if a latency of an access request is smaller than the total cycles, then arranging the nonsatisfied access request into the priority queue once again, else executing the plurality of access requests according to the sequence of the priority queue, the access request is called nonsatisfied access request in which the latency is smaller than total cycles of all access requests in priority queue.
9. As the method of claim 8, further comprising:
- counting the maximum during cycles between two same access requests and comparing with said latency when said nonsatisfied access request is arranged, if said latency is smaller than said maximum during cycles, then arranging said access request into said priority queue again.
10. As the method of claim 8, further comprising:
- recounting new total cycles when said nonsatisfied access request is arranged, and comparing with said each latency of each access request, if the latency of another access request is smaller than said new total cycles, then arranging said access request into the priority once again, else executing the plurality of access requests according to the sequence of the priority queue.
11. As the method of claim 8, wherein the positions of additional arranged access requests are the positions which can let interval of each during cycle of those same access requests equally.
12. As the method of claim 7, wherein each access request is respectively arranged in priority queue with corresponding request number.
13. As the method of claim 7, further comprising:
- selecting one of the access requests of one of the priority queue to execute, and pointing out the next access request which has the priority.
14. As the method of claim 7, after finishing executing all access requests of a priority level in priority queue, then executing one of the access request of next priority level, then go back to execute the access request of highest priority level.
15. An arbitrative apparatus of access request arbitration, comprising:
- a plurality of access request selectors, wherein each one of the plurality of access request selectors receiving a plurality of access requests respectively; and
- an ownership selector, coupled to the plurality of access request selectors, when an access request is being executed, an asking point out signal is sent out to ask for pointing out the position of next access request;
- wherein the arbitrative apparatus has its own priority level, and each access request selectors respectively selects one access requests grouped to respected priority level from the plurality of access requests, and said ownership selector receives the plurality of access requests respectively and arranges the plurality of access requests which are selected by the plurality of access request selectors into a priority queue.
16. As the arbitrative apparatus of claim 15, further comprising:
- a priority setting register coupled to the plurality of access request selectors for setting request numbers of access requests that belong to said priority level.
17. As the arbitrative apparatus of claim 16, further comprising:
- an ownership multiplexer, finding the corresponding request number of access request from register according to the position of said priority queue.
18. As the arbitrative apparatus of claim 15, wherein said ownership selector further comprises a next ownership selector unit, pointing out the position of the next access request when receiving said asking point out signal.
19. As the arbitrative apparatus of claim 15, further comprising:
- an OR gate with multi-inputs coupled between the plurality of access request selectors and said ownership selector and an output coupled to the ownership selector of one higher priority level, estimating whether there any access request is asked of this priority level, if there is, then arranging the access request into the last position of the priority queue of one higher priority level.
20. As the arbitrative apparatus of claim 15, further comprising:
- a 2-input AND gate, in which one input coupled to said ownership selector, estimating if said asking point out signal is sent, another input coupled to a estimation signal, estimating if the next access request is at the last position of the priority queue, and an output coupled to the ownership selector of one lower priority level, when both inputs are true, then pointing out the next access request of the one lower priority level.
21. As the arbitrative apparatus of claim 15, at least one said arbitrative apparatus with different priority level can be combined as an arbitrative mechanism wherein said arbitrative mechanism can be an arbiter.
22. An arbiter of access request arbitration, comprising:
- a plurality of arbitrative apparatus, each one has its own priority level;
- wherein each one of the arbitrative apparatus with different priority level at least comprises:
- a plurality of access request selectors, wherein each one of the plurality of access request selectors receiving a plurality of access request respectively; and
- an ownership selector, coupled to the plurality of access request selectors, when an access request is being executed, an asking point out signal is sent out to ask for pointing out the position of next access request;
- wherein each access request selectors respectively selects one access requests grouped to the priority level from the plurality of access requests, and said ownership selector receives the plurality of access requests respectively and arranges the plurality of access requests which are selected by the plurality of access request selectors into a priority queue.
23. As an arbiter of claim 22, further comprising:
- a priority setting register coupled to the plurality of access request selectors for setting request numbers of access requests that belong to said priority level.
24. As an arbiter of claim 23, further comprising:
- an ownership multiplexer, finding the corresponding request number of access request from register according to the position of said priority queue.
25. As an arbiter of claim 22, wherein said ownership selector further comprises a next ownership selector unit, pointing out the position of the next access request when receiving said asking point out signal.
26. As an arbiter of claim 22, further comprising:
- an OR gate with multi-inputs coupled between the plurality of access request selectors and said ownership selector and an output coupled to the ownership selector of one higher priority level, estimating whether there any access request is asked of this priority level, if there is, then arranging the access request into the priority queue of one higher priority level.
27. As an arbiter of claim 22, further comprising:
- a 2-input AND gate, one input coupled to said ownership selector, estimating if said asking point out signal is sent, another input coupled to a estimation signal, estimating if the next access request is the last access request of priority queue, and an output coupled to the ownership selector of one lower priority level, when both inputs are true, the one lower priority level point out the next access request.
Type: Application
Filed: Sep 23, 2004
Publication Date: Jun 16, 2005
Applicant: VIA TECHNOLOGIES, INC. (Taipei)
Inventor: Ting-Kun Yeh (Taipei)
Application Number: 10/711,518