Asymmetric weight arbitration apparatus and method
Patent Information
- Application Number
- CN202611171718.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]有鉴于此,本发明提供了一种非对称权重仲裁装置及方法,以解决端口的公平性不足的问题
[0015]本发明实施例提供的非对称权重仲裁装置,包括:请求预处理模块、排序模块、优先级截取模块以及仲裁结果反馈模块,其中,请求预处理模块用于接收多路输入请求,并根据每路输入请求的有效状态、动态权重值和基础权重值,确定每路对应的拼接权重值;排序模块与请求预处理模块连接,用于对多路输入请求对应的拼接权重值进行排序,输出降序排列的权重序列;优先级截取模块与排序模块连接,用于从权重序列中提取前预设数量的权重值对应的输入请求,作为当前仲裁周期的仲裁结果输出;多路输入请求的总数大于预设数量;仲裁结果反馈模块分别与排序模块和请求预处理模块连接,用于根据权重序列中各输入请求的排序位置,更新各路输入请求的动态权重值。本申请提供的非对称权重仲裁装置,通过对多路输入请求对应的拼接权重值进行排序,依据排序结果从多路请求中选择前多路进行授权,在授权后对各路的拼接权重值进行调整,从而实现各请求源在多次仲裁周期之间获得相对均衡的服务机会,避免低优先级请求长期无法获得资源的情况,提高请求处理的公平性。
Smart Images

