CN116627870A - Dynamic priority weighted polling arbitration method and arbiter - Google Patents
Dynamic priority weighted polling arbitration method and arbiter Download PDFInfo
- Publication number
- CN116627870A CN116627870A CN202310671341.0A CN202310671341A CN116627870A CN 116627870 A CN116627870 A CN 116627870A CN 202310671341 A CN202310671341 A CN 202310671341A CN 116627870 A CN116627870 A CN 116627870A
- Authority
- CN
- China
- Prior art keywords
- source
- arbitration
- packet
- source end
- authorized
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 50
- 241001522296 Erithacus rubecula Species 0.000 claims abstract description 45
- 238000013475 authorization Methods 0.000 claims abstract description 35
- 230000008859 change Effects 0.000 claims abstract description 26
- 230000008569 process Effects 0.000 claims abstract description 18
- 125000004122 cyclic group Chemical group 0.000 claims description 45
- 241001417495 Serranidae Species 0.000 claims description 5
- 238000006243 chemical reaction Methods 0.000 abstract description 4
- 101100517651 Caenorhabditis elegans num-1 gene Proteins 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000013461 design Methods 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 235000003642 hunger Nutrition 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000037351 starvation Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/36—Handling requests for interconnection or transfer for access to common bus or bus system
- G06F13/362—Handling requests for interconnection or transfer for access to common bus or bus system with centralised access control
- G06F13/366—Handling requests for interconnection or transfer for access to common bus or bus system with centralised access control using a centralised polling arbiter
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Bus Control (AREA)
Abstract
The application relates to a dynamic priority weighted polling arbitration method and an arbiter. The method comprises the following steps: receiving source requests sent by a plurality of source ends; the source request includes: polling arbitration application bit, fixed priority code and source weight; the fixed priority code of the source end can be dynamically changed in the arbitration process; dividing source terminals with the same fixed priority codes into the same group, carrying out first-level fixed priority arbitration according to a grouping result, and determining a current authorized grouping; performing second-level weighted polling arbitration according to the weight of each source end in the current authorization packet; if the fixed priority code in the received source request changes in the arbitration process, the source after the code change continues to participate in the next round of arbitration; otherwise, continuing to perform the second-stage weighted round robin arbitration of the current round. The method combines fixed priority arbitration and weighted polling arbitration, can realize dynamic conversion of source priority, enhances the flexibility of use and improves arbitration efficiency.
Description
Technical Field
The present application relates to the field of integrated circuit technologies, and in particular, to a dynamic priority weighted polling arbitration method and an arbiter.
Background
In integrated circuit designs, a comparator is often used as a trigger to wake up the CPU or trigger the occurrence of an event. As shown in fig. 1, the N-terminal of the comparator is connected to the reference voltage of the DAC, the P-terminal is connected to N channels (N > =2) through an arbiter, each channel is connected to a trigger source, and when the selected trigger source voltage is greater than the DAC voltage, the comparator outputs a high level, so as to generate a trigger event, and wake up the CPU.
This involves multiple sources being connected to the destination via an arbiter, thus requiring a set of arbitration mechanisms to assist in order to ensure that multiple sources can interact with the destination in a time-sharing manner.
The basic principle of the arbitration mechanism is that according to the request signals of all source ends and a certain arbitration principle, strobe signals are generated, so that the corresponding source ends can interact with the data of the destination ends in a time sharing manner. The arbitration principle is generally as follows: a fixed priority arbiter, a polling priority arbiter.
(1) In this arbitration method, the priority of each processor for accessing the shared resource is fixed, the priority of the master device with the heavier transmission task is relatively higher, and if several master devices apply for the bus use right at the same time, the device with the highest priority will be authorized. The arbitration algorithm has the advantages of simple design and small area consumption. However, since the highest priority master device will always be authorized after the application, other lower priority devices will not be authorized. If a high priority master frequently sends out requests, a low priority master waits too long, which is prone to starvation.
(2) In the poll arbiter, the priorities of the masters are not fixed, but are rotated in order. The algorithm, in combination with time division multiplexing, can evolve into a time slice based round robin arbitration algorithm. As for three hosts A, B, C, a corresponds to a 0 priority, B corresponds to a 1 priority, and C corresponds to a 2 priority just before the start. Table 0 has the highest priority and table 2 has the lowest priority.
1) The first polling clock cycle, a gets authorization because a corresponds to 0. When A has obtained authorization, A corresponds to 2, B corresponds to 0, and C corresponds to 1.
2) On the second polling clock cycle, B gets authorized because B corresponds to 0. When B has obtained authorization, B corresponds to 2, C corresponds to 0, and A corresponds to 1.
3) On the third polling clock cycle, C gets authorized because C corresponds to 0. When C has obtained authorization, C corresponds to 2, A corresponds to 0, and B corresponds to 1.
A. B, C priority order is continually reciprocated by the above rule. The method, in combination with time division multiplexing, can evolve as a time slice based poll arbiter. The main disadvantage of the polling arbiter is that the probability of being granted for each master device is equal under this approach, which does not meet the performance of the master device with high priority requirements, thus affecting the performance index of the whole system.
(3) In a typical fixed priority arbiter, the priority code of the source, once fixed, cannot be changed. In a general polling arbiter, each source is sequentially granted, and the order of grants cannot be changed.
Because the arbitration method has a plurality of defects, the probability that different hosts obtain authorization in the polling process cannot be different.
Disclosure of Invention
Based on this, it is necessary to provide a dynamic priority weighted round robin arbitration method and arbiter for solving the above technical problems.
A method of dynamic priority weighted round robin arbitration, the method comprising:
receiving source requests sent by a plurality of source ends; the source request includes: polling arbitration application bit, fixed priority code and source weight; the weight of the source terminal is set according to the importance of the source terminal; the fixed priority encoding of the source may be dynamically changed during arbitration.
And dividing the source terminals with the same codes into the same group according to the fixed priority codes of each source terminal, and obtaining a plurality of groups.
Performing first-stage fixed priority arbitration according to the grouping result, and determining the current authorized grouping;
And carrying out second-level weighted polling arbitration according to the weight of each source end in the current grant packet.
And shielding the polling arbitration application bits of all the source ends in the current grant packet, continuing to perform first-level fixed priority arbitration to determine the next grant packet, and performing second-level weighted polling arbitration on the next grant packet until all the packets for which at least one source end sends out arbitration application are traversed.
In one embodiment, performing first-level fixed priority arbitration according to a packet result, determining a current grant packet includes:
ordering the fixed priority codes of each packet from high to low;
and if at least one source end in the first sorted packet sends out an arbitration application, taking the first sorted packet as the current authorized packet.
If no source end sends out an arbitration application in the first sorted packet, judging whether the source end of the second sorted packet sends out an arbitration application, and if at least one source end in the second sorted packet sends out an arbitration application, taking the second sorted packet as a current authorized packet; and according to the rule, until the last packet is sequenced, and waiting to enter the next round of arbitration when no source end sends out an application in the last packet.
In one embodiment, performing second-level weighted round robin arbitration according to the weight value of each source in the current grant packet includes:
when the source requests update or has arbitration application, the initial value of the loop pointer is set to 0, and the initial value of the authorized period of the source is set to 1.
And carrying out weighted polling arbitration on a plurality of source ends in the current grant packet according to the source end request, the source end weight of each source end, the authorized period of each source end and the cyclic pointer, wherein the cyclic pointer is increased by 1 once for each arbitration, and when the cyclic pointer is smaller than the source end number by 1, the second-stage weighted polling arbitration of the current grant packet is ended.
In one embodiment, according to the source request, the source weight of each source, the authorized period of each source and the cyclic pointer, performing weighted polling arbitration on a plurality of sources in the current authorized packet, wherein each time of arbitration, the cyclic pointer is increased by 1, and when the cyclic pointer is smaller than the number of sources by 1, the second-stage weighted polling arbitration of the current authorized packet is ended, including:
and circularly right-shifting the source request by the cyclic pointer by a bit to obtain a request right-shift value.
When the value of the 0bit of the right shift value is 0, no source end is authorized, the authorized period of the source end is set to be 1, and the cyclic pointer is added with 1.
When the value of the 0bit of the right shift value of the request is 1, the corresponding source terminal x obtains authorization, the authorized period of the source terminal is added with 1, when the authorized period of the source terminal is not equal to the source terminal weight of the source terminal x, the source terminal x continues to obtain authorization, the arbitration of the source terminal x is continued until the authorized period of the source terminal is equal to the source terminal weight of the source terminal x, and the authorization of the source terminal x is ended.
And after the authorization of the source terminal x is finished, setting the authorized period of the source terminal to be 1, adding 1 to the cyclic pointers, and judging whether the cyclic pointers are equal to the total number of the source terminals minus 1 to obtain a judging result.
And when the judging result is unequal, updating the right shift request value into the cyclic right shift of the cyclic pointer bit of the source request, and continuing to perform the weighted polling arbitration of the current authorized packet.
And when the judging result is equal, ending the second-stage weighted polling arbitration of the current authorized group.
In one embodiment, the specific steps that the fixed priority code of the source end can dynamically change in the arbitration process include:
When the source terminal m requests to change the fixed priority code, circularly judging whether the X1 source terminal grouping and the X2 source terminal grouping are in an idle state or not; the X2 source end packet is a packet corresponding to the fixed priority code after the source end m is changed; the X1 source group is a group where the source m is located before changing the priority.
And when the X1 source end packet and the X2 source end packet are in an idle state at the same time, a command for changing the fixed priority code of the source end m is effective.
And if the fixed priority coding command of the source terminal m is valid, recoding the source terminal m, dividing the source terminal m into the X2 source terminal groups, and finishing the dynamic change of the priority of the source terminal m.
A dynamic priority weighted poll arbiter, the dynamic priority weighted poll arbiter comprising: a code packetizer, a first level fixed priority arbiter, a second level weighted round robin arbiter.
The coding grouping device is used for receiving source end requests sent by a plurality of source ends, and dividing the source ends with the same codes into the same group according to the fixed priority codes of each source end to obtain a plurality of groups; the source request includes: polling arbitration application bit, fixed priority code and source weight; the weight of the source terminal is set according to the importance of the source terminal; the fixed priority encoding of the source may be dynamically changed during arbitration.
The first-stage fixed priority arbiter is used for connecting the source terminals after grouping, determining the current authorized grouping according to the priority of each grouping, and connecting all the source terminals of the current authorized grouping to the second-stage weighted polling arbiter.
And the second-stage weighted polling arbiter is used for carrying out second-stage weighted polling arbitration according to the weight of each source end in the current grant packet.
And after the second-stage weighted polling arbitration of the current authorized grouping is finished, shielding polling arbitration application bits of all source ends in the current authorized grouping, continuing to adopt the first-stage fixed priority arbiter to perform first-stage fixed priority arbitration to determine the next authorized grouping, and adopting the second-stage weighted polling arbiter to perform second-stage weighted polling arbitration on the next authorized grouping until all the grouping for which at least one source end sends out arbitration application is traversed.
In one embodiment, the first level fixed priority arbiter is further configured to order the fixed priority codes of each packet from high to low; if at least one source end in the first sorted packet sends out an arbitration application, the first sorted packet is used as a current authorized packet; if no source end sends out an arbitration application in the first sorted packet, judging whether the source end of the second sorted packet sends out an arbitration application, and if at least one source end in the second sorted packet sends out an arbitration application, taking the second sorted packet as a current authorized packet; and according to the rule, until the last packet is sequenced, and waiting to enter the next round of arbitration when no source end sends out an application in the last packet.
In one embodiment, the second-stage weighted round robin arbiter is further configured to set an initial value of the round robin pointer to 0 and an initial value of the granted period of the source to 1 when the source requests an update or has an arbitration application; and carrying out weighted polling arbitration on a plurality of source ends in the current grant packet according to the source end request, the source end weight of each source end, the authorized period of each source end and the cyclic pointer, wherein the cyclic pointer is increased by 1 once for each arbitration, and when the cyclic pointer is smaller than the source end number by 1, the second-stage weighted polling arbitration of the current grant packet is ended.
In one embodiment, the second-stage weighted round robin arbiter is further configured to cycle the source request by the cyclic pointer by bit to obtain a request right-shift value; when the value of the 0bit of the right shift value is 0, no source end is authorized, the authorized period of the source end is set to be 1, and the cyclic pointer is added with 1; when the value of the 0bit of the right shift value of the request is 1, the corresponding source terminal x obtains authorization, the authorized period of the source terminal is added with 1, when the authorized period of the source terminal is not equal to the source terminal weight of the source terminal x, the source terminal x continues to obtain authorization, and the arbitration of the source terminal x is continued until the authorized period of the source terminal is equal to the source terminal weight of the source terminal x, and the authorization of the source terminal x is ended; after the authorization of the source end x is finished, setting the authorized period of the source end to be 1, adding 1 to the circulating pointer, and judging whether the circulating pointer is equal to the total number of the source ends minus 1 to obtain a judging result; when the judging result is unequal, updating the right shift request value into the cyclic right shift of the cyclic pointer bit of the source request, and continuing to perform weighted polling arbitration of the current authorized group; and when the judging result is equal, ending the second-stage weighted polling arbitration of the current authorized group.
In one embodiment, the code grouper is further configured to, when the source m requests to change its fixed priority code, circularly determine whether the X1 source packet and the X2 source packet are in an idle state; the X2 source end packet is a packet corresponding to the fixed priority code after the source end m is changed; the X1 source end group is a group where the source end m is located before changing the priority; when the X1 source end grouping and the X2 source end grouping are in an idle state at the same time, a command for changing the fixed priority code of the source end m is effective; if the fixed priority coding command of the source terminal m is valid, recoding the source terminal m, dividing the source terminal m into the X2 source terminal groups, and finishing the dynamic change of the priority of the source terminal m
The method and the arbiter for the dynamic priority weighted polling arbitration comprise the following steps: receiving source requests sent by a plurality of source ends; the source request includes: polling arbitration application bit, fixed priority code and source weight; the weight of the source terminal is set according to the importance of the source terminal; the fixed priority code of the source end can be dynamically changed in the arbitration process; dividing source terminals with the same code into the same group according to the fixed priority code of each source terminal to obtain a plurality of groups; performing first-stage fixed priority arbitration according to the grouping result, and determining the current authorized grouping; performing second-level weighted polling arbitration according to the weight of each source end in the current authorized group; in the real-time arbitration process, the source end fixed priority code can be dynamically adjusted, and in the arbitration process, if the fixed priority code in the received source end request changes, the source end after the code change continuously participates in the next round of arbitration; if the fixed priority code in the received source request does not change, continuing the current round of second-level weighted round robin arbitration. The method integrates fixed priority arbitration and weighted polling arbitration, can realize dynamic conversion of source end priority, and enhances the flexibility of use; and meanwhile, the weighted polling is realized, so that the arbitration efficiency is improved.
Drawings
FIG. 1 is a flow diagram of a method of dynamic priority weighted round robin arbitration in one embodiment;
FIG. 2 is a schematic diagram of a dynamic priority weighted round robin arbiter in one embodiment;
FIG. 3 is a flow diagram of first level fixed priority arbitration in one embodiment;
FIG. 4 is a flow chart of a method of round robin arbitration with dynamic priority weighting for comparators according to another embodiment;
FIG. 5 is a flow diagram of source side priority dynamic transformation steps in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
In one embodiment, as shown in fig. 1 and 2, a method for dynamic priority weighted round robin arbitration is provided, the method comprising the steps of:
step 100: receiving source requests sent by a plurality of source ends; the source request includes: polling arbitration application bit, fixed priority code and source weight; the weight of the source terminal is set according to the importance of the source terminal; the fixed priority encoding of the source may be dynamically changed during arbitration.
Specifically, each source request is composed of 8 bits, for example, a request of source m is composed of [ a7, a6, a5, a4, a3, a2, a1, a0], the 0 th bit is a poll arbitration application bit, the 1 st and 2 nd bits are fixed priority codes, and the 3 rd bit to 7 th bit represent weight values of the source.
And according to the requirements, all the source terminals are endowed with different fixed priority codes, and the source terminals with the same fixed priority code are in the same group. The method is easy to expand, and the newly added source end only needs to be given to the fixed priority code.
The situation that the probability of obtaining authorization by each source terminal in general polling is the same is improved, and each source terminal can set different weight values according to the importance of the source terminal, so that the time value of the source terminal when the source terminal accesses to the P terminal of the comparator is determined.
Each source end is equivalent to a wake-up source, but because of the different importance, the time for accessing the comparator is different, and when the CPU is in the low power consumption mode, the large wake-up source with the weight value is more likely to wake up the CPU from the low power consumption mode.
Step 102: and dividing the source terminals with the same codes into the same group according to the fixed priority codes of each source terminal, and obtaining a plurality of groups.
Specifically, when multiple sources apply for the arbiter at the same time, as shown in fig. 2, the code grouping device will divide the sources with the same codes into the same group according to the fixed priority codes of the sources, for example, the sources 0,1,2,3 with the fixed codes 2'B00 are divided into group a, the sources 4,5,6,7 with the fixed codes 2' B01 are divided into group B, the sources 8,9, 10, 11 with the fixed codes 2'B10 are divided into group C, and the sources 12, 13, 14, 15 with the fixed codes 2' B11 are divided into group D in the present embodiment. Wherein the source in group a has the highest fixed priority.
And the source terminal with high importance is assigned to the code with higher priority, so that the source terminal is preferentially accessed to the second-stage weighted polling arbiter, and the working efficiency is improved.
Step 104: and carrying out first-stage fixed priority arbitration according to the grouping result, and determining the current authorized grouping.
Specifically, the number of source packets corresponds to the type of fixed priority code, and only the number of packets is 4. And dividing the source end into four groups A, B, C and D according to the fixed priority code of each group, wherein the fixed priority of the group A is the highest, and the group A is the authorized group. If at least one source end of the a group issues an arbitration application (i.e., 0bit of at least one source end of the source ends 0,1,2,3 in the a group is not 0.), all source ends in the a group are accessed to a second-stage weighted polling arbiter, and after the second-stage weighted polling arbiter traverses the source ends of the grant packet (a group), the encoding packet will mask the 0bit of all source ends in the a group to 0. Because the 0bit of all source ends in the authorization group (A group) is 0 value, namely, all source ends in the A group do not send out polling arbitration application any more, the fixed priority arbiter judges whether all source ends in the B group send out polling arbitration application, if the B group has polling arbitration application, all source ends in the B group are accessed into a second-stage weighted polling arbiter, the B group is subjected to second-stage weighted polling arbitration, if the B group does not have polling arbitration application, all source ends in the C group send out polling arbitration application, if the B group has polling arbitration application, all source ends in the C group are accessed into the second-stage weighted polling arbiter, and the C group is subjected to second-stage weighted polling arbitration; if the group C does not have the polling arbitration application, judging whether all the active terminals in the group D send out the polling arbitration application, if the group D has the polling arbitration application, accessing all the active terminals in the group D into a second-stage weighted polling arbiter, and carrying out second-stage weighted polling arbitration on the group D; if the group D does not have a poll arbitration application, the first-stage fixed priority arbiter and the second-stage weighted poll arbiter are idle, and the next round of arbitration is entered.
Step 106: and carrying out second-level weighted polling arbitration according to the weight of each source end in the current grant packet.
Specifically, after all the sources of the grant packet access the second-stage weighted polling arbiter, different grant probabilities can be obtained according to different importance of each source in a polling process of the second-stage weighted polling arbiter, wherein the 3 rd bit to the 7 th bit represent weight values of the sources. In particular to this application, it is assumed that there are N channels connected to the P-terminal of the comparator through a weighted round robin arbiter with dynamic priority and N wakeup sources correspond to N channels. Different weights may be specified according to the importance of the source. Different weights represent different time periods when each source end is connected to the P end of the comparator, and the larger the weight is, the longer the time when the P end is connected is, and the smaller the weight is, the shorter the time when the P end is connected is. For example, source number 0 is 2, and when source number 0 issues an application, the time of connecting to P-terminal after being authorized is 2 polling clock cycles; the source 1 has a weight of 5, and when the source 5 issues an application, the time of connecting to the P-terminal after being authorized is 5 polling clock cycles. This is a weighted round robin arbitration algorithm, in which the amount of time that the source is connected to the comparator P can be determined according to different weights of the source during a round robin process, so that the probability that each source gets authority during a round robin process is different. After all the source terminals of the authorized group are traversed by polling, corresponding signals are fed back to the coding grouping device, and the coding grouping device can enable the 0bit position 0 of all the source terminals of the group.
If a certain packet source m sends out an application for changing the fixed priority code to another packet in the arbitration process, the priority change command can be validated only when the two packets are in an idle state at the same time, after the change command is validated, the change command is mapped to a code packetizer, and the code packetizer changes the source m from the current packet to the other packet, so that the dynamic change of the source priority is realized.
Step 108: and shielding the polling arbitration application bits of all the source ends in the current authorized grouping, continuing to perform first-level fixed priority arbitration to determine the next authorized grouping, and performing second-level weighted polling arbitration on the next authorized grouping until all the grouping for which at least one source end sends out arbitration application is traversed.
In particular. The method is flexible to use, and the source end which is coded can dynamically change the fixed priority code according to the design or application requirements, so that the time of being accessed into the second-stage polling arbiter is advanced or delayed, and the priority order of the source end is dynamically adjusted in real time in use.
In the above method for dynamic priority weighted polling arbitration, the method comprises: receiving source requests sent by a plurality of source ends; the source request includes: polling arbitration application bit, fixed priority code and source weight; the weight of the source terminal is set according to the importance of the source terminal; the fixed priority code of the source end can be dynamically changed in the arbitration process; dividing source terminals with the same code into the same group according to the fixed priority code of each source terminal to obtain a plurality of groups; performing first-stage fixed priority arbitration according to the grouping result, and determining the current authorized grouping; performing second-level weighted polling arbitration according to the weight of each source end in the current authorized group; in the real-time arbitration process, the source end fixed priority code can be dynamically adjusted, and in the arbitration process, if the fixed priority code in the received source end request changes, the source end after the code change continuously participates in the next round of arbitration; if the fixed priority code in the received source request does not change, continuing the current round of second-level weighted round robin arbitration. The method integrates fixed priority arbitration and weighted polling arbitration, can realize dynamic conversion of source end priority, and enhances the flexibility of use; and meanwhile, the weighted polling is realized, so that the arbitration efficiency is improved.
The algorithm is integrated with a fixed priority arbiter and a weighted polling arbiter, so that the dynamic conversion of the source-end priority can be realized, and the use flexibility is enhanced; and meanwhile, the weighted polling is realized, so that the arbitration efficiency is improved.
In one embodiment, the flow of first level fixed priority arbitration is shown in FIG. 3. Step 104 comprises: ordering the fixed priority codes of each packet from high to low; if at least one source end in the first sorted packet sends out an arbitration application, the first sorted packet is used as a current authorized packet; if no source end sends out an arbitration application in the first sorted packet, judging whether the source end of the second sorted packet sends out an arbitration application, and if at least one source end in the second sorted packet sends out an arbitration application, taking the second sorted packet as a current authorized packet; and according to the rule, until the last packet is sequenced, and waiting to enter the next round of arbitration when no source end sends out an application in the last packet.
Specifically, the code packetizer performs code-based grouping (according to the 2 nd, 1bit of the source) on all the source terminals, and the grouping is as follows: group a (2 'B00), group B (2' B01), group C (2 'B02), group D (2' B03), wherein all sources of group a have the highest fixed priority, i.e., if at least one source of group a issues an arbitration request, the first level fixed priority arbiter will access all sources of group a to the second level weighted round robin arbiter.
If all the source terminals in the A group do not send out arbitration application, the method continues to judge whether the source terminals in the B group send out arbitration application, and if at least one source terminal in the B group sends out arbitration application, the first-stage fixed priority arbiter accesses all the source terminals in the B group to the second-stage weighted polling arbiter. According to this rule, the decision is made from group C to group D.
And when no active end in the group D sends out an application, indicating that the first-stage fixed priority arbiter and the second-stage weighted polling arbiter are in an idle state.
In one embodiment, step 106 includes setting an initial value of the round-robin pointer to 0 and an initial value of the source granted period to 1 when the source requests an update or has an arbitration application; and carrying out weighted polling arbitration on a plurality of source ends in the current authorized grouping according to the source end request, the source end weight of each source end, the authorized period of each source end and the circulating pointer, wherein the circulating pointer is increased by 1 once for each arbitration, and when the circulating pointer is smaller than the source end number by 1, the second-stage weighted polling arbitration of the current authorized grouping is ended.
Specifically, the second-stage weighted polling arbitration algorithm realizes polling arbitration by adding a cyclic pointer, and on the basis, the second-stage weighted polling arbitration algorithm is realized by adding a weight value corresponding to each source terminal. Therefore, the implementation mode is simple and the operation is convenient.
The algorithm is easy to expand, and only one 1 is needed to be added for each round of cyclic pointer every time one source end is added. One more source is added, the number of clock cycles consumed in each poll is equal to the weight value of the source.
In one embodiment, weighted polling arbitration is performed on multiple sources in the current grant packet according to the source request, the source weight of each source, the authorized period of each source, and the round-robin pointer, wherein the round-robin pointer is increased by 1 once for each arbitration, and when the round-robin pointer is smaller than the number of sources by 1, the second-stage weighted polling arbitration of the current grant packet is ended, including: the source end request is circularly shifted to the right by a cyclic pointer bit to obtain a request right shift value; when the value of the 0bit of the right shift value is 0, no source end is authorized, the authorized period of the source end is set to be 1, and the cyclic pointer is added with 1; when the value of the 0bit of the right shift value is 1, the corresponding source end x obtains authorization, the authorized period of the source end is added with 1, when the authorized period of the source end is not equal to the source end weight of the source end x, the source end x continues to obtain authorization, the arbitration of the source end x is continued until the authorized period of the source end is equal to the source end weight of the source end x, and the authorization of the source end x is ended; after the authorization of the source end x is finished, setting the authorized period of the source end as 1, adding 1 to the circulating pointer, and judging whether the circulating pointer is equal to the total number of the source ends minus 1 to obtain a judging result; when the judgment result is unequal, updating the request right shift value into a source request cyclic right shift cyclic pointer bit, and continuing to perform weighted polling arbitration of the current authorized packet; and when the judgment result is equal, ending the second-stage weighted polling arbitration of the current authorized group.
Specifically, a flow chart of a method of poll arbitration with dynamic priority weighting for comparators is shown in fig. 4. The variables in fig. 4 illustrate:
(1) The bit width of the cyclic pointer is 8, and the initial value of the cyclic pointer reset is 0.
(2) NUM refers to the total number of sources currently selected for access to a second level weighted round robin arbiter, and each source occupies one bit. I.e., the bit width of req is [ NUM-1:0].
Each source has a request structure [ a7, a6, a5, a4, a3] with a weight value weight=source m, and the size of the x-th source weight value is weight_x.
(3) req_shiftis the same as req bit wide, and is equal to the right shift pointer bit of the req cycle.
The polling arbitration method with dynamic priority weighting for the comparator mainly comprises the following steps:
1. when a new access to the second-level weighted round robin arbiter is available, second-level weighted round robin arbitration for a new granted packet is restarted, and cnt is set to 1 and pointer is set to 0.
2. req_shifted equals the req cycle right shift pointer bits.
3. Determine req_shifted [0] to be 1?
4. If req_shifted [0] is 0, no source is authorized, cnt is returned to 1 directly, and pointer is added with 1.
5. If req_shifted [0] is 1, the active terminal x is authorized, cnt is added with 1, and the authorized active terminal x finds the corresponding weight value weight_x. Judging whether cnt is equal to weight_x or not, if not, indicating that the source end x continues to obtain authorization; the authorization for source x does not end until cnt is equal to weight_x.
6. After the authorization of source x is completed, cnt is 1, pointer is self-added to 1, and it is determined whether pointer is equal to (NUM-1)?
7. If the pointer is not equal to (NUM-1), then req_shifted equals the req cycle right shifted pointer bits, continuing the current round of the cycle.
8. If the pointer is equal to (NUM-1), it indicates that the round robin arbitration for the currently selected group has ended, and the 0 th bit of all sources in the group is masked and fed back to the code packetizer.
9. The fixed priority arbiter of the first stage determines that all sources of the group do not apply for poll arbitration (because the 0 th bit of all sources is masked to 0), thereby connecting all sources of the next group (if at least one source of the next group issues a weighted poll arbitration application) to the second stage weighted poll arbiter.
10. The second level weighted round robin arbiter waits for access from the source of the next group and may resume round robin arbitration for the selected group.
In one embodiment, a flow chart of the steps of the source priority changing algorithm is shown in fig. 5, and the specific steps that can be dynamically changed in the arbitration process for the fixed priority code of the source include: when the source m requests to change the fixed priority code, circularly judging whether the X1 source packet and the X2 source packet are in an idle state or not; the X2 source end grouping is a grouping corresponding to the fixed priority code after the source end m is changed; the X1 source end group is a group where the source end m is located before changing the priority; when the X1 source end grouping and the X2 source end grouping are in an idle state at the same time, a command for changing the fixed priority code of the source end m is effective; and if the fixed priority coding command of the source terminal m is valid, recoding the source terminal m, dividing the source terminal m into X2 source terminal groups, and finishing the dynamic change of the priority of the source terminal m.
Specifically, if the m source ends of the X1 group request to change the fixed priority codes;
1) And meanwhile, judging whether the X1 group where the m source end is positioned is in an idle state, and if not, waiting for the X1 group to be changed into the idle state. And meanwhile, judging whether the X2 group is in an idle state, and if the X2 group is not in the idle state, waiting for the X2 group to be in the idle state.
2) Only when the X1 and X2 groups are simultaneously in an idle state, the fixed priority coding command of the m end is changed to be effective.
3) The command is mapped to the code grouper, which recodes the m source (e.g., changes the priority code of the m source from 2'B01 to 2' B10, i.e., from group B to group C), thereby completing the dynamic change of the m source priority.
It should be understood that, although the steps in the flowchart of fig. 1 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 1 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of other steps or sub-steps of other steps.
In one embodiment, as shown in FIG. 2, a dynamic priority weighted poll arbiter is provided, the dynamic priority weighted poll arbiter comprising: a code packetizer, a first level fixed priority arbiter, a second level weighted round robin arbiter.
The code grouping device is used for receiving source end requests sent by a plurality of source ends, and dividing the source ends with the same codes into the same group according to the fixed priority codes of each source end to obtain a plurality of groups; the source request includes: polling arbitration application bit, fixed priority code and source weight; the weight of the source terminal is set according to the importance of the source terminal; the fixed priority encoding of the source may be dynamically changed during arbitration.
And the first-stage fixed priority arbiter is used for connecting the grouped source terminals, determining the current authorized grouping according to the priority of each grouping, and connecting all the source terminals of the current authorized grouping to the second-stage weighted polling arbiter.
And the second-stage weighted polling arbiter is used for carrying out second-stage weighted polling arbitration according to the weight of each source end in the current grant packet.
And after the second-level weighted polling arbitration of the current authorized grouping is finished, shielding polling arbitration application bits of all source ends in the current authorized grouping, continuing to adopt a first-level fixed priority arbiter to carry out first-level fixed priority arbitration to determine the next authorized grouping, and adopting a second-level weighted polling arbiter to carry out second-level weighted polling arbitration on the next authorized grouping until all the grouping for which at least one source end sends out arbitration application is traversed.
In one embodiment, the first level fixed priority arbiter is further configured to order the fixed priority encoding of each packet from high to low; if at least one source end in the first sorted packet sends out an arbitration application, the first sorted packet is used as a current authorized packet; if no source end sends out an arbitration application in the first sorted packet, judging whether the source end of the second sorted packet sends out an arbitration application, and if at least one source end in the second sorted packet sends out an arbitration application, taking the second sorted packet as a current authorized packet; and according to the rule, until the last packet is sequenced, and waiting to enter the next round of arbitration when no source end sends out an application in the last packet.
In one embodiment, the second-stage weighted round robin arbiter is further configured to set an initial value of the round robin pointer to 0 and an initial value of the granted period of the source to 1 when the source requests an update or has an arbitration application; and carrying out weighted polling arbitration on a plurality of source ends in the current authorized group according to the source end request, the source end weight of each source end, the authorized period of each source end and the circulating pointer, wherein the circulating pointer is increased by 1 for each time of arbitration, when the circulating pointer is smaller than the source end number by 1, the second-stage weighted polling arbitration of the current authorized group is ended, and continuing to carry out next-stage weighted polling arbitration, otherwise, shielding polling arbitration application bits of all source ends in the current authorized group, and accessing the next group into a second-stage weighted arbiter for arbitration.
In one embodiment, the second-stage weighted round robin arbiter is further configured to cycle the source request by a cyclic pointer by a bit to obtain a request right-shift value; when the value of the 0bit of the right shift value is 0, no source end is authorized, the authorized period of the source end is set to be 1, and the cyclic pointer is added with 1; when the value of the 0bit of the right shift value is 1, the corresponding source end x obtains authorization, the authorized period of the source end is added with 1, when the authorized period of the source end is not equal to the source end weight of the source end x, the source end x continues to obtain authorization, the arbitration of the source end x is continued until the authorized period of the source end is equal to the source end weight of the source end x, and the authorization of the source end x is ended; after the authorization of the source end x is finished, setting the authorized period of the source end as 1, adding 1 to the circulating pointer, and judging whether the circulating pointer is equal to the total number of the source ends minus 1 to obtain a judging result; when the judgment result is unequal, updating the request right shift value into a source request cyclic right shift cyclic pointer bit, and continuing to perform weighted polling arbitration of the current authorized packet; and when the judgment result is equal, ending the second-stage weighted polling arbitration of the current authorized group.
In one embodiment, the code grouper is further configured to, when the source m requests to change its fixed priority code, circularly determine whether the X1 source packet and the X2 source packet are in an idle state; the X2 source end grouping is a grouping corresponding to the fixed priority code after the source end m is changed; the X1 source end group is a group where the source end m is located before changing the priority; when the X1 source end grouping and the X2 source end grouping are in an idle state at the same time, a command for changing the fixed priority code of the source end m is effective; and if the fixed priority coding command of the source terminal m is valid, recoding the source terminal m, dividing the source terminal m into X2 source terminal groups, and finishing the dynamic change of the priority of the source terminal m.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.
Claims (10)
1. A method of dynamic priority weighted round robin arbitration, the method comprising:
receiving source requests sent by a plurality of source ends; the source request includes: polling arbitration application bit, fixed priority code and source weight; the weight of the source terminal is set according to the importance of the source terminal; the fixed priority code of the source end can be dynamically changed in the arbitration process;
Dividing source terminals with the same code into the same group according to the fixed priority code of each source terminal to obtain a plurality of groups;
performing first-stage fixed priority arbitration according to the grouping result, and determining the current authorized grouping;
performing second-level weighted polling arbitration according to the weight of each source end in the current authorized group;
and shielding the polling arbitration application bits of all the source ends in the current grant packet, continuing to perform first-level fixed priority arbitration to determine the next grant packet, and performing second-level weighted polling arbitration on the next grant packet until all the packets for which at least one source end sends out arbitration application are traversed.
2. The method of claim 1, wherein performing a first level of fixed priority arbitration based on the packet result, determining the current grant packet, comprises:
ordering the fixed priority codes of each packet from high to low;
if at least one source end in the first sorted packet sends out an arbitration application, the first sorted packet is used as a current authorized packet;
if no source end sends out an arbitration application in the first sorted packet, judging whether the source end of the second sorted packet sends out an arbitration application, and if at least one source end in the second sorted packet sends out an arbitration application, taking the second sorted packet as a current authorized packet; and according to the rule, until the last packet is sequenced, and waiting to enter the next round of arbitration when no source end sends out an application in the last packet.
3. The method of claim 1, wherein performing a second level of weighted round robin arbitration based on the weight value of each source in the current grant packet comprises:
when the source end requests updating or has arbitration application, setting the initial value of a circulating pointer to be 0 and setting the initial value of the authorized period of the source end to be 1;
and carrying out weighted polling arbitration on a plurality of source ends in the current grant packet according to the source end request, the source end weight of each source end, the authorized period of each source end and the cyclic pointer, wherein the cyclic pointer is increased by 1 once for each arbitration, and when the cyclic pointer is smaller than the source end number by 1, the second-stage weighted polling arbitration of the current grant packet is ended.
4. The method of claim 1, wherein performing weighted round robin arbitration for a plurality of sources in the current grant packet based on the source request, source weight for each source, granted period for each source, and the round robin pointer, the round robin pointer increasing by 1 for each arbitration, and ending the second level weighted round robin arbitration for the current grant packet when the round robin pointer is less than 1 for the number of sources, comprising:
circularly right-shifting the source request by the cyclic pointer by a bit to obtain a request right-shift value;
When the value of the 0bit of the right shift value is 0, no source end is authorized, the authorized period of the source end is set to be 1, and the cyclic pointer is added with 1;
when the value of the 0bit of the right shift value of the request is 1, the corresponding source terminal x obtains authorization, the authorized period of the source terminal is added with 1, when the authorized period of the source terminal is not equal to the source terminal weight of the source terminal x, the source terminal x continues to obtain authorization, and the arbitration of the source terminal x is continued until the authorized period of the source terminal is equal to the source terminal weight of the source terminal x, and the authorization of the source terminal x is ended;
after the authorization of the source end x is finished, setting the authorized period of the source end to be 1, adding 1 to the circulating pointer, and judging whether the circulating pointer is equal to the total number of the source ends minus 1 to obtain a judging result;
when the judging result is unequal, updating the right shift request value into the cyclic right shift of the cyclic pointer bit of the source request, and continuing to perform weighted polling arbitration of the current authorized group;
and when the judging result is equal, ending the second-stage weighted polling arbitration of the current authorized group.
5. The method of claim 1, wherein the specific steps that the fixed priority encoding of the source may dynamically change during the arbitration process include:
When the source terminal m requests to change the fixed priority code, circularly judging whether the X1 source terminal grouping and the X2 source terminal grouping are in an idle state or not; the X2 source end packet is a packet corresponding to the fixed priority code after the source end m is changed; the X1 source end group is a group where the source end m is located before changing the priority;
when the X1 source end grouping and the X2 source end grouping are in an idle state at the same time, a command for changing the fixed priority code of the source end m is effective;
and if the fixed priority coding command of the source terminal m is valid, recoding the source terminal m, dividing the source terminal m into the X2 source terminal groups, and finishing the dynamic change of the priority of the source terminal m.
6. A dynamic priority weighted poll arbiter, the dynamic priority weighted poll arbiter comprising: a code grouper, a first level fixed priority arbiter, a second level weighted round robin arbiter;
the coding grouping device is used for receiving source end requests sent by a plurality of source ends, and dividing the source ends with the same codes into the same group according to the fixed priority codes of each source end to obtain a plurality of groups; the source request includes: polling arbitration application bit, fixed priority code and source weight; the weight of the source terminal is set according to the importance of the source terminal; the fixed priority code of the source end can be dynamically changed in the arbitration process;
The first-stage fixed priority arbiter is used for connecting the grouped source terminals, determining the current authorized grouping according to the priority of each grouping, and connecting all the source terminals of the current authorized grouping to the second-stage weighted polling arbiter;
the second-stage weighted polling arbiter is used for carrying out second-stage weighted polling arbitration according to the weight of each source end in the current authorized packet;
and after the second-stage weighted polling arbitration of the current authorized grouping is finished, shielding polling arbitration application bits of all source ends in the current authorized grouping, continuing to adopt the first-stage fixed priority arbiter to perform first-stage fixed priority arbitration to determine the next authorized grouping, and adopting the second-stage weighted polling arbiter to perform second-stage weighted polling arbitration on the next authorized grouping until all the grouping for which at least one source end sends out arbitration application is traversed.
7. The dynamic priority weighted round robin arbiter of claim 6, wherein said first level fixed priority arbiter is further operable to order the fixed priority codes of each packet from high to low; if at least one source end in the first sorted packet sends out an arbitration application, the first sorted packet is used as a current authorized packet; if no source end sends out an arbitration application in the first sorted packet, judging whether the source end of the second sorted packet sends out an arbitration application, and if at least one source end in the second sorted packet sends out an arbitration application, taking the second sorted packet as a current authorized packet; and according to the rule, until the last packet is sequenced, and waiting to enter the next round of arbitration when no source end sends out an application in the last packet.
8. The dynamic priority weighted round robin arbiter of claim 6, wherein the second level weighted round robin arbiter is further configured to set an initial value of a round robin pointer to 0 and an initial value of a source granted period to 1 when an update is requested or an arbitration request is made by the source; and carrying out weighted polling arbitration on a plurality of source ends in the current grant packet according to the source end request, the source end weight of each source end, the authorized period of each source end and the cyclic pointer, wherein the cyclic pointer is increased by 1 once for each arbitration, and when the cyclic pointer is smaller than the source end number by 1, the second-stage weighted polling arbitration of the current grant packet is ended.
9. The dynamic priority weighted round robin arbiter of claim 6, wherein the second level weighted round robin arbiter is further configured to cycle right the source request by the cyclic pointer by a bit to obtain a request right shift value; when the value of the 0bit of the right shift value is 0, no source end is authorized, the authorized period of the source end is set to be 1, and the cyclic pointer is added with 1; when the value of the 0bit of the right shift value of the request is 1, the corresponding source terminal x obtains authorization, the authorized period of the source terminal is added with 1, when the authorized period of the source terminal is not equal to the source terminal weight of the source terminal x, the source terminal x continues to obtain authorization, and the arbitration of the source terminal x is continued until the authorized period of the source terminal is equal to the source terminal weight of the source terminal x, and the authorization of the source terminal x is ended; after the authorization of the source end x is finished, setting the authorized period of the source end to be 1, adding 1 to the circulating pointer, and judging whether the circulating pointer is equal to the total number of the source ends minus 1 to obtain a judging result; when the judging result is unequal, updating the right shift request value into the cyclic right shift of the cyclic pointer bit of the source request, and continuing to perform weighted polling arbitration of the current authorized group; and when the judging result is equal, ending the second-stage weighted polling arbitration of the current authorized group.
10. The dynamic priority weighted round robin arbiter of claim 6, wherein the code grouper is further configured to cycle determining whether the X1 source packet and X2 source packet are in an idle state when source m requests a change in its fixed priority code; the X2 source end packet is a packet corresponding to the fixed priority code after the source end m is changed; the X1 source end group is a group where the source end m is located before changing the priority; when the X1 source end grouping and the X2 source end grouping are in an idle state at the same time, a command for changing the fixed priority code of the source end m is effective; and if the fixed priority coding command of the source terminal m is valid, recoding the source terminal m, dividing the source terminal m into the X2 source terminal groups, and finishing the dynamic change of the priority of the source terminal m.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310671341.0A CN116627870A (en) | 2023-06-07 | 2023-06-07 | Dynamic priority weighted polling arbitration method and arbiter |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310671341.0A CN116627870A (en) | 2023-06-07 | 2023-06-07 | Dynamic priority weighted polling arbitration method and arbiter |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116627870A true CN116627870A (en) | 2023-08-22 |
Family
ID=87590569
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310671341.0A Pending CN116627870A (en) | 2023-06-07 | 2023-06-07 | Dynamic priority weighted polling arbitration method and arbiter |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116627870A (en) |
-
2023
- 2023-06-07 CN CN202310671341.0A patent/CN116627870A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5832278A (en) | Cascaded round robin request selection method and apparatus | |
TWI496005B (en) | Methods and apparatus for shared resource arbitration | |
US7533206B2 (en) | Resource management device | |
US7062582B1 (en) | Method and apparatus for bus arbitration dynamic priority based on waiting period | |
US7032046B2 (en) | Resource management device for managing access from bus masters to shared resources | |
US8364874B1 (en) | Prioritized polling for virtual network interfaces | |
US7706386B2 (en) | Fast 2-key scheduler | |
US20070016709A1 (en) | Bus control system and a method thereof | |
CN109388490B (en) | Memory allocation method and server | |
JP3791005B2 (en) | Bus access arbitration device and bus access arbitration method | |
CN108199985B (en) | NoC arbitration method based on global node information in GPGPU | |
TW202141291A (en) | Hierarchical bandwidth allocation bus arbiter | |
US7065595B2 (en) | Method and apparatus for bus access allocation | |
US8892801B2 (en) | Arbitration circuity and method for arbitrating between a plurality of requests for access to a shared resource | |
CN101741722A (en) | Data interactive method and device | |
Mody et al. | Smart Round Robin CPU Scheduling algorithm for operating systems | |
CN116627870A (en) | Dynamic priority weighted polling arbitration method and arbiter | |
CN110209350B (en) | Dynamic scheduling method for application I/O (input/output) request in HPC (high performance computing) system of hybrid storage architecture | |
CN115580585B (en) | Balanced arbitration method based on arbiter | |
US7460544B2 (en) | Flexible mesh structure for hierarchical scheduling | |
CN113225263B (en) | Flow request processing method and device and network chip | |
CN108259382B (en) | 3x256 priority scheduling circuit | |
CN116680216A (en) | Weighted round robin arbitration method, device, arbiter and chip suitable for comparator | |
EP2700014B1 (en) | Variable length arbitration | |
CN106933663B (en) | A kind of multithread scheduling method and system towards many-core system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |