A two-stage dynamic fair arbitration method and system for multi-source concurrent requests
Patent Information
- Application Number
- CN202610913538.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-24
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2046-06-24
AI Technical Summary
[0004]本发明提出了一种面向多源并发请求的两级动态公平仲裁方法及系统,旨在解决现有技术中存在的仲裁策略无法兼顾公平性与实时性、缺乏饥饿保障及调度效率低的技术问题
仲裁状态更新模块,分别与所述组内仲裁模块、组间仲裁模块及饥饿检测模块连接,用于收集仲裁结果及饥饿状态,更新仲裁统计信息并反馈至各模块。
Smart Images

Figure CN122432091B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of integrated circuit design and on-chip bus arbitration technology, and in particular to a two-level dynamic fair arbitration method and system for multi-source concurrent requests. Background Technology
[0002] In multi-master, multi-source concurrent digital systems, the arbitrator is a core module determining system access efficiency and data transmission stability. Its core function is to schedule concurrent access requests from multiple master devices, select the winning request according to preset rules, and grant access permissions to the bus or transmission path. Currently, the mainstream arbitration schemes in the industry are mainly divided into two categories: round-robin arbitration and fixed-priority arbitration. Round-robin arbitration can guarantee fair access for each requesting source, but it cannot support rapid response for high-priority requests; fixed-priority arbitration can meet the real-time requirements of high-priority requests, but low-priority requests may experience starvation due to prolonged lack of response. Neither of these schemes can simultaneously achieve high efficiency, fairness, and real-time performance in multi-source concurrent scenarios.
[0003] Existing related patent technologies all have limitations due to their singularity: they may only adopt a single arbitration strategy, which cannot adapt to the differentiated needs of different types of request sources; they may lack hunger detection and fairness restoration mechanisms, which may lead to request blocking and data source starvation in the long run; or they may only be designed for specific scenarios and cannot be universally adapted to various multi-source concurrent digital systems, which seriously restricts the overall performance and operational stability of multi-master device digital systems. Summary of the Invention
[0004] This invention proposes a two-level dynamic fair arbitration method and system for multi-source concurrent requests, aiming to solve the technical problems in the existing technology where arbitration strategies cannot take into account both fairness and real-time performance, lack starvation protection, and have low scheduling efficiency.
[0005] In a first aspect, the present invention provides a two-level dynamic fair arbitration method for multi-source concurrent requests, comprising: Divide the request source into at least two arbitration groups, and configure independent intra-group arbitration strategies, priorities, and starvation detection thresholds for each arbitration group; The first-level arbitration is carried out in parallel for the requests within each arbitration panel, and one winning request within each panel is selected from each panel according to the panel's intra-panel arbitration strategy. For all selected winning requests within the group, a second-level arbitration is performed using a dynamic priority arbitration strategy to select a final winning request and grant access. The system monitors the request suspension time of each request source in real time. When the suspension time of any request source exceeds the hunger detection threshold preset by its arbitration group, the fairness restoration mechanism is triggered. The fairness restoration mechanism includes increasing the priority of the request source in intra-group arbitration and increasing the priority of the arbitration group in inter-group arbitration.
[0006] The technical advantages of the two-level dynamic fair arbitration method for multi-source concurrent requests disclosed in this invention are as follows: Through a two-level parallel arbitration architecture, the time for a single round of complete arbitration is a constant 2 clock cycles, the system throughput reaches 3.6 GB / s in a 10-source concurrent scenario, and the average transmission latency is reduced to 18 clock cycles; through starvation detection and fairness recovery mechanisms, the system fairness index can reach up to 0.92, the request packet loss rate is reduced to 0%, and the data source starvation problem is completely solved; high-priority control commands can be responded to within 2 clock cycles; and it supports configurable parameters such as 2 to 32 request sources, grouping rules, and arbitration strategies, and has cross-platform universality.
[0007] Furthermore, the request sources are divided into at least two arbitration groups, including: dividing all request sources into a high-bandwidth data group and a control command group; the high-bandwidth data group adopts a round-robin arbitration strategy, and the control command group adopts a fixed-priority arbitration strategy.
[0008] Furthermore, in the first-level arbitration, each arbitration group supports multiple request sources to arbitrate in parallel, and the intra-group arbitrations of each arbitration group are executed in parallel and each takes 1 clock cycle.
[0009] Furthermore, the dynamic priority arbitration strategy includes: The priority of idle arbitration groups is automatically increased; The priority of an arbitration panel that wins consecutive awards is automatically reduced. When the number of consecutive wins of a high-bandwidth data group exceeds a preset threshold, its priority decreases step by step. The priority of a control command group is automatically reduced when there are no requests for a consecutive period of time. A high-priority control command request triggers a priority escalation and gains access within two clock cycles.
[0010] Furthermore, the real-time monitoring of the request suspension time of each request source is specifically implemented as follows: an independent suspension counter is configured for each request source. When the request is valid but has not obtained access rights, the counter is incremented by 1 every clock cycle, and the counter is reset to zero after the request is successful.
[0011] Furthermore, the fairness restoration mechanism also includes: when the same request source is marked as exceeding the hunger detection threshold multiple times in a row, a timeout forced scheduling mechanism is triggered, and it is directly granted access to the next clock cycle; after the request source obtains access, its suspend counter is cleared and its priority is restored to the initial value.
[0012] Furthermore, the hunger detection response time is 1 clock cycle, the fairness index is as high as 0.92, and the request packet loss rate is 0%.
[0013] Furthermore, the total time for a single round of complete first and second level arbitration is 2 clock cycles.
[0014] Furthermore, the number of request sources, grouping rules, intra-group arbitration strategy, priority value, and hunger detection threshold are all configurable parameters, supporting full-scenario adaptation for multiple request sources, and each arbitration group supports parallel arbitration of multiple request sources.
[0015] Secondly, the present invention provides a two-level dynamic fair arbitration system for multi-source concurrent requests, the system being used to execute the method, the system comprising: The group management module is used to divide multiple concurrent request sources into at least two arbitration groups and configure independent intra-group arbitration strategies and starvation detection thresholds for each arbitration group. Multiple intra-group arbitration modules are used to receive requests from within their respective groups and execute first-level arbitration in parallel, selecting a winning request from each arbitration group based on the intra-group arbitration strategy. The inter-group arbitration module is used to receive all winning requests within a group and execute a second-level arbitration using a dynamic priority arbitration strategy to select a final winning request and grant access. The hunger detection module monitors the request suspension time of each request source in real time. When the suspension time of any request source exceeds the hunger detection threshold preset by the arbitration group to which it belongs, the fairness restoration mechanism is triggered. The fairness restoration mechanism includes increasing the priority of the request source in intra-group arbitration and increasing the priority of the arbitration group to which it belongs in inter-group arbitration. The arbitration status update module is connected to the intra-group arbitration module, inter-group arbitration module, and hunger detection module, respectively. It is used to collect arbitration results and hunger status, update arbitration statistics, and feed them back to each module.
[0016] The technical advantages of the system disclosed in this invention are as follows: Through a two-stage pipelined hardware architecture of "intra-group parallel arbitration + inter-group dynamic arbitration," the time for a single round of complete arbitration is consistently kept within 2 clock cycles. Each intra-group arbitration module works independently in parallel, effectively reducing the input contention pressure on the inter-group arbitration module. In a scenario with 10 concurrent sources, the system achieves a throughput of 3.6 GB / s with an average transmission latency of only 18 clock cycles, solving the performance bottleneck of a single-stage arbitrator where arbitration latency increases sharply when the number of requesting sources exceeds 8. The group management module divides the requesting sources into high-bandwidth data groups and control command groups. The intra-group arbitration module of the data group uses a polling scheduling circuit, while the intra-group arbitration module of the control group uses a fixed-priority comparator circuit. Both circuits operate in parallel within the same clock cycle. This hardware architecture enables the system to simultaneously guarantee fair access to large data block transmissions (fairness index up to 0.92) and rapid response to high-priority commands (maximum response latency for high-priority commands < 10 clock cycles, typically requiring only 2 clock cycles). The hunger detection module configures an independent hardware suspend counter for each request source and compares it in real time with a configurable hunger detection threshold. Upon generating a hunger flag, the arbitration status update module and group management module adjust the arbitration priorities within and between groups. When continuous hunger exceeds the hardware-defined timeout threshold, forced scheduling logic is triggered, directly bypassing the regular priority comparison to grant permissions. This closed-loop hardware mechanism ensures that all request sources can obtain service under any load conditions, with a request packet loss rate of 0% and a system fairness index of 0.92. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of a two-level dynamic fair arbitration system architecture for multi-source concurrent requests proposed in an embodiment of the present invention; Figure 2 This is a schematic diagram of the entire two-level arbitration process provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the hunger detection and fairness restoration logic provided in an embodiment of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] The following are the core pain points of existing arbitration technologies mentioned in the background: a single arbitration strategy cannot simultaneously satisfy the fair access of high-bandwidth data requests and the high real-time response of control command requests; the lack of an effective fairness guarantee mechanism leads to long-term starvation of low-priority requests; when the number of request sources increases, the scheduling efficiency of a single arbitrator is low, and the system throughput is limited; the arbitration status cannot be dynamically adjusted, resulting in long-term imbalance of fairness; and existing solutions have poor universality and are difficult to adapt to cross-platform.
[0020] This invention provides a two-level dynamic fair arbitration method and system for multi-source concurrent requests. Its core lies in constructing a two-level parallel arbitration architecture of "intra-group + inter-group," and integrating a closed-loop control mechanism of dynamic priority adjustment and starvation detection recovery to simultaneously solve the efficiency, fairness, and real-time issues in multi-source concurrent systems. The following detailed description of each component and method flow is provided in conjunction with the accompanying drawings.
[0021] refer to Figure 1 The system disclosed in this invention mainly consists of five functional units: a group management module, multiple intra-group arbitration modules, an inter-group arbitration module, a hunger detection module, and an arbitration status update module.
[0022] Group Management Module: This module is the core of the system's configuration. Based on external instructions or preset rules (such as request type, bandwidth requirements, and real-time requirements), it divides all request sources (e.g., 2-32) into at least two logical arbitration groups. In a preferred embodiment, the default groups are a "High-Bandwidth Data Group" and a "Control Command Group." This module stores the attributes of each group, including: the arbitration strategy within the group (round-robin or fixed priority), the initial priority range, and the starvation detection threshold. All parameters of this module are configurable to achieve cross-platform compatibility.
[0023] Intra-group arbitration module: Each arbitration group has an independent intra-group arbitration module. This module receives valid request signals from all requesting sources within its group. For example, for a high-bandwidth data group, its intra-group arbitration module uses a round-robin algorithm to select a winner from all requesting sources in a fixed cyclical order within one clock cycle. For a control command group, its intra-group arbitration module uses a fixed-priority algorithm to select the highest-priority request among the currently valid requests within one clock cycle. All intra-group arbitration modules execute in parallel without interference, and their output is a winning request within the group along with related identification information. This design ensures that a large number of requesting sources can complete the first-level filtering within a constant time. Each intra-group arbitration module supports parallel arbitration of multiple requesting sources. The number of requesting sources is determined by the request depth within the arbitration group and can be dynamically set. The intra-group arbitration time is strictly one clock cycle.
[0024] Inter-group arbitration module: This module receives winning requests from all intra-group arbitration modules and then uses a dynamic priority arbitration strategy for secondary adjudication. Internally, the module maintains a dynamic priority table, with priority update rules including but not limited to: automatic priority increase for idle groups, and progressively decreasing priority for consecutively winning groups; when a control command group has no requests for an extended period, its priority is reduced to avoid wasting bandwidth; conversely, a high-priority control command can trigger a "skip-level" mechanism, raising the priority of its group to the highest level within one clock cycle, ensuring a response within two clock cycles. Inter-group arbitration also takes one clock cycle and supports parallel arbitration by multiple arbitration groups, the number of which can be adjusted. Finally, the inter-group arbitration module outputs a unique final winning request and accordingly issues an access authorization signal for the bus or path.
[0025] Starvation Detection Module: This is crucial for ensuring system fairness. This module equips each request source with an independent pending counter. When a request source continuously submits requests but fails to win, its pending counter increments by 1 every clock cycle. The module compares the value of each counter in real-time with the starvation detection threshold configured for the corresponding group in the group management module. Once a request source's counter value equals or exceeds the threshold, the module immediately generates a "starvation flag" and sends it to the group management module and the arbitration status update module. The starvation detection response time is one clock cycle.
[0026] Arbitration Status Update Module: This module acts as the system's "black box," recording detailed results of each arbitration (including the winning request source, its group, the number of wins for each group in the current period, and the suspension duration of each request source). It receives hunger flags from the hunger detection module and arbitration results from intra-group and inter-group arbitration modules. Based on this information, it updates its internal statistical status and sends updated priority configurations, threshold adjustments, and other feedback signals back to the intra-group and inter-group arbitration modules, forming a closed-loop optimization system to ensure that the arbitration status can respond in real time to changes in system load.
[0027] The overall method of this invention is a closed-loop link that executes cyclically every clock cycle. The following is in conjunction with... Figure 2 The timing diagrams and specific embodiments of the present invention will be used to describe the method flow of the present invention in detail. For ease of understanding, the following description uses a 10-source concurrent scenario, including 4 AXI channels (belonging to the data group) and 6 RISC-V sub-cores (belonging to the control group), as the main embodiment.
[0028] Step 1: Pre-configuration and request grouping.
[0029] This step aims to complete the initial configuration of the system, laying the foundation for the normal operation of the subsequent arbitration process.
[0030] Specifically, after the system powers on or resets, the group management module first performs initial configuration. Based on externally input configuration instructions or preset grouping rules, the group management module divides all request sources into at least two arbitration groups, and configures an independent intra-group arbitration strategy, initial priority range, and starvation detection threshold for each arbitration group.
[0031] In a preferred embodiment, the group management module divides all request sources into a high-bandwidth data group and a control command group by default. Specifically, the four AXI channels are divided into a high-bandwidth data group, and their intra-group arbitration strategy is configured as round-robin arbitration, with an initial priority set to medium and a starvation detection threshold set to 50 clock cycles. The six RISC-V sub-cores are divided into a control command group, and their intra-group arbitration strategy is configured as fixed-priority arbitration (where configuration commands have the highest priority, followed by other commands), with a starvation detection threshold set to 30 clock cycles.
[0032] As an alternative implementation, the group management module can also flexibly group requests based on the specific application requirements of the request sources. For example, in an 8-channel DMA controller application scenario, six ordinary data transmission channels can be divided into a data group, and two high-real-time control channels can be divided into a control group, with corresponding parameters configured for each group. Furthermore, in complex systems containing more types of master devices, the group management module can be further expanded to three or more arbitration groups; for instance, urgent interruption request sources can be separately divided into a high-priority real-time group, while other ordinary request sources can be divided into other groups.
[0033] Through the above-mentioned pre-configuration, the group management module of the present invention can realize flexible configuration of group rules and various parameters. Its beneficial effect is that the system can adapt to various multi-source concurrent digital systems with 2 to 32 request sources without modifying the hardware RTL code. Adaptation can be completed only through software or register configuration, thereby greatly reducing the complexity and cost of system porting and upgrading.
[0034] At the rising edge of each clock cycle, the system captures request signals from all request sources (including the four AXI channels and six RISC-V subcores) in real time. For each request signal, the system determines its validity—for example, in the AXI bus protocol, this is determined by detecting a high valid signal and a completed ready signal interaction. After marking valid requests, the system automatically assigns them to the corresponding arbitration group (data group or control group) based on their source channel.
[0035] Step 2: First-level intra-group arbitration – parallel execution.
[0036] This step aims to perform a first-level screening of requests within each arbitration panel, quickly reducing a large number of concurrent requests to a single winning request for each arbitration panel.
[0037] Specifically, the arbitration modules within each arbitration group execute arbitration in parallel within the same clock cycle. Each module receives all valid requests from its group and, based on the group's pre-configured arbitration strategy, selects a winning request from the group's requesting sources. This step is completed strictly within one clock cycle, and each arbitration group outputs one winning request.
[0038] In the preferred embodiment (4 AXI channels + 6 RISC-V subcores), the intra-group arbitration module of the data group adopts a polling arbitration strategy. The polling arbitrator maintains a current polling pointer. In each clock cycle, the arbitrator selects the next channel currently pointed to by the polling pointer as the intra-group winner from all requesting AXI channels, and then moves the polling pointer to the next channel. If a channel has no valid request, it is automatically skipped. For example, assuming the current polling pointer points to AXI channel 2 and has a request, while AXI channels 1 and 3 also have requests, AXI channel 2 is selected as the winner, and the polling pointer then moves to AXI channel 3.
[0039] In an alternative embodiment, the intra-group arbitration module of the data group can also employ a weighted round-robin arbitration strategy, assigning different weights to different data channels. For example, channels requiring higher bandwidth can be assigned greater weights to gain more service opportunities. Weighted round-robin can be implemented by configuring an independent weight counter for each channel. Each channel's weight counter is decremented by 1 after it wins, and when the counter reaches zero, the channel is automatically skipped and the next round begins.
[0040] Meanwhile, the intra-group arbitration module of the control group adopts a fixed-priority arbitration strategy. The fixed-priority arbitrator maintains a pre-configured priority table (for example, the configuration command of sub-core 0 has the highest priority, followed by sub-core 1 and sub-core 2, and the remaining sub-cores have the lowest priority). In each clock cycle, the arbitrator selects the request with the highest priority from all requesting RISC-V sub-cores as the intra-group winner.
[0041] The beneficial effects of the aforementioned first-level intra-group parallel arbitration mechanism are as follows: First, by processing requests in parallel groups, a large number of request sources that originally needed to be processed in one arbitrator are distributed to multiple arbitration groups for parallel processing. The arbitration time is strictly controlled within one clock cycle, avoiding a linear increase in arbitration latency due to the increase in the number of request sources. Second, each group supports a maximum of 32 request sources for parallel arbitration, and the system as a whole supports a maximum of 32 request sources (assuming it is divided into 4 groups, with a maximum of 8 request sources in each group). Compared with the traditional single-level arbitrator (where the arbitration time increases significantly when there are more than 8 request sources), the throughput is significantly improved. Furthermore, by adopting differentiated arbitration strategies for groups with different request types—the data group uses round-robin to ensure fairness, and the control group uses fixed priority to ensure real-time performance—the dual requirements of "fairness" and "real-time" in multi-source concurrent scenarios are achieved, which is a technical effect that a single arbitration scheme cannot achieve.
[0042] Step 3: Second-level inter-group arbitration – dynamic priority adjudication.
[0043] This step aims to make a final ruling on all in-group winning claims output by the arbitration panel, select a single winner, and grant access.
[0044] Specifically, at the beginning of the next clock cycle, the inter-group arbitration module receives intra-group win requests from all intra-group arbitration modules. This module queries its internally maintained dynamic priority table, sorts all received intra-group win requests according to their current dynamic priority from highest to lowest, selects the highest-priority request as the final winner, and issues an access authorization signal for the bus or transmission path accordingly. This step is completed strictly within one clock cycle. Therefore, a complete arbitration decision (from the start of step two to the completion of step three) takes only two clock cycles in the worst case.
[0045] For example, in the preferred embodiment described above, assuming that in the first clock cycle, the polling arbitrator of the data group selects AXI channel 2 as the winning request within the group, while the fixed-priority arbitrator of the control group selects sub-core 0 as the winning request within the group. In the second clock cycle, the inter-group arbitrator receives both winning requests. It queries the dynamic priority table, and assuming that the dynamic priority of the current control command group is configured to be higher than that of the data group due to high real-time requirements, the arbitrator selects the request of sub-core 0 as the final winner and grants access rights to sub-core 0. If the current dynamic priority of the data group is higher than that of the control group (e.g., the control group has not had any valid requests for a long time, and its priority has been automatically downgraded), the arbitrator selects AXI channel 2 as the final winner.
[0046] The dynamic priority arbitration strategy adopted by the inter-group arbitration module includes the following dynamic adjustment rules: Rule 1: The priority of idle arbitration groups is automatically increased. When an arbitration group has no valid requests for N consecutive clock cycles, the system determines that the group is in an idle state, and its priority is automatically increased by one level. The benefit of this rule is that when a group is briefly idle and then receives a request again, it can obtain service opportunities more quickly, avoiding being continuously preempted by other active groups due to prolonged inactivity.
[0047] Rule 2: The priority of consecutively winning arbitration groups is automatically reduced. When an arbitration group wins consecutively a preset number M (e.g., M=3), its priority is automatically reduced by one level. The beneficial effect of this rule is to prevent a single group from monopolizing the bus for an extended period during sudden high loads, thus ensuring basic service opportunities for other groups.
[0048] Rule 3: When the number of consecutive wins by a high-bandwidth data group exceeds a preset threshold, its priority is progressively reduced. This rule is a more detailed implementation of Rule 2 for data groups. A threshold P for consecutive wins is set (e.g., P=5). After exceeding the threshold, the priority decreases by one level for each additional win, until it reaches the lowest priority. The beneficial effect of this rule is that during continuous high-intensity data group transmission, its priority is gradually reduced, providing opportunities for the control group and the starved group to intervene, thus preventing data groups from occupying the bus for extended periods and causing system imbalance.
[0049] Rule 4: When there are no valid requests in a control command group, its priority is automatically reduced. This rule causes the priority of control command groups to be reduced cycle by cycle or gradually to a base value during clock cycles without valid requests. The benefit of this rule is that when there is no real-time control requirement, bus bandwidth is actively given to data groups, maximizing the overall throughput of the system.
[0050] Rule 5: High-priority control command requests trigger priority escalation. When a high-priority control command request arrives (e.g., an emergency configuration command from subcore 0), the system detects the priority level of the request and triggers the escalation mechanism, raising the priority of the control command group in inter-group arbitration to the highest level within one clock cycle (e.g., directly raising it to a priority level higher than any current group), ensuring that the control command gains access within two clock cycles. The beneficial effect of this rule is that it meets the high response requirements of real-time control scenarios, and the maximum response latency of high-priority commands is controlled within 10 clock cycles (and can even be as low as 2-6 clock cycles under typical configurations), far lower than the latency of traditional polling schemes.
[0051] The inter-group arbitration module supports parallel arbitration for up to 8 arbitration groups, and the inter-group arbitration time is strictly one clock cycle.
[0052] The beneficial effect of the above-mentioned dynamic priority arbitration mechanism is that by introducing dynamic priority adjustment rules based on operating status, the system can respond to load changes of each group in real time, and adaptively optimize bandwidth allocation while ensuring real-time requirements, thereby maintaining the fairness balance of the system in long-term operation.
[0053] Step 4: Closed-loop feedback and hunger detection.
[0054] This step aims to monitor the service status of each request source in real time, promptly detect and respond to starvation phenomena, and update arbitration statistics to provide a basis for arbitration in the next cycle. This step is executed in parallel with steps two and three above, forming a complete closed-loop control system.
[0055] Specifically, in each clock cycle, the starvation detection module receives request signals and win signals from all request sources and updates its suspend counter independently for each request source. For a request source i, if its request signal is valid and access is not granted (i.e., the win signal is invalid) in the current cycle, its suspend counter cnt_i is incremented by 1; otherwise, cnt_i is cleared or remains unchanged.
[0056] In a preferred embodiment, the suspend counter cnt_i is implemented as a w-bit register, the choice of which depends on the maximum value of the starvation detection threshold. For example, if the maximum starvation detection threshold is 255, an 8-bit register can be used to store the value of cnt_i. This register is cleared upon system reset and updated on each rising clock edge according to the rules described above.
[0057] Subsequently, the hunger detection module compares the value of each cnt_i with the hunger detection threshold TH_i, which is pre-configured in the group management module and corresponds to the arbitration group to which the request source belongs. The threshold TH_i is a configurable parameter, and its value can be flexibly set according to the application scenario. A preferred range is to set TH_i within the following intervals: for latency-sensitive control command groups, the hunger detection threshold can be set to 10-20 clock cycles; for data transmission groups that can tolerate a certain delay, the hunger detection threshold can be set to 50-100 clock cycles. Once cnt_i >= TH_i, the hunger detection module immediately marks the request source as hungry (e.g., by setting the hunger flag register high) and sends the hunger flag signal to the group management module and the arbitration status update module.
[0058] Meanwhile, the arbitration status update module collects arbitration results (information on winning requests from each group) from the intra-group arbitration modules, the final arbitration results (information on the final winner and their group) from the inter-group arbitration modules, and hunger flag information from the hunger detection module. Based on this information, the module updates its internal statistical information database, including but not limited to: a list of cumulative wins for each group, consecutive wins for each group, cumulative service times for each request source, and cumulative hang time for each request source. Subsequently, the statistical information database sends the updated status data back to the intra-group and inter-group arbitration modules for dynamic adjustment in the next clock cycle's arbitration.
[0059] The beneficial effect of the above closed-loop feedback mechanism is that the arbitration status can respond to changes in system load in real time, realize a virtuous cycle of "run-detection-feedback-adjustment", and avoid fairness imbalance in long-term operation due to static configuration.
[0060] Step 5: Restoration of fairness and mandatory scheduling.
[0061] This step is a further extension of the hunger detection module, designed to implement priority compensation and forced scheduling for request sources that are in a hungry or long-term hungry state, ensuring that all request sources in the system can eventually obtain service and completely eliminate hunger.
[0062] When a request source is marked as starved, the fairness recovery mechanism is triggered, and the system performs the following series of recovery actions: Recovery Action 1: Increase the priority of the requesting source in its group arbitration. Specifically, for data groups using a round-robin arbitration strategy, the system increases the arbitration priority of the starved requesting source to the highest priority among all currently requesting sources. That is, in the next group arbitration, the round-robin arbitrator ignores the current polling pointer position and directly selects this starved source as the group winner. For control groups using a fixed-priority arbitration strategy, the system increases its priority within the group to the highest level, placing it first in the fixed-priority ranking.
[0063] Recovery Action Two: Increase the priority of the arbitration group to which the request originates in inter-group arbitration. Specifically, the system increases the priority of this group in the dynamic priority table for inter-group arbitration by one level (or several levels depending on the specific configuration, such as increasing it to one level higher than the current highest winning group), thereby ensuring that the group's intra-group winning requests are more likely to succeed in inter-group arbitration.
[0064] Recovery Action 3: Forced Scheduling After Timeout. This is the ultimate guarantee mechanism. The system sets an additional continuous starvation counter, starve_cnt_i, for each request source, recording the number of arbitration cycles in which the request source is continuously marked as starved. Whenever a request source is marked as starved, starve_cnt_i is incremented by 1; when it receives service, starve_cnt_i is reset to zero. When starve_cnt_i reaches the preset timeout threshold W (e.g., W=2 or 3), even if service is not obtained through the priority promotion mechanisms of Recovery Action 1 and Action 2, the system triggers the "forced scheduling after timeout" mechanism. Under the forced scheduling mechanism, in the inter-group arbitration of the next clock cycle, the inter-group arbitrator will directly select the winning request from the group to which the request source belongs as the final winner, granting access rights without further priority comparison and sorting. The timeout threshold W can be flexibly configured according to the system's fault tolerance requirements. For example, for high-reliability systems, it can be set to a smaller value (e.g., 2) to ensure faster starvation recovery; for ordinary systems, it can be set to a larger value (e.g., 5 or 10) to reduce the interference of forced scheduling on regular arbitration.
[0065] Once a starved request source finally gains access, the hunger detection module resets its suspend counter cnt_i and its continuous hunger counter starve_cnt_i to zero, and restores its intra-group priority and inter-group priority to their initial values. This avoids new fairness issues arising from a single hunger event causing the request source to enjoy excessively high priority for an extended period.
[0066] The beneficial effects of the aforementioned fairness restoration and forced scheduling mechanism are as follows: the system can automatically detect and resolve request starvation issues, completely avoiding data congestion and data source starvation. Actual test data shows that in a 10-source concurrent scenario, the system using this invention can achieve a 0% request packet loss rate, with a system fairness index reaching a maximum of 0.92 (the fairness index is calculated by normalizing the bandwidth usage of all request sources and then inversely mapping the variance or standard deviation of the bandwidth usage of each source; a higher value indicates better fairness, with 1 representing absolute fairness). In contrast, the fairness index of traditional fixed-priority arbitration schemes is typically only around 0.65, demonstrating a significant improvement. Furthermore, the starvation detection response time is only one clock cycle, enabling immediate triggering of the recovery mechanism after the starvation condition is met, exhibiting extremely strong real-time response capabilities.
[0067] To fully verify the technical effects of the present invention, end-to-end complete functional verification was performed on an FPGA verification platform.
[0068] In the preferred embodiment, a 10-source concurrent scenario with 4 AXI channels and 6 RISC-V sub-cores, the test was conducted according to the configuration and process described in steps one through five above. The actual test results showed that the system throughput reached 3.6 GB / s, and the average transmission latency was 18 clock cycles. In comparison, the traditional non-arbitration scheme had a throughput of only 1.2 GB / s, an average latency of 45 cycles, and a packet loss rate of 0.1% under the same test conditions; the traditional static priority arbitration scheme had a throughput of 2.1 GB / s, an average latency of 28 cycles, and a packet loss rate of 0%. The solution of this invention achieved a significant performance improvement of 1-2 times the throughput and a latency reduction of approximately 60%, while reducing the packet loss rate to 0%.
[0069] In another complete embodiment: an 8-channel DMA controller (6 ordinary data channels + 2 high real-time control channels), the configuration data group adopts a round-robin arbitration strategy, the control group adopts a fixed-priority arbitration strategy, the starvation detection threshold is set to 100 clock cycles, the consecutive win threshold is set to 3, and the timeout forced scheduling threshold is set to 2. The actual test results show that the average latency of the high real-time channels is only 6 clock cycles, and the minimum bandwidth ratio is not less than 20%; all 8 channels exhibit no starvation; and the total system throughput is 40% higher than the traditional round-robin arbitration scheme. The beneficial effect of this embodiment is that it simultaneously meets the low latency requirements of the high real-time channels and the fair access requirements of the ordinary data channels, verifying the adaptability and overall performance of this invention when handling differentiated request sources.
[0070] All core parameters of this invention support flexible configuration, allowing it to adapt to different application scenarios without modifying the hardware design.
[0071] Specifically, configurable parameters include, but are not limited to: the total number of request sources (supporting 2 to 32), the number of arbitration groups (supporting up to 8 groups), the arbitration strategy within each group (round-robin / fixed priority / weighted round-robin and other options), the priority value of request sources within each group (supporting configurable priority encoding), the starvation detection threshold for each request source or group (supporting independently configurable integer values), the threshold for triggering priority reduction after consecutive wins, and the threshold for triggering forced scheduling due to timeout. All these parameters can be configured by writing to registers via software, and the system will immediately run according to the new parameters after configuration.
[0072] In an optional extended implementation, the grouping rules can also employ a dynamic grouping strategy—that is, during system operation, the group management module automatically adjusts group members and parameters based on the real-time traffic characteristics of each request source, rather than being limited to the static configuration at power-on. The dynamic grouping strategy can be implemented by real-time statistics of indicators such as bandwidth usage and request frequency of each request source: for example, when the request frequency of a request source exceeds a preset dynamic threshold, the system switches it from the data group to the control group to improve its real-time response capability; when a request source has no requests for a long time, the system removes it from the current group to release arbitration resources. The dynamic grouping strategy further enhances the adaptive capability of this invention.
[0073] The beneficial effect of the configurability of the above parameters is that the arbitration method of the present invention has strong versatility and can be seamlessly adapted to various multi-source concurrent digital systems such as coarse-grained reconfigurable computing arrays (CGRA), multi-core processor clusters, multi-channel DMA controller arrays, and multi-master on-chip buses (such as AXI bus and AHB bus). Users only need to configure the parameters to complete the system adaptation without redesigning the hardware, which greatly reduces the industrial adaptation cost and product iteration cycle.
[0074] In summary, this invention provides a two-tiered dynamic fair arbitration method and system that balances efficiency, fairness, real-time performance, reliability, and strong versatility. Through the coordinated operation of the aforementioned steps, it thoroughly resolves many core pain points of existing arbitration technologies in multi-source concurrent scenarios. The core innovations of this invention are interdependent and inseparable, collectively constituting a complete technical solution distinct from existing technologies, possessing prominent substantive characteristics and significant progress.
[0075] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of the invention as set forth in the appended claims.
Claims
1. A two-level dynamic fair arbitration method for multi-source concurrent requests, characterized in that, include: The request sources are divided into at least two arbitration groups, including: dividing all request sources into a high-bandwidth data group and a control command group; the high-bandwidth data group adopts a round-robin arbitration strategy, and the control command group adopts a fixed-priority arbitration strategy; and configuring an independent intra-group arbitration strategy, priority, and starvation detection threshold for each arbitration group. The grouping rules adopt a dynamic grouping strategy: during system operation, the group management module automatically adjusts the group members and parameters based on the real-time traffic characteristics of each request source, rather than being limited to the static configuration at power-on; when the request frequency of a request source exceeds the preset dynamic threshold, the system will switch from the data group to the control group to improve its real-time response capability; when a request source has no requests for a long time, the system will remove it from the current group to release arbitration resources. The first-level arbitration is carried out in parallel for the requests within each arbitration panel, and one winning request within each panel is selected from each panel according to the panel's intra-panel arbitration strategy. For all selected winning requests within the group, a second-level arbitration is performed using a dynamic priority arbitration strategy to select a final winning request and grant access; the dynamic priority arbitration strategy includes: The priority of idle arbitration groups is automatically increased; The priority of an arbitration panel that wins consecutive awards is automatically reduced. When the number of consecutive wins of a high-bandwidth data group exceeds a preset threshold, its priority decreases step by step. The priority of a control command group is automatically reduced when there are no requests for a consecutive period of time. A high-priority control command request triggers a priority escalation and gains access within two clock cycles; The system monitors the request suspension time of each request source in real time. When the suspension time of any request source exceeds the pre-set starvation detection threshold of its arbitration group, a fairness restoration mechanism is triggered. This fairness restoration mechanism includes increasing the priority of the request source in intra-group arbitration and increasing the priority of its arbitration group in inter-group arbitration. Recovery Action 1: For data groups using a round-robin arbitration strategy, the system raises the arbitration priority of the starving request source to the highest priority among all currently requesting sources. That is, in the next arbitration within the group, the round-robin arbitrator ignores the current polling pointer position and directly selects the starving source as the winner within the group. For control groups using a fixed-priority arbitration strategy, the system raises its priority within the group to the highest level, making it the first in the fixed-priority sort. Recovery Action 2: The system raises the priority of this group in the inter-group arbitration dynamic priority table by one level, thereby ensuring that the group's intra-group winning request is more likely to win in inter-group arbitration; Recovery Action 3: The system sets an additional continuous starvation counter, starve_cnt_i, for each request source to record the number of arbitration cycles in which the request source is continuously marked as starved. Each time a request source is marked as starved, starve_cnt_i is incremented by 1; when it receives service, starve_cnt_i is reset to zero. When starve_cnt_i reaches the preset timeout threshold W, even if service is not obtained through the priority promotion mechanisms of Recovery Action 1 and Action 2, the system triggers a timeout forced scheduling mechanism. Under this mechanism, in the inter-group arbitration of the next clock cycle, the inter-group arbitrator will directly select the winning request from the group to which the request source belongs as the final winner, granting access rights without further priority comparison and sorting. The timeout threshold W can be flexibly configured according to the system's fault tolerance requirements. For high-reliability systems, a smaller value can be set to ensure faster starvation recovery; for ordinary systems, a larger value can be set to reduce the interference of forced scheduling on regular arbitration. Once the hungry request source finally gains access, the hunger detection module clears its suspend counter cnt_i, clears its continuous hunger counter starve_cnt_i, and restores the intra-group priority and inter-group priority to their initial values. The fairness restoration mechanism also includes: when the same request source is marked as exceeding the hunger detection threshold multiple times in a row, a timeout forced scheduling mechanism is triggered, and it is directly granted access to the next clock cycle; after the request source obtains access, its suspend counter is cleared and its priority is restored to the initial value.
2. The method according to claim 1, characterized in that, In the first level of arbitration, each arbitration panel supports parallel arbitration of multiple request sources; The arbitration within each arbitration panel is conducted in parallel and each takes one clock cycle.
3. The method according to claim 1, characterized in that, The real-time monitoring of the request suspension time for each request source is specifically implemented as follows: an independent suspension counter is configured for each request source. When the request is valid but access is not granted, the counter increments by 1 every clock cycle. The counter is reset to zero after the request is successful.
4. The method according to claim 1, characterized in that, The hunger detection response time is 1 clock cycle, the fairness index is up to 0.92, and the request packet loss rate is 0%.
5. The method according to claim 1, characterized in that, The total time for a single round of complete first-level and second-level arbitration is 2 clock cycles.
6. The method according to claim 1, characterized in that, The number of request sources, grouping rules, intra-group arbitration strategy, priority value, and hunger detection threshold are all configurable parameters, supporting full-scenario adaptation for multiple request sources. Each arbitration group supports parallel arbitration of multiple request sources.
7. A two-level dynamic fair arbitration system for multi-source concurrent requests, characterized in that, The system is used to perform the method according to any one of claims 1-6, the system comprising: The group management module is used to divide multiple concurrent request sources into at least two arbitration groups and configure independent intra-group arbitration strategies and starvation detection thresholds for each arbitration group. Multiple intra-group arbitration modules are used to receive requests from within their respective groups and execute first-level arbitration in parallel, selecting a winning request from each arbitration group based on the intra-group arbitration strategy. The inter-group arbitration module is used to receive all winning requests within a group and execute a second-level arbitration using a dynamic priority arbitration strategy to select a final winning request and grant access. The hunger detection module monitors the request suspension time of each request source in real time. When the suspension time of any request source exceeds the hunger detection threshold preset by the arbitration group to which it belongs, the fairness restoration mechanism is triggered. The fairness restoration mechanism includes increasing the priority of the request source in intra-group arbitration and increasing the priority of the arbitration group to which it belongs in inter-group arbitration. The arbitration status update module is connected to the intra-group arbitration module, inter-group arbitration module, and hunger detection module, respectively. It is used to collect arbitration results and hunger status, update arbitration statistics, and feed them back to each module.
Citation Information
Patent Citations
Bus arbitration device
CN101038574A
Method and device for arbitrating dynamic priority
CN101887382A