Figure CN122925280A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital integrated circuit technology, and specifically to an asymmetric weight arbitration device and method. Background Technology
[0002] In digital chip design, when multiple request sources compete for limited resources, an arbitrator is needed to allocate resources. A typical asymmetric arbitration scenario requires the arbitrator to select N requests from M input requests each cycle based on priority and grant resource access permissions (M>N). Examples include multi-core processors sharing cache resources and multi-port scheduling in network switching chips.
[0003] Commonly used arbitration schemes in related technologies achieve fair scheduling by authorizing each input port in a round-robin fashion. However, because the round-robin is in a fixed order, it is impossible to distinguish the priority differences of services on each port, and the arbitration cycle becomes longer as the number of ports increases. Another approach is to assign a fixed priority to each port and always authorize the highest priority request. However, since low-priority requests cannot be served for a long time when high-priority requests persist, fairness among ports cannot be guaranteed. Summary of the Invention
[0004] In view of this, the present invention provides an asymmetric weighted arbitration device and method to solve the problem of insufficient fairness of ports.
[0005] In a first aspect, the present invention provides an asymmetric weighted arbitration device, the device comprising: The request preprocessing module is used to receive multiple input requests and determine the corresponding splicing weight value for each input request based on the valid status, dynamic weight value, and basic weight value of each input request. The sorting module, connected to the request preprocessing module, is used to sort the concatenated weight values corresponding to multiple input requests and output a weight sequence in descending order. A priority extraction module, connected to the sorting module, is used to extract the input requests corresponding to the first preset number of weight values from the weight sequence, and output them as the arbitration result of the current arbitration cycle; the total number of the multiple input requests is greater than the preset number; The arbitration result feedback module is connected to the sorting module and the request preprocessing module respectively, and is used to update the dynamic weight value of each input request according to the sorting position of each input request in the weight sequence.
[0006] In one optional implementation, updating the dynamic weight value of each input request according to its sorting position in the weight sequence includes: The dynamic weight value of input requests whose sorting position is after the preset number is increased based on a preset adjustment value; The dynamic weight values of input requests whose sorting positions are less than or equal to the preset number are cleared to zero.
[0007] In one alternative implementation, the base weight values are updated as follows: If a new request is generated for any input request, the corresponding base weight value is increased. If any input request is successfully arbitrated, the corresponding base weight value is reduced. If any input request fails to arbitrate, the corresponding base weight value is increased.
[0008] In one optional implementation, the sorting module includes: The first submodule is used to merge two adjacent sequences with opposite monotonicity, using the concatenation weight values of adjacent input requests as monotonically increasing and monotonically decreasing sequences respectively, to generate a bitoneic sequence. The second submodule is used to output a weighted sequence arranged in descending order based on the bitonic sequence.
[0009] In one optional implementation, the step of outputting a descending weight sequence based on the bitonic sequence includes: The bitone sequence is divided into a first half sequence and a second half sequence; Each splicing weight value in the first half of the sequence is compared one-to-one with the splicing weight value at the corresponding position in the second half of the sequence; The larger value obtained from each comparison is assigned to the maximum value sequence, and the smaller value is assigned to the minimum value sequence. The descending weight sequence is obtained by recursively processing the maximum value sequence and the minimum value sequence.
[0010] In one optional implementation, the valid state is located in the highest bit and is used to identify whether there is an pending request in the current period; the dynamic weight value is located in the middle bit; and the basic weight value is located in the lowest bit.
[0011] Secondly, the present invention provides an asymmetric weighted arbitration method, the method comprising: Receive multiple input requests and generate a corresponding concatenation weight value for each input request based on its valid status, dynamic weight value, and basic weight value. Sort the multiple concatenated weight values corresponding to the multi-channel input requests and output a weight sequence in descending order; The input requests corresponding to the first preset number of weight values are extracted from the descending weight sequence and output as the arbitration result of the current arbitration cycle; the total number of the multiple input requests is greater than the preset number. The dynamic weight value of each input request is updated according to the sorting position of each input request in the descending weight sequence.
[0012] In one optional implementation, updating the dynamic weight value of each input request based on its sorting position in the descendingly ordered weight sequence includes: The dynamic weight value of input requests whose sorting position is after the preset number is increased based on a preset adjustment value; The dynamic weight values of input requests whose sorting positions are less than or equal to the preset number are cleared to zero.
[0013] In one alternative implementation, the base weight values are updated as follows: If a new request is generated for any input request, the corresponding base weight value is increased. If any input request is successfully arbitrated, the corresponding base weight value is reduced. If any input request fails to arbitrate, the corresponding base weight value is increased.
[0014] In one optional implementation, the valid state is located in the highest bit and is used to identify whether there is an pending request in the current period; the dynamic weight value is located in the middle bit; and the basic weight value is located in the lowest bit.
[0015] The asymmetric weighted arbitration device provided in this embodiment of the invention includes: a request preprocessing module, a sorting module, a priority extraction module, and an arbitration result feedback module. The request preprocessing module receives multiple input requests and determines the corresponding concatenated weight value for each input request based on its valid status, dynamic weight value, and basic weight value. The sorting module, connected to the request preprocessing module, sorts the concatenated weight values corresponding to the multiple input requests and outputs a descending weight sequence. The priority extraction module, connected to the sorting module, extracts the input requests corresponding to the first preset number of weight values from the weight sequence as the arbitration result output for the current arbitration cycle. The total number of multiple input requests is greater than the preset number. The arbitration result feedback module, connected to both the sorting module and the request preprocessing module, updates the dynamic weight value of each input request based on its sorting position in the weight sequence. The asymmetric weighted arbitration device provided in this application sorts the concatenation weight values corresponding to multiple input requests, selects the top multiple requests for authorization based on the sorting results, and adjusts the concatenation weight values of each request after authorization. This enables each request source to obtain a relatively balanced service opportunity across multiple arbitration cycles, avoids situations where low-priority requests cannot obtain resources for a long time, and improves the fairness of request processing. Attached Figure Description
[0016] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram of an asymmetric weight arbitration device according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the splicing weight values according to an embodiment of the present invention; Figure 3 This is a flowchart illustrating the asymmetric weight arbitration method according to an embodiment of the present invention; Figure 4 This is a timing diagram of the arbitration process according to an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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] In digital chip design, when multiple request sources compete for limited resources, an arbitrator is needed to allocate resources. Typical asymmetric arbitration scenarios require the arbitrator to select N requests from M input requests each cycle, granting them resource access permissions based on priority (M>N). Examples include multiple processing cores in a multi-core processor competing for shared cache resources, multiple input ports in a network switching chip competing for a limited number of output ports, or multiple computing units in an AI acceleration chip competing for storage bandwidth.
[0020] In related technologies, arbitration is typically conducted by maintaining priority parameters for each request source. However, in such schemes, the priority is fixed once assigned, or although there is an adjustment mechanism, it lacks protection against starvation. Low-priority requests face the risk of not being able to obtain resource authorization for a long time when high-priority requests persist, resulting in insufficient system fairness. Based on this, this application provides an asymmetric weighted arbitration device.
[0021] This embodiment provides an asymmetric weight arbitration device, comprising: a request preprocessing module, a sorting module, a priority extraction module, and an arbitration result feedback module. The request preprocessing module receives multiple input requests and determines the corresponding concatenated weight value for each input request based on its valid status, dynamic weight value, and basic weight value. The sorting module, connected to the request preprocessing module, sorts the concatenated weight values corresponding to the multiple input requests and outputs a descending weight sequence. The priority extraction module, connected to the sorting module, extracts the input requests corresponding to the first preset number of weight values from the weight sequence as the arbitration result output for the current arbitration cycle. The total number of multiple input requests is greater than the preset number. The arbitration result feedback module, connected to both the sorting module and the request preprocessing module, updates the dynamic weight value of each input request based on its sorting position in the weight sequence.
[0022] like Figure 1 As shown, the request preprocessing module receives multiple input requests Req0, Req1, Req2, Req3, ..., ReqM-1, and determines the corresponding concatenation weight value for each request based on its validity status, dynamic weight value, and base weight value. The input requests are resource access requests sent by various request sources, such as shared cache access requests sent by processing cores in a multi-core processor, data packet transmission requests sent by input ports in a network switching chip, or storage bandwidth access requests sent by computing units in an AI acceleration chip. Each input request is independent, and multiple valid requests may exist simultaneously within the same arbitration cycle.
[0023] The valid status indicates whether there are any pending requests in the current period. If an input request is currently in a valid status (e.g., Valid=1), it means that there are pending requests on that path, and these requests will participate in the sorting of the current arbitration period. If an input request is currently in an invalid status (e.g., Valid=0), it means that there are no pending requests on that path, and these requests will not participate in the sorting of the current arbitration period. For invalid requests, their corresponding concatenation weight value can be set to the minimum value or encoded with a preset invalid value to ensure that they are not selected by the priority truncation module.
[0024] The dynamic weight value represents the accumulated priority compensation value for a corresponding input request that has not been arbitrated. At the end of each arbitration cycle, for requests not selected in that round, their dynamic weight value increases by a preset step value to improve their probability of being selected in the next cycle; for requests selected in that round, their dynamic weight value is reset to zero. By accumulating and resetting the dynamic weight value, a relatively balanced service opportunity can be achieved for each request source across multiple arbitration cycles, preventing some requests from being denied authorization for an extended period. The base weight value represents the cumulative number of pending requests corresponding to the input request.
[0025] The request preprocessing module concatenates the valid states, dynamic weight values, and basic weight values to obtain a concatenated weight value. The concatenated weight value represents the arbitration priority of the request. The larger the value, the higher the priority of the request in the current arbitration cycle. It is more likely to be ranked at the front in the sorting module and thus be selected by the priority interception module.
[0026] splicing weight values such as Figure 2 As shown, the bit width of the concatenated weight value is the sum of the bit widths of the valid state, dynamic weight, and basic weight. The valid state is located in the highest bit, used to indicate whether there are any pending requests in the current period; the dynamic weight is located in the middle bit; and the basic weight is located in the lowest bit. Taking any one of the multiple input requests as an example, the valid state of that request is placed in the highest valid bit, the dynamic weight is placed in the second highest bit, and the basic weight is placed in the lowest valid bit, together forming a complete concatenated weight value. The concatenated weight value serves as the input to the sorting module and participates in subsequent sorting comparison operations. Since the valid state is located in the highest bit, when the valid state is 0, regardless of the values of the dynamic and basic weights, the concatenated weight value of that request is less than any request with a valid state of 1, thus ensuring that invalid requests do not affect the sorting results among valid requests.
[0027] In some optional implementations, the base weight value is updated as follows: if a new request exists for any input request, the corresponding base weight value is increased; if arbitration of any input request is successful, the corresponding base weight value is decreased; if arbitration of any input request fails, the corresponding base weight value is increased.
[0028] If a new request arrives at any input request source, the corresponding base weight value is increased. Specifically, when a new resource access request arrives at a certain input request source, it indicates that the number of pending tasks on that path has increased, and its priority weight in subsequent arbitration needs to be increased. Therefore, the base weight value of that path is increased by 1 in the current cycle or the next cycle, or a preset base step value is increased.
[0029] If any input request is successfully arbitrated, the corresponding base weight value is reduced. Specifically, when an input request is selected and successfully granted resource authorization in this arbitration cycle, it indicates that one pending request for that path has been processed, and the length of the pending queue is reduced. Therefore, at the end of the current arbitration cycle, the base weight value of that path is reduced by 1, or the preset base step value is reduced.
[0030] If any input request fails to be arbitrated, the corresponding base weight value is increased. Specifically, if an input request participates in arbitration in this arbitration cycle but is not selected, it indicates that there are pending requests on that path that have not yet been served. The request will continue to wait, and the pressure of pending processing has not been relieved. Therefore, at the end of the current arbitration cycle, the base weight value of that path is increased by 1, or a preset base step value is increased, thereby increasing the probability that the path will be selected in the next arbitration cycle.
[0031] In some optional implementations, the base weight value is adjusted in increments of 1 unit: the base weight value is incremented by 1 when a new request arrives, decremented by 1 when arbitration succeeds, and incremented by 1 when arbitration fails. Each adjustment operation is independent. If multiple triggering events occur simultaneously on the same path within the same period, they are calculated separately according to their respective rules and then merged for updating. The minimum value of the base weight value is 0. When the base weight value is already 0, no further decrementing is performed to avoid negative values.
[0032] It should be noted that the update of the basic weight value is performed by the arbitration result feedback module at the end of each arbitration cycle based on the arbitration result of the current cycle, and its update operation is independent of the update operation of the dynamic weight value.
[0033] The sorting module is Figure 1The core network of the sorting module in this paper is a bitonic sorting module. It sorts multiple concatenated weight values based on a bitonic sorting algorithm. A bitonic sequence is a sequence in which elements first monotonically increase and then monotonically decrease, or first monotonically decrease and then monotonically increase. By dividing the bitonic sequence into two equal halves and comparing and exchanging corresponding elements in each half, larger values are grouped to one side and smaller values to the other, while the resulting subsequences retain their bitonic property. Repeating this splitting and comparison / exchange operation until the subsequence length is 1 transforms the original bitonic sequence into a completely ordered sequence. For any unordered input sequence, it can be converted into a bitonic sequence by merging adjacent sequences with opposite monotonicity, and then sorted using the method described above. The sorting module consists of multiple comparison / exchange units connected in a fixed topology. The comparison / exchange unit is the basic operating unit of the sorting module, used to compare two input values and output the larger value from its high-priority port and the smaller value from its low-priority port. By cascading multiple comparison and exchange units, each stage performs comparison and exchange operations on multiple data pairs simultaneously, gradually narrowing the range of disordered data, and finally outputting a completely descending weight sequence at the final stage. Taking the total number of multiple input requests as M as an example, the sorting module first performs a bitonic sequence generation operation on the M concatenated weight values, merging adjacent sequences into bitonic sequences of increasing length step by step; then, it sorts the generated bitonic sequences, obtaining a completely descending weight sequence through step-by-step splitting and comparison and exchange. The entire sorting process requires the number of stages on the order of log2M, with each stage capable of processing multiple sets of comparison and exchange operations simultaneously.
[0034] In some optional implementations, pipelined registers can be provided between the comparison and exchange units of each stage of the sorting module. By inserting registers for staking between multiple stages of combinational logic, the overall combinational logic path is divided into multiple sub-paths, reducing the depth of each stage of combinational logic and enabling the device to operate stably at high clock frequencies. The pipelined structure allows a new set of concatenation weight values to be input in each clock cycle and the corresponding sorting result to be output after several cycles. Each stage of the pipeline works in parallel, and the overall throughput of the device does not decrease with the increase of the number of pipeline stages.
[0035] The descending weight sequence output by the sorting module is sent to the priority extraction module and the arbitration result feedback module, respectively. In the descending weight sequence, input requests with higher weight values have higher arbitration priority, while those with lower weight values have lower arbitration priority. The sorting result determines the position of each input request in this round of arbitration, allowing the priority extraction module to extract a preset number of arbitration results, and providing the arbitration result feedback module with the information to update the dynamic weight values of each input request.
[0036] In some optional implementations, the sorting module includes a first submodule and a second submodule, wherein the first submodule is used to merge two adjacent sequences with opposite monotonicity, using the concatenated weight values of adjacent input requests as monotonically increasing and monotonically decreasing sequences respectively, to generate a bitonetic sequence; the second submodule is used to output a weight sequence arranged in descending order based on the bitonetic sequence.
[0037] The first submodule is Figure 1 The bitonic sequence generation submodule (Bitonic Merge) in the first submodule includes multiple levels of comparison and exchange units (case units). Adjacent comparison and exchange units in each level operate in opposite directions, allowing smaller weight values to be concentrated on one side and larger weight values on the other during the merging process, thus gradually forming a bitonic sequence of increasing length. Stage 1, Stage 2, up to Stage logM-1 in the first submodule represent each stage of processing within the first submodule. The length of the output sequence at each stage doubles progressively, ultimately generating a bitonic sequence of length M.
[0038] The second submodule is... Figure 1 The Bitonic Sort submodule receives the bitonic sequence generated by the first submodule and uses a multi-level comparison and exchange unit to split and compare the input bitonic sequence level by level, gradually reducing the disordered range. The topological connection relationship between each level is maintained. After log2M level processing, the weighted sequence is output in descending order.
[0039] In some optional implementations, the second submodule outputs a descending weight sequence based on the bitonic sequence, including: dividing the bitonic sequence into a first half and a second half; comparing each concatenated weight value in the first half with the concatenated weight value at the corresponding position in the second half; assigning the larger value obtained from each comparison to the maximum value sequence and the smaller value to the minimum value sequence; and performing recursive processing based on the maximum value sequence and the minimum value sequence to obtain the descending weight sequence.
[0040] Specifically, taking a bitone sequence of length 2n as an example, the bitone sequence is divided into a first half sequence X of length n and a second half sequence Y of length n. The first half sequence X includes the 1st to nth elements of the original sequence, and the second half sequence Y includes the (n+1)th to 2nth elements of the original sequence. The i-th element of X is compared with the i-th element of Y, where i = 1, 2, ..., n, i.e., X1 is compared with Y1, X2 with Y2, ..., X... n With Y n The comparison involves a total of n comparison operations. These n comparison operations are executed in parallel at the same level. For each comparison, if X... i ≥Y i Then Xi Substitute into the maximum value sequence, Y i If X is included in the minimum value sequence; i <Y i Then Y i Substitute into the maximum value sequence, X i Substitute into the minimum value sequence. After all n comparisons are completed, we obtain the maximum value sequence containing n elements and the minimum value sequence MIN containing n elements.
[0041] The maximum and minimum value sequences are treated as new sequences to be processed. The above steps are repeated for each: the maximum value sequence is divided into a first half and a second half, and corresponding positions are compared and merged; the minimum value sequence is also divided into a first half and a second half, and corresponding positions are compared and merged. Each recursive process halves the length of the current sequence to be processed and doubles the number of subsequences, while each subsequence retains its bitonicity. This recursive operation continues until the length of the resulting subsequence is 1. When all subsequences have a length of 1, all subsequences obtained after the recursion are merged according to the merging relationships established during the recursion, resulting in a weighted sequence arranged in descending order.
[0042] In some alternative implementations, the sorting module is not limited to the implementation of a bitonic sorting network. Its specific implementation can be selected by those skilled in the art based on the area, timing and delay requirements of the actual application scenario, such as an odd-even merge sorting network or a Shear sorting network.
[0043] Priority interception module Figure 1 The first N selector, connected to the sorting module, is used to extract the input requests corresponding to the first preset number of weight values from the descendingly sorted weight sequence, as the arbitration result output for the current arbitration cycle. The total number M of multiple input requests is greater than the preset number, thus achieving M-in-N-out asymmetric arbitration. Figure 1 As shown, the priority extraction module is located after the sorting module. Its input receives the descending weight sequence output by the sorting module, and its output outputs N arbitration authorization signals.
[0044] Specifically, in the descending weight sequence output by the sorting module, the weight values are arranged in descending order, with the input request corresponding to the weight value that appears earlier in the sequence having a higher arbitration priority. The priority extraction module extracts the first N weight values (i.e., the weight values at positions 1 to N) from this descending weight sequence based on a preset number N, and determines the input request corresponding to each of these N weight values. These N input requests constitute the requests for resource access permissions in the current arbitration cycle, and the priority extraction module outputs them as the arbitration result for the current arbitration cycle.
[0045] For input requests with weight values that are ranked after the Nth position (i.e., ranked greater than N), authorization is not granted in the current arbitration cycle. These requests will continue to participate in arbitration in subsequent cycles. Through this method, the priority truncation module selects the N highest priority requests from the M input requests to grant resource access permissions, completing the selection phase of asymmetric arbitration. The arbitration result output by the priority truncation module serves as the arbitration authorization signal for the current cycle, sent to downstream modules. Furthermore, the selection / unselection information for each request contained in the arbitration result is used to trigger the update operation of the subsequent arbitration result feedback module.
[0046] In some optional implementations, the dynamic weight value of each input request is updated according to the sorting position of each input request in the weight sequence, including: increasing the dynamic weight value of input requests whose sorting position is after a preset number based on a preset adjustment value; and clearing the dynamic weight value of input requests whose sorting position is less than or equal to a preset number.
[0047] For input requests whose sorting position exceeds a preset number, the corresponding dynamic weight value is increased based on a preset adjustment value. Specifically, when the concatenated weight value corresponding to a certain input request is after the Nth position in the descending weight sequence (i.e., the sorting position is greater than N), it indicates that the request was not selected by the priority interception module in this arbitration cycle and has not obtained resource authorization. In this case, the arbitration result feedback module increases the dynamic weight value of the request by the preset adjustment value (e.g., by 1) to improve its corresponding concatenated weight value in the next arbitration cycle, thereby increasing the probability that it will be ranked at the top by the sorting module and selected by the priority interception module. Through the above cumulative operation, the dynamic weight value of requests that have not been selected for a long time continues to increase, and their priority in the sorting continues to rise until their sorting position enters the top N and they are selected by the priority interception module.
[0048] For input requests whose sorting position is less than or equal to a preset number, the corresponding dynamic weight value is cleared to zero. Specifically, when the concatenated weight value corresponding to an input request is located at or before the Nth position in the descending weight sequence (i.e., sorting position ≤ N), it indicates that the request has been selected by the priority interception module in this arbitration cycle and has been granted resource authorization. In this case, the arbitration result feedback module clears the dynamic weight value of the request to zero, so that it can participate in arbitration in the next arbitration cycle with the initial priority state, releasing priority resources to other requests that have not yet been authorized.
[0049] Through the above update rules, the dynamic weight values of unselected requests accumulate gradually, and they will receive an increasing ranking priority in subsequent arbitration cycles; the dynamic weight values of selected requests are reset to zero, and they will no longer enjoy priority compensation accumulated due to historical waiting in subsequent arbitration cycles.
[0050] The asymmetric weighted arbitration device provided in this embodiment of the invention includes: a request preprocessing module, a sorting module, a priority extraction module, and an arbitration result feedback module. The request preprocessing module receives multiple input requests and determines the corresponding concatenated weight value for each input request based on its valid status, dynamic weight value, and basic weight value. The sorting module, connected to the request preprocessing module, sorts the concatenated weight values corresponding to the multiple input requests and outputs a descending weight sequence. The priority extraction module, connected to the sorting module, extracts the input requests corresponding to the first preset number of weight values from the weight sequence as the arbitration result output for the current arbitration cycle. The total number of multiple input requests is greater than the preset number. The arbitration result feedback module, connected to both the sorting module and the request preprocessing module, updates the dynamic weight value of each input request based on its sorting position in the weight sequence. The asymmetric weighted arbitration device provided in this application sorts the concatenation weight values corresponding to multiple input requests, selects the top multiple requests for authorization based on the sorting results, and adjusts the concatenation weight values of each request after authorization. This enables each request source to obtain a relatively balanced service opportunity across multiple arbitration cycles, avoids situations where low-priority requests cannot obtain resources for a long time, and improves the fairness of request processing.
[0051] According to an embodiment of the present invention, an embodiment of an asymmetric weighted arbitration method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0052] This embodiment provides an asymmetric weight arbitration method, which can be used in the aforementioned asymmetric weight arbitration device. Figure 3 This is a flowchart of the asymmetric weighted arbitration method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps: Step S301: Receive multiple input requests, and generate a corresponding splicing weight value for each input request based on its valid status, dynamic weight value, and basic weight value.
[0053] Executed by the request preprocessing module, this process receives multiple input requests (Req0, Req1, Req2, Req3, ..., ReqM-1). These input requests are resource access requests sent by various request sources, such as shared cache access requests sent by each processing core in a multi-core processor, data packet transmission requests sent by each input port in a network switching chip, or storage bandwidth access requests sent by each computing unit in an AI acceleration chip. Each input request is independent, and multiple valid requests may exist simultaneously within the same arbitration cycle.
[0054] Based on the valid status (Valid), dynamic weight value (Weight), and base weight value (Base) of each input request, a concatenated weight value is generated for each path. The valid status indicates whether there are any pending requests in the current period. If an input request is currently valid (e.g., Valid=1), it means there are pending requests in that path, and this request participates in the sorting of the current arbitration period. If an input request is currently invalid (e.g., Valid=0), it means there are no pending requests in that path, and this request does not participate in the sorting of the current arbitration period. The dynamic weight value represents the accumulated priority compensation value for the corresponding input request due to not being arbitrated. The base weight value represents the accumulated number of pending requests corresponding to the corresponding input request.
[0055] The effective states, dynamic weight values, and basic weight values are concatenated to obtain the concatenated weight value. The concatenated weight value represents the arbitration priority of the request by its numerical value. The larger the value, the higher the priority of the request in the current arbitration cycle.
[0056] The bit width of the concatenated weight value is the sum of the bit widths of the valid state, dynamic weight, and basic weight. The valid state is located in the highest bit and is used to indicate whether there are any pending requests in the current period; the dynamic weight value is located in the middle bit; and the basic weight value is located in the lowest bit. Because the valid state is located in the highest bit, when the valid state is 0, regardless of the values of the dynamic and basic weights, the concatenated weight value of this path will be less than any request with a valid state of 1, thus ensuring that invalid requests will not affect the sorting results among valid requests.
[0057] In some optional implementations, the base weight value is updated as follows: if a new request exists for any input request, the corresponding base weight value is increased; if arbitration of any input request is successful, the corresponding base weight value is decreased; if arbitration of any input request fails, the corresponding base weight value is increased.
[0058] Step S302: Sort the multiple concatenated weight values corresponding to the multiple input requests and output the weight sequence in descending order.
[0059] The sorting module utilizes a sorting network composed of multiple comparison and exchange units connected in a fixed topology to sort multiple concatenated weight values corresponding to multiple input requests in parallel, outputting a weight sequence in descending order. The basic operating unit of the sorting network is the comparison and exchange unit, which compares two input values and outputs the larger value from its high-priority port and the smaller value from its low-priority port. Through the cascading of multiple levels of comparison and exchange units, each level performs comparison and exchange operations on multiple data pairs simultaneously, gradually narrowing the range of disorder and ultimately outputting a weight sequence in completely descending order.
[0060] Taking a total of M input requests as an example, the process first involves generating a bitonic sequence from the M concatenated weight values, merging adjacent sequences into increasing bitonic sequences at each level. Then, the generated bitonic sequences are sorted through progressive splitting and comparison swaps to obtain a weight sequence in completely descending order. The entire sorting process requires approximately log₂M levels, with each level handling multiple sets of comparison swaps simultaneously.
[0061] In some alternative implementations, pipeline registers are provided between each stage of the sorting network. By inserting register staking between multiple stages of combinational logic, the overall combinational logic path is divided into multiple sub-paths, reducing the depth of each stage of combinational logic and enabling the method to operate stably at high clock frequencies.
[0062] In some alternative implementations, the specific implementation of the sorting network can be selected according to the area, timing and delay requirements of the actual application scenario, such as using a bitonic sorting network, an odd-even merge sorting network or a Shear sorting network.
[0063] Step S303: Extract the input requests corresponding to the preset number of weight values from the descending weight sequence and use them as the arbitration result output for the current arbitration cycle.
[0064] The total number of multiple input requests exceeds a preset number. In the sorted, descending weight sequence, the weight values are arranged in descending order, with input requests corresponding to weight values placed earlier in the sequence having higher arbitration priority. Based on a preset number N, the first N weight values (those ranked from 1st to Nth) are extracted from this descending weight sequence, and the input requests corresponding to these N weight values are determined. These N input requests constitute the requests for resource access permissions in the current arbitration cycle and are output as the arbitration result for that cycle. The total number M of multiple input requests exceeds the preset number N, achieving M-in-N-out asymmetric arbitration. Input requests corresponding to weight values ranked after the Nth position are not authorized in this arbitration cycle but will continue to participate in arbitration in subsequent cycles.
[0065] Step S304: Update the dynamic weight value of each input request according to the sorting position of each input request in the descending weight sequence.
[0066] Based on the sorting position of each input request in the descending weight sequence, determine whether each input request is selected in this round of arbitration, and update the dynamic weight value of each input request accordingly.
[0067] In some optional implementations, step S304 includes: increasing the dynamic weight value of input requests whose sorting position is after the preset number based on a preset adjustment value; and clearing the dynamic weight value of input requests whose sorting position is less than or equal to the preset number.
[0068] If the concatenated weight value corresponding to an input request is after the Nth position in the descending weight sequence (i.e., the ranking position is greater than N), it indicates that the request has not been selected or granted resource authorization in this arbitration cycle. The dynamic weight value of this request is increased by a preset adjustment value to improve its priority in the next arbitration cycle. If the concatenated weight value corresponding to an input request is at or before the Nth position in the descending weight sequence (i.e., the ranking position is ≤ N), it indicates that the request has been selected and granted resource authorization in this arbitration cycle. The dynamic weight value of this request is reset to zero. Through the above update rules, the dynamic weight values of unselected requests gradually accumulate, gaining progressively higher ranking priority in subsequent arbitration cycles; the dynamic weight values of selected requests are reset to zero, and they no longer enjoy priority compensation accumulated due to historical waiting in subsequent arbitration cycles. The updated dynamic weight values are used to generate new concatenated weight values in the next arbitration cycle to participate in a new round of ranking arbitration.
[0069] The arbitration process described above is illustrated below with a specific example. Taking four input requests (requests A, B, C, and D) and a preset quantity N=2 as an example, the complete process of five arbitration cycles from T1 to T5 is shown, where the arrival status of each request varies in different cycles.
[0070] Figure 4 This is a time sequence diagram showing the request input, weight value changes, and arbitration results for cycles T1 to T5 in the example above.
[0071] T1 Cycle: New requests exist for requests A, B, C, and D, all with a validity status of 1, dynamic weight of 0, and base weight of 1. The concatenated weight value has a valid bit of 1, dynamic weight of 0, and base weight of 1. The sorting module sorts these four concatenated weight values. Since the four weight values are identical, the sorting result is arbitrary (e.g., the default order is the original order of requests A, B, C, and D). The priority extraction module extracts the input requests corresponding to the first two weight values. Assuming requests A and B are selected, they are output as the arbitration result for T1 cycle; requests C and D are sorted later and are not selected. The arbitration result feedback module updates the dynamic weights according to the sorting position: if requests A and B are selected, their dynamic weights are cleared to zero (remaining 0); if requests C and D are not selected, their dynamic weights increase from 0 to 1.
[0072] T2 Cycle: New requests exist for requests A, B, C, and D. Requests A and B were selected in the previous cycle, their dynamic weights are reset to 0, and their base weights are 1. Requests C and D were not selected in the previous cycle, their dynamic weights are increased to 1, and their base weights are 2. Therefore, the combined weights for requests A and B are: valid bit 1, dynamic weight 0, base weight 1; the combined weights for requests C and D are: valid bit 1, dynamic weight 1, base weight 2. The sorting module compares these combined weight values. Since the dynamic weight is higher than the base weight, the combined weights for requests C and D are higher than those for requests A and B. Therefore, requests C and D are ranked first and second. The priority extraction module extracts the input requests corresponding to the first two weight values, i.e., requests C and D are selected and output as the arbitration result for T2 cycle; requests A and B are ranked later and were not authorized.
[0073] The arbitration result feedback module performs a weight update: the dynamic weights of successful arbitration requests C and D are reset to zero; the dynamic weights of unselected requests A and B are incremented by 1. Simultaneously, new requests arrive from all four channels, and the basic weights of each channel are updated synchronously. Finally, after the T2 cycle ends: the weights of requests A and B are (1,0,1), and the weights of requests C and D are updated to (1,1,2).
[0074] T3 cycle: No new requests are generated from the four inputs. After the T3 cycle ends: the weights of requests A and B are (1,1,1), and the weights of requests C and D are updated to (1,0,1).
[0075] T4 period: No new request input. After the T4 period ends: the weights of request A and request B are (0,0,0), and the weights of request C and request D are updated to (1,1,1).
[0076] T5 period: No new request input. After the T5 period ends: the weights of request A and request B are (0,0,0), and the weights of request C and request D are updated to (0,0,0).
[0077] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. An asymmetric weighted arbitration device, characterized in that, The device includes: The request preprocessing module is used to receive multiple input requests and determine the corresponding splicing weight value for each input request based on the valid status, dynamic weight value, and basic weight value of each input request. The sorting module, connected to the request preprocessing module, is used to sort the concatenated weight values corresponding to multiple input requests and output a weight sequence in descending order. A priority extraction module, connected to the sorting module, is used to extract the input requests corresponding to the first preset number of weight values from the weight sequence, and output them as the arbitration result of the current arbitration cycle; the total number of the multiple input requests is greater than the preset number; The arbitration result feedback module is connected to the sorting module and the request preprocessing module respectively, and is used to update the dynamic weight value of each input request according to the sorting position of each input request in the weight sequence.
2. The apparatus according to claim 1, characterized in that, The step of updating the dynamic weight value of each input request according to its sorting position in the weight sequence includes: The dynamic weight value of input requests whose sorting position is after the preset number is increased based on a preset adjustment value; The dynamic weight values of input requests whose sorting positions are less than or equal to the preset number are cleared to zero.
3. The apparatus according to claim 1, characterized in that, The basic weight values are updated as follows: If a new request is generated for any input request, the corresponding base weight value is increased. If any input request is successfully arbitrated, the corresponding base weight value is reduced. If any input request fails to arbitrate, the corresponding base weight value is increased.
4. The apparatus according to claim 1, characterized in that, The sorting module includes: The first submodule is used to merge two adjacent sequences with opposite monotonicity, using the concatenation weight values of adjacent input requests as monotonically increasing and monotonically decreasing sequences respectively, to generate a bitoneic sequence. The second submodule is used to output a weighted sequence arranged in descending order based on the bitonic sequence.
5. The apparatus according to claim 4, characterized in that, The weighted sequence output in descending order based on the bitonic sequence includes: The bitone sequence is divided into a first half sequence and a second half sequence; Each splicing weight value in the first half of the sequence is compared one-to-one with the splicing weight value at the corresponding position in the second half of the sequence. The larger value obtained from each comparison is assigned to the maximum value sequence, and the smaller value is assigned to the minimum value sequence. The descending weight sequence is obtained by recursively processing the maximum value sequence and the minimum value sequence.
6. The apparatus according to claim 1, characterized in that, The valid status is located in the highest bit and is used to identify whether there is an pending request in the current period; the dynamic weight value is located in the middle bit; and the basic weight value is located in the lowest bit.
7. An asymmetric weighted arbitration method, characterized in that, The method includes: Receive multiple input requests and generate a corresponding concatenation weight value for each input request based on its valid status, dynamic weight value, and basic weight value. Sort the multiple concatenated weight values corresponding to the multi-channel input requests and output a weight sequence in descending order; The input requests corresponding to the first preset number of weight values are extracted from the descending weight sequence and output as the arbitration result of the current arbitration cycle; the total number of the multiple input requests is greater than the preset number. The dynamic weight value of each input request is updated according to the sorting position of each input request in the descending weight sequence.
8. The method according to claim 7, characterized in that, The step of updating the dynamic weight value of each input request based on its sorting position in the descendingly ordered weight sequence includes: The dynamic weight value of input requests whose sorting position is after the preset number is increased based on a preset adjustment value; The dynamic weight values of input requests whose sorting positions are less than or equal to the preset number are cleared to zero.
9. The method according to claim 7, characterized in that, The basic weight values are updated as follows: If a new request is generated for any input request, the corresponding base weight value is increased. If any input request is successfully arbitrated, the corresponding base weight value is reduced. If any input request fails to arbitrate, the corresponding base weight value is increased.
10. The method according to claim 7, characterized in that, The valid status is located in the highest bit and is used to identify whether there is an pending request in the current period; the dynamic weight value is located in the middle bit; and the basic weight value is located in the lowest bit.