Arbiter, channel authorization method, electronic equipment and readable storage medium
By designing an arbiter including a configuration register, a request processing unit and an arbitration unit, and matching different arbitration modes according to the operating scenario, the problem of poor flexibility caused by a single channel authorization mode in the existing technology is solved, and more efficient channel authorization and Data transmission sequence is guaranteed.
Patent Information
- Application Number
- CN202410588502.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2024-08-23
AI Technical Summary
The existing arbiter has a single authorization mode in different channel request scenarios, resulting in poor flexibility in electronic device channel authorization and inability to effectively schedule and coordinate access requests of modules on the bus, making it difficult to guarantee the order and correctness of data transmission.
An arbiter is designed, including a configuration register, a request processing unit and an arbitration unit. It can match different target arbitration modes according to the current operating scenario, thereby flexibly determining authorization channel requests. It supports fixed priority arbitration, weighted round robin arbitration, and ordinary round robin. modes such as polling arbitration and alternating weighted polling arbitration.
It improves the flexibility and practicality of electronic equipment in channel authorization, can adaptively schedule channel requests according to different scenarios, reduces data loss and waste of idle time, and improves bus utilization.
Smart Images

Figure CN118535496A
Abstract
Description
Technical Field
[0001] The present application belongs to the field of chip technology, and specifically relates to an arbitrator, a channel authorization method, an electronic device and a readable storage medium. Background Art
[0002] Currently, in a chip, multiple modules access shared resources such as buses, memory, and peripheral interfaces. Taking the bus structure as an example, multiple modules competing for bus access rights at the same time will lead to confusion, waste of idle time, data loss, etc. In order to ensure the order and correctness of data transmission and improve the utilization of the bus, an arbitrator is usually used to schedule and coordinate the access requests of modules on the bus.
[0003] In the related art, electronic devices can use a fixed priority arbiter (FP) or a round robin arbiter (RR). The principle of a fixed priority arbiter is to configure a fixed priority for each channel. When a channel request occurs, the fixed priority arbiter will give priority to the request with the highest priority. The round robin arbiter cycles the priority of the channel request so that the channel sending the request has one chance to be authorized to access the bus in one cycle.
[0004] However, the current authorization mode of the arbitrator is single and not universal. For different channel request scenarios, one authorization mode cannot improve the flexibility and practicality of the electronic device, resulting in poor flexibility of the electronic device in channel authorization. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide an arbitrator, a channel authorization method, an electronic device, and a readable storage medium, which can improve the flexibility of the electronic device in performing channel authorization.
[0006] In a first aspect, an embodiment of the present application provides an arbitrator, the arbitrator comprising: a configuration register, a request processing unit and a first arbitration unit. The request processing unit is used to receive a first channel request signal, the first channel request signal comprising: N channel requests, and obtain first configuration information from the configuration register, the N channel requests correspond to N channels, and the first configuration information comprises N authorization priority weights corresponding one to one to the N channels. The request processing unit is used to send the first configuration information and the channel request to the first arbitration unit. The first arbitration unit is used to determine the authorized channel request from the N channel requests based on the received first configuration information and the channel resource request, and output the authorized channel request by adopting a target arbitration mode that matches the current operating scenario. Among them, the target arbitration mode comprises any one of the following: fixed priority arbitration, weighted polling arbitration, ordinary polling arbitration and alternating weighted polling arbitration.
[0007] In a second aspect, an embodiment of the present application provides a channel authorization method, which includes: receiving a first channel request signal, the first channel request signal includes: N channel requests, and obtaining first configuration information from a configuration register of an arbitrator, the N channel requests correspond to N channels, and the first configuration information includes N authorization priority weights corresponding one to one to the N channels; based on the first configuration information and the channel resource request, a target arbitration mode matching the current operating scenario is adopted, an authorized channel request is determined from the N channel requests, and the authorized channel request is output; wherein the target arbitration mode includes any one of the following: fixed priority arbitration, weighted polling arbitration, ordinary polling arbitration, and alternating weighted polling arbitration.
[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the second aspect are implemented.
[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the second aspect are implemented.
[0010] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the second aspect.
[0011] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the second aspect.
[0012] In an embodiment of the present application, the arbitrator includes: a configuration register, a request processing unit and a first arbitration unit; the request processing unit is used to receive a first channel request signal, the first channel request signal includes: N channel requests, and obtains first configuration information from the configuration register, the N channel requests correspond to the N channels, and the first configuration information includes N authorization priority weights corresponding to the N channels one by one; the request processing unit is used to send the first configuration information and the channel request to the first arbitration unit; the first arbitration unit is used to determine the authorized channel request from the N channel requests based on the received first configuration information and the channel resource request, using the target arbitration mode matching the current operation scenario, and output the authorized channel request; wherein the target arbitration mode includes any of the following: fixed priority arbitration, weighted polling arbitration, ordinary polling arbitration and alternating weighted polling arbitration. In this scheme, since the arbitrator can use the target arbitration mode matching the current operation scenario according to the current operation scenario, the arbitrator can use different target arbitration modes according to different operation scenarios to determine the authorized channel request from the N channel requests, and output the authorized channel request. In this way, the flexibility of the electronic device in channel authorization is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 This is one of the structural diagrams of an arbitrator provided in an embodiment of the present application;
[0014] Figure 2 This is the second structural diagram of an arbitrator provided in an embodiment of the present application;
[0015] Figure 3 This is the third structural diagram of an arbitrator provided in an embodiment of the present application;
[0016] Figure 4 This is a fourth structural diagram of an arbitrator provided in an embodiment of the present application;
[0017] Figure 5 This is a fifth structural diagram of an arbitrator provided in an embodiment of the present application;
[0018] Figure 6 This is the sixth structural diagram of an arbitrator provided in an embodiment of the present application;
[0019] Figure 7 This is the seventh structural diagram of an arbitrator provided in an embodiment of the present application;
[0020] Figure 8 This is the eighth structural diagram of an arbitrator provided in an embodiment of the present application;
[0021] Fig. 9 This is a ninth structural diagram of an arbitrator provided in an embodiment of the present application;
[0022] Fig.10 This is a tenth structural diagram of an arbitrator provided in an embodiment of the present application;
[0023] Fig.11 This is the eleventh structural diagram of an arbitrator provided in an embodiment of the present application;
[0024] Fig.12 This is a twelfth structural diagram of an arbitrator provided in an embodiment of the present application;
[0025] Fig.13 This is the thirteenth structural diagram of an arbitrator provided in an embodiment of the present application;
[0026] Fig.14 is a flow chart of a channel authorization method provided in an embodiment of the present application;
[0027] Fig.15 This is one of the hardware structure diagrams of an electronic device provided in an embodiment of the present application;
[0028] Fig.16 This is the second schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0030] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0031] The arbitrator, channel authorization method, electronic device and readable storage medium provided in the embodiments of the present application are described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0032] The arbitrator, channel authorization method, electronic device, and readable storage medium provided in the embodiments of the present application can be applied in channel request authorization.
[0033] Currently, in a chip, multiple modules access shared resources such as buses, memory, and peripheral interfaces. Taking the bus structure as an example, multiple modules competing for bus access rights at the same time will lead to confusion, waste of idle time, data loss, etc. In order to ensure the order and correctness of data transmission and improve the utilization of the bus, an arbitrator is usually used to schedule and coordinate the access requests of modules on the bus.
[0034] The common arbitrator schemes at present are mainly fixed priority arbitrators and polling arbitrators. The principle of fixed priority arbitrator is to configure a fixed priority for each channel. When a channel request occurs, the arbitrator will give priority to the request with the highest priority. The polling arbitrator cycles the priority of channel requests so that the channel sending the request has an opportunity to be authorized to access the bus in one cycle. Compared with the fixed priority arbitrator, the polling arbitrator is more fair in authorizing devices. In addition, based on the polling arbitrator, the weighted round-robin arbiter (Weighted Round Robin Arbiter, WRR) is derived. On the basis of the priority cycle, it adds weights to each channel. If the current channel is authorized and the number of authorizations is less than the weight, it will continue to be authorized until the number is equal to the weight, and the priority will be cycled to the next channel.
[0035] In this solution, since the arbitrator can use a target arbitration mode that matches the current operating scenario according to the current operating scenario, the arbitrator can use different target arbitration modes according to different operating scenarios to determine the authorized channel request from N channel requests and output the authorized channel request. In this way, the flexibility of the electronic device in performing channel authorization is improved.
[0036] The embodiment of the present application provides an arbitrator, Figure 1 FIG. 1 is a schematic diagram of an arbitrator provided in an embodiment of the present application. Figure 1 As shown, the arbitrator 10 provided in the embodiment of the present application includes: a configuration register 11 , a request processing unit 12 and a first arbitration unit 13 .
[0037] The request processing unit is used to receive a first channel request signal and obtain first configuration information from the configuration register 11 .
[0038] In the embodiment of the present application, the above-mentioned first channel request signal includes: N channels.
[0039] In the embodiment of the present application, the first configuration information includes N authorization priority weights corresponding one to one to the N channels.
[0040] In the embodiment of the present application, the first channel resource request includes channel request identifiers of N channel requests.
[0041] Optionally, in an embodiment of the present application, the above-mentioned configuration register may be an 8-bit configuration register or a 16-bit configuration register.
[0042] Exemplarily, the configuration register may be a data register.
[0043] The request processing unit 12 is used to send the first configuration information and the channel request to the first arbitration unit.
[0044] In the embodiment of the present application, the first arbitration unit 13 is used to determine an authorized channel request from N channel requests based on the received first configuration information and channel request, adopt a target arbitration mode matching the current operation scenario, and output the authorized channel request.
[0045] In the embodiment of the present application, the above-mentioned target arbitration mode includes any one of the following: fixed priority arbitration, weighted polling arbitration, ordinary polling arbitration and alternating weighted polling arbitration.
[0046] In the embodiment of the present application, the configuration register 11 is connected to the request processing module 12 , and the request processing module 12 is connected to the first arbitration unit 13 .
[0047] Optionally, in an embodiment of the present application, the configuration register 11 includes a first output port, a second output port and a reset port.
[0048] Among them, the first output port of the above-mentioned configuration register is used to output N authorization priority weights corresponding to N channels one by one; the second output port of the configuration register is used to output the target arbitration mode identifier of the target arbitration mode matching the current operating scenario; the reset port of the configuration register is used to clear the information in the configuration register.
[0049] Optionally, in the embodiment of the present application, the request processing unit 12 includes a first input port, a second input port and a third input port.
[0050] Among them, the first input port of the request processing unit 12 is used to receive a first channel resource request, the second input port of the request processing unit 12 is used to receive N authorization priority weights corresponding to the N channel requests sent by the configuration register 11, and the third input port of the request processing unit 12 is used to receive the target arbitration mode identifier of the target arbitration mode sent by the configuration register 11.
[0051] For example, in combination Figure 1 ,like Figure 2 As shown, in the request processing unit 12, through the first input port of the request processing unit 12, Figure 221 indicates that when receiving the first channel resource request, the central processing unit (CPU) can configure the target arbitration mode identifier corresponding to the target arbitration mode matching the current running scenario in the configuration register 11, and configure the N authorization priority weights of the N channels corresponding to the first channel resource request; then, the CPU controls the configuration register 11 through the first output port of the configuration register 11, Figure 2 Indicated by 22, the second input port of the request processing unit 12 is sent. Figure 2 23 indicates that N authorization priority values are sent; the CPU controls the second output port of the configuration register 11, Figure 2 Indicated by 24, the third input port of the request processing unit 12 is sent. Figure 2 25 represents the target arbitration mode identifier for sending the target arbitration mode.
[0052] Optionally, in the embodiment of the present application, the request processing module 12 further includes: a bus idle state port.
[0053] The above-mentioned bus idle state port is used when the bus is in a busy state. The CPU can control the bus idle state port to be pulled low, and the request processing unit 12 will shield the channel resource requests of all channels. Alternatively, when the bus is in an idle state, the CPU can pull the bus idle state port high, and the request processing unit 12 will receive the channel resource requests of all channels.
[0054] For example, in combination Figure 2 ,like Figure 3 As shown, the request processing module 12 further includes: a bus idle state port, Figure 3 It is represented by bus-idle.
[0055] In the embodiment of the present application, the first channel resource request may be used to request a public resource in an electronic device.
[0056] Exemplarily, the above-mentioned public resources include at least one of the following: bus resources, memory resources, IO (Input / Output) resources, storage resources, for example, hard disk storage resources.
[0057] Optionally, in the embodiment of the present application, combined with Figure 3 ,like Figure 4 As shown, the first arbitration unit 13 includes a first arbitration module 131 and a second arbitration module 132 .
[0058] In the embodiment of the present application, the request processing unit 12 is used to send a first channel request to the first arbitration module when the target arbitration mode is the first arbitration mode;
[0059] or,
[0060] The request processing unit 12 is configured to send the first configuration information and the first channel request to the second arbitration module when the target arbitration mode is the second arbitration mode.
[0061] In the embodiment of the present application, the arbitration mode of the first arbitration module is fixed priority arbitration, and the arbitration mode of the second arbitration module is any one of the following: weighted polling arbitration, ordinary polling arbitration and alternating weighted polling arbitration.
[0062] Optionally, in an embodiment of the present application, the request processing unit 12 includes a first output port, a second output port, a third output port and a fourth output port.
[0063] Among them, the first output port of the request processing unit 12 is used to send the first configuration information to the first arbitration module 131 and the second arbitration module 132 in the first arbitration unit 13, the second output port of the request processing unit 12 is used to select the second arbitration module and send the first channel resource request to the second arbitration module, the third output port of the request processing unit 12 is used to send the arbitration mode identifier corresponding to the second arbitration module to the second arbitration module, and the fourth output port in the request processing unit 12 is used to select the first arbitration module and send the first channel resource request to the first arbitration module.
[0064] Optionally, in the embodiment of the present application, the first arbitration module 131 includes: a first input port and a second input port.
[0065] The first input port of the first arbitration module 131 is used to receive the first configuration information sent by the request processing unit 12 , and the first input port of the first arbitration module 131 is used to receive the first channel resource request sent by the request processing unit 12 .
[0066] Optionally, in an embodiment of the present application, the second arbitration module includes: a first input port, a second input port and a third input port.
[0067] Among them, the first input port of the above-mentioned second arbitration module is used to receive the first configuration information sent by the request processing unit 12, the second input port of the second arbitration module is used to receive the first channel resource request sent by the request processing unit 12, and the third input port of the second arbitration module is used to receive the arbitration mode identifier corresponding to the second arbitration module sent by the request processing unit 12.
[0068] For example, in combination Figure 4 ,like Figure 5As shown, the first output port 26 of the request processing unit 12 is connected to the first input port 27 of the first arbitration module 131 and the first input port 28 of the second arbitration module 132 respectively; the second output port 29 of the request processing unit 12 is connected to the second input port 30 of the second arbitration module 132; the third output port 31 of the request processing unit 12 is connected to the third input port 32 of the second arbitration module 132.
[0069] Optionally, in the embodiment of the present application, the first arbitration module 131 includes a NOT gate 1311 , a multiplexer 1312 and an AND gate 1313 .
[0070] Among them, the NOT gate 1311 is used to bitwise invert the first channel resource request -1 to obtain the second channel resource request, the multiplexer 1312 is used to determine whether to use the first arbitration module, and the AND gate 1313 is used to perform an AND operation on the second channel resource request and the first channel resource request to obtain an authorized channel resource request identifier.
[0071] For example, Figure 6 As shown, the first arbitration module 131 includes a NOT gate 1311, a multiplexer 1312 and an AND gate 1313. The input port 35 of the NOT gate 1311 is connected to the CPU. The CPU is used to perform a -1 operation on the first channel resource request output by the request processing unit to obtain a second channel resource request, and send the second channel resource request to the first input port 35 of the NOT gate 1311. The output port 36 of the NOT gate 1311 is connected to the first input port 37 of the multiplexer 1312; the second input port of the multiplexer 1312 is set to 0, the output port of the multiplexer 1312 is connected to the first input port 38 of the AND gate 1313, and the second input port 39 of the AND gate 1313 is connected to the fourth output port 33 of the request processing module 12; the output port of the AND gate 1313 is used to output the authorized channel resource request identifier.
[0072] In the embodiment of the present application, the first arbitration module may be a fixed priority arbitrator.
[0073] For example, Figure 7 As shown in the figure, taking four channels competing for the bus as an example, channel 0 has the highest priority, and the priorities of channels 1, 2, and 3 decrease in turn. When all four channels have requests in the first cycle, the fixed priority arbitrator gives priority to granting the permission of channel 0. In the second cycle, channel 0 still requests to access the bus, and the fixed priority arbitrator also grants the channel. In the third and fourth cycles, channel 0 no longer applies for access, and the fixed priority arbitrator will determine whether channel 1 has a request. If there is a request, it will be authorized. If there is no request, it will determine the next level of priority channel 2.
[0074] For example, Figure 7As shown, taking the channels as 0, 1, 2, 3, and the authorization priority value corresponding to channel 0 is 4, the authorization priority value corresponding to channel 1 is 3, the authorization priority value corresponding to channel 2 is 2, and the authorization priority value corresponding to channel 3 is 1 as an example, in the first cycle, the above 4 channels all have channel requests, then the first channel resource request is 1, 1, 1, 1; the request processing unit sends the first channel resource request 1, 1, 1, 1 and the fixed priority arbitration mode to the CPU, the CPU processes the first channel resource request 1, 1, 1, 1 according to the fixed priority arbitration mode, and obtains the second channel resource request 1, 1, 1, 0, and then sends the second channel resource request 1, 1,1,0 is sent to the NOT gate in the fixed priority arbiter, the NOT gate bitwise inverts the second channel resource request 1,1,1,0 to get 0,0,0,1, and then inputs the inverted second channel resource request 0,0,0,1 to the first input port of the multiplexer. At this time, the multiplexer determines that the first input port has received the inverted second channel resource request 0,0,0,1, and inputs the inverted second channel resource request 0,0,0,1 to the first input port of the AND gate. The inverted second channel resource request 0,0,0,1 is ANDed with the first channel resource request 1,1,1,1 through the AND gate to obtain the authorized channel request 0,0,0,1 of channel 0.
[0075] Optionally, in an embodiment of the present application, when the multiplexer determines that the first input port has not received any request signal, the multiplexer may output information in the second input port, and the information in the second input port is 0, 0, 0, 0.
[0076] It should be noted that the essence of the fixed priority arbiter is to find the first bit that is 1 in the first channel resource request signal. Generally, the search is started from the low bit to the high bit, and it is agreed that the low bit represents high priority and the high bit represents low priority. Therefore, the fixed priority arbitration can determine the authorization priority of each channel according to the position of the request signal in the channel resource request.
[0077] Optionally, in the embodiment of the present application, combined with Figure 5 ,like Figure 8 As shown, the second arbitration module 132 includes a statistical submodule 1321 and a scheduling submodule 1322 connected to the statistical submodule 1321 .
[0078] The request processing unit 12 is connected to the statistics submodule 1321 .
[0079] In the embodiment of the present application, the request processing unit is specifically used to send a first channel resource request to the statistics submodule 1321 .
[0080] The statistical submodule 1321 is used to count the number of channel authorization times of each of the N channel requests, and transmit the number of authorization times of each of the N channel requests and the first channel request signal to the scheduling submodule.
[0081] The scheduling submodule 1322 is used to determine at least one first channel resource request from the N channel requests based on the number of authorizations of each channel resource request in the N channel requests and the N channel resource requests, and authorize them in sequence according to the request order of the at least one first channel resource request to determine the authorized channel request;
[0082] The number of channel authorization times of the first channel request is less than the authorization priority weight corresponding to the first channel request -1, and the first channel corresponds to the first channel request.
[0083] Optionally, in the embodiment of the present application, the statistical submodule 1321 includes: a first multiplexer 16, M counters and a first processor 17 connected in sequence.
[0084] The input end of the first multiplexer is connected to the request processing unit, and the output end of the first multiplexer is connected to M counters respectively.
[0085] The first multiplexer is used to determine whether the authorization priority value of the channel corresponding to each received channel request is 0.
[0086] N counters among the M counters correspond to the N channel requests one by one.
[0087] Each of the N counters is used to count +1 when the authorization priority value corresponding to the corresponding channel request is not 0.
[0088] The first processing unit is used to count the N counters, obtain the number of authorizations of the N channel requests, and output the number of authorizations of the N channel requests and the first channel request signal.
[0089] Optionally, in the embodiment of the present application, the statistical submodule 1321 further includes: a mode selector, configured to determine the target arbitration mode according to the arbitration mode identifier corresponding to the target arbitration mode.
[0090] Wherein, the mode selector is connected to the first multiplexer.
[0091] Optionally, in the embodiment of the present application, the above-mentioned mode selector is further used to determine the counting mode of the N counters based on the arbitration mode identifier of the target arbitration mode.
[0092] For example, Fig. 9As shown in the figure, WRR mode and AWRR mode have different counting, clearing and holding conditions. Each channel is paired with a counter count[i], i=1,2,3. In WRR arbitration mode, when channel i is granted - grant[i] is valid, count[i] is increased by 1; when channel i has no request - req_ack[i] is invalid, count[i] is maintained; when all channels sending requests are granted or all channels have no requests, count[i] is cleared.
[0093] For example, Fig.10 As shown in the figure, in the AWRR arbitration mode, when channel i is authorized or there is no request for channel i in this round, count[i] increases by 1; when count[i] of channel i is equal to the weight (the next beat of count[i] == weight[i]-1), count[i] remains unchanged; except for count[i] == weight[i]-1 with the largest weight and the counts of other channels are equal to the corresponding weights, count[i] is cleared.
[0094] It should be noted that Fig. 9 and Fig.10 In the example, before the first channel resource request enters the counter, a logical judgment is made on whether the authorization priority weight configured for each channel request is 0. If weight[i] is configured as zero, req_w[i] is also 0, and the channel[i] request is blocked.
[0095] With respect to the first multiplexer, in the embodiment of the present application, the multiplexer 15 is used to perform a logical judgment on whether the weight configured for each channel is 0. For example, if weight[i] is configured to be zero, the output of the multiplexer 15 is 0; if weight[i] is not configured to be 0, the output of the multiplexer 15 is the channel request corresponding to channel[i].
[0096] Optionally, in the embodiment of the present application, combined with Figure 8 ,like Fig.11 As shown, the scheduling submodule 1322 includes: a second processor 14, a cycle pointer subunit 15, an authorization subunit 16 and a second multiplexer 17 connected in sequence.
[0097] Wherein, the second processor is connected to the statistical submodule.
[0098] The above-mentioned second processor is used to process the first channel request signal when it is determined that the target arbitration mode is the alternating weighted polling arbitration mode, so as to shield the channel requests that have been authorized once among the N channel requests, and send a second channel request to the cycle pointer subunit, where the second channel request is the remaining channel request after shielding the channel requests that have been authorized once among the N channel requests.
[0099] The above-mentioned cycle pointer subunit is used to determine at least one third channel request from the second channel requests based on the number of authorizations of the second channel requests, and send at least one third channel request to the authorization submodule; the number of authorizations of the third channel request is equal to or greater than the authorization priority weight corresponding to the third channel request -1.
[0100] The authorization submodule is used to output at least one authorization channel request to the second multiplexer, where the authorization channel request is a channel request other than the at least one third channel request among the N channel requests.
[0101] The second multiplexer is used to select an authorized channel request from at least one authorized channel request.
[0102] Optionally, in an embodiment of the present application, the scheduling submodule further includes: a cycle pointer subunit, an authorization subunit and a second multiplexer.
[0103] The above-mentioned cycle pointer subunit is connected to the statistical submodule.
[0104] The above-mentioned cycle pointer subunit is used to determine at least one fifth channel request from the authorized channel requests in the fourth channel requests based on the number of authorizations of the fourth channel request indicated by the first channel request signal, and send at least one fifth channel request to the authorization submodule; the number of channel authorizations of the fifth channel request is equal to or greater than the authorization priority weight corresponding to the fifth channel request -1.
[0105] The authorization submodule is used to output at least one authorization channel request to the second multiplexer, and the at least one authorization channel request is a channel request other than the at least one fifth channel request among the N channel requests.
[0106] The second multiplexer is used to select an authorized channel request from at least one authorized channel request.
[0107] Optionally, in the embodiment of the present application, the alternating weighted processor 18 includes a first input port, a second input port and a third input port.
[0108] Among them, the above-mentioned first input port is used to receive the arbitration mode identifier corresponding to the target arbitration mode sent by the statistical submodule, the second input port is used to receive the authorization number of N channel requests sent by the statistical submodule, and the third port input port is used to receive N channel requests sent by the statistical submodule.
[0109] It should be noted that the main function of the alternating weighted processor is to process when the channel request is valid. The channel request in WRR needs to be authorized at one time (assuming that a channel request is always valid). It will not be authorized until the number of authorizations is equal to the weight. The entire WRR stage is always in the mask stage, and the request signal is affected by the pointer, which will achieve a shielding effect. AWRR, on the other hand, determines whether the number of authorizations is equal to the weight in each round. When a round is completed, the unmask stage is triggered, and unmask is not affected by the pointer. In other words, the request signal of AWRR needs to be shielded by judging the number of authorizations and the weight in the unmask validity stage.
[0110] Exemplarily, when the target mode is determined to be the alternating weighted polling arbitration mode, taking the channel 0 request as an example, when channel 0 has been authorized once, the number of authorizations for channel 0 is 0001. At this time, 0001 is inverted to obtain 1110, and then 1110 is added to the first channel resource request 1111 to obtain 1110. At this time, the alternating weighted processor 18 can obtain the channel request after shielding channel 0.
[0111] Optionally, in the embodiment of the present application, Fig.12 As shown, the above-mentioned loop pointer submodule 15 includes: a first AND gate 151 , a third multiplexer 152 , a pointer register 153 and a fourth multiplexer 154 .
[0112] Among them, the first input port of the above-mentioned first AND gate 191 is connected to the statistical processing submodule, or is connected to the alternating weighted processor 18, the second input port of the first AND gate 191 is connected to the output port of the pointer register, and the first output port of the first AND gate 191 is respectively connected to the input port of the third multiplexer 192 and to the authorization submodule.
[0113] The output port of the third multiplexer 192 is respectively connected to the control port of the fourth multiplexer 194 and the control port of the second multiplexer.
[0114] The output port of the fourth multiplexer 194 is connected to the input port of the pointer register.
[0115] Optionally, in the embodiment of the present application, the pointer register 193 further includes: a second input port, a third input port and a fourth input port.
[0116] Among them, the second input port of the pointer register 193 is used to receive the arbitration mode identifier corresponding to the target arbitration mode sent by the statistical processing sub-module, the third input port of the pointer register 193 is used to receive N channel requests sent by the statistical processing sub-module, and the fourth input port of the pointer register 193 is used to receive the number of authorizations of the N channel requests sent by the statistical processing sub-module.
[0117] In the embodiment of the present application, the second input port of the pointer register 193 is used to determine the switching mode of the information stored in the pointer register 193, and the third input port and the fourth input port of the pointer register 193 are used to enable the pointer register.
[0118] It should be noted that the pointer register enable module is mainly for when to enable the pointer register during WRR arbitration, that is, as long as there is a channel with a number of authorizations equal to the weight and any channel has a request, it will be authorized. If all channels have no request, it is considered that WRR is over. For example, the Mask_en_minu_w[i] signal comes from the weight statistics unit, and the count of count[i] starts from 0 and accumulates to 1, so count[i]=weight[i]-1 means that the number of authorizations is equal to the weight number. When the mask_en_minu_w signal of any channel is pulled high, the pointer register is enabled, which is the next channel in the priority cycle.
[0119] Optionally, in the embodiment of the present application, the pointer register 193 also includes a fifth input port, and the fifth input port is used to clear the pointer register.
[0120] It should be noted that the pointer register clearing module is mainly used to initialize the pointer at the end of weighted polling. In WRR mode, when all channels have no request signals, the pointer is initialized. In AWRR mode, when the number of authorization statistics of the channel with the largest weight is equal to the weight (for AWRR, even if there is no request in a round of channels, the number of authorizations will still be counted plus 1), the pointer is initialized.
[0121] Optionally, in the embodiment of the present application, Fig.13 As shown, the authorization submodule 16 includes: a first authorization submodule 161 , a second authorization submodule 162 , a first NOT gate 163 , a second NOT gate 164 , a second AND gate 165 and a third AND gate 166 .
[0122] The first input port of the first authorization submodule is connected to the first output port of the first AND gate, and the output end of the first authorization submodule is connected to the input end of the first NOT gate.
[0123] The output terminal of the first NOT gate is connected to the first input port of the second AND gate.
[0124] The second input port of the second AND gate is connected to the first input port of the first authorization submodule, and the output end of the second AND gate is connected to the first input port of the second multiplexer.
[0125] The first input port of the second authorization submodule is connected to the statistical processing submodule or the alternating weighted processor, and the output port of the second authorization submodule is connected to the input port of the second NOT gate.
[0126] The output port of the second NOT gate is connected to the first input port of the third AND gate.
[0127] The second input port of the third AND gate is connected to the first input port of the second authorization submodule, and the output port of the third AND gate is connected to the second input port of the second multiplexer.
[0128] The arbitrator provided in this application is explained in detail below with specific examples.
[0129] Taking the ordinary polling arbitration mode as an example, four channels, for example, channel 0, channel 1, channel 2, and channel 3, all four channels make channel requests, and the first channel resource request is 1111; the request processing unit receives the first channel resource request 1111, and the request processing unit obtains the arbitration mode identifier 00 of the arbitration mode through the configuration register, that is, the above-mentioned ordinary polling arbitration mode, and the authorization priority weight corresponding to the first channel resource request 1111, and the authorization priority weights are 1, 1, 1, 1 respectively.
[0130] In the first cycle, the request processing unit sends the arbitration mode identifier 00 to the mode selector in the second arbitration module, so that the second arbitration module determines that the current arbitration mode is the ordinary polling arbitration mode; the request processing unit sends the authorization priority weight corresponding to the first channel resource request and the first channel resource request to the first multiplexer corresponding to each channel request, thereby outputting the first channel resource request 1111.
[0131] It should be noted that, since the authorization priority value of each channel request in the first channel resource request is not 0, the output is still 1111; if the authorization priority value of one channel request in the first channel resource request is 0, the first multiplexer sets the one channel request to 0 and outputs the channel request after it is set to 0. For example, if the first channel resource request is 1111 and the authorization priority value corresponding to channel request 0 is 0, then after passing through the first multiplexer, the output channel resource request is 1110.
[0132] Then, the second arbitration module inputs each channel request in the first channel resource request 1111 into the counter corresponding to each channel request. At this time, since it is the first time, no channel request is authorized, so the counter of each channel request remains unchanged, that is, count=null.
[0133] The second arbitration module inputs the number of authorizations corresponding to each channel request into the statistical processing submodule, obtains the sum of the number of authorizations corresponding to each channel request, and obtains the number of authorizations of the first channel resource request as null. Then, the second arbitration module inputs the first channel resource request 1111, the number of authorizations of the first channel resource request null, and the arbitration mode identifier 00 into the loop pointer submodule in the scheduling submodule through the statistical processing submodule. At this time, the loop pointer submodule performs an AND operation on the first channel resource request 1111 and the preset pointer 1111 stored in the pointer register to obtain the processed first channel resource request 1111.
[0134] The processed first channel resource request is input into the first authorization submodule in the authorization submodule. The first authorization submodule can first determine the first bit of the first channel resource request that is 1 starting from the lowest bit; then set the bits starting from the lowest bit to the highest bit that are 1+1 to be equal to 1, and the remaining bits are 0, that is, the processed second channel resource request 1110 is obtained. Then, the processed second channel resource request 1110 is input into the input port in the pointer register, and the processed second channel resource request 1110 is input into the NOT gate to obtain 0001, and 0001 is input into the AND gate to perform AND operation with the first channel resource request 1111 to obtain 0001, that is, the authorized channel request.
[0135] The second arbitration module inputs the first channel resource request 1111 to the second authorization submodule, which first determines the first bit that is 1 starting from the lowest bit in the first channel resource request 1111; then sets the first bit that is 1+1 starting from the lowest bit to the highest bit to be equal to 1, and the remaining bits are 0, that is, the processed second channel resource request 1110 is obtained. Then, the processed second channel resource request 1110 is input to the input port in the pointer register, and the processed second channel resource request 1110 is input to the NOT gate to obtain 0001, and 0001 is input to the AND gate to perform AND operation with the first channel resource request 1111 to obtain 0001, that is, the channel request for the authorized channel 0.
[0136] Then, the authorization channel request output by the first authorization module and the authorization channel request output by the second authorization module are sent to the second multiplexer. When the second multiplexer determines that the processed first channel resource requests are not all 0, the authorization channel request of the first authorization module is output; when the second multiplexer determines that the processed first channel resource requests are all 0, the authorization channel request of the second authorization module is output, and then the second arbitration module inputs the authorization channel request output by the second multiplexer into the counter corresponding to the authorization channel request, that is, inputs the authorization result of channel 0 into the counter corresponding to channel 0.
[0137] In the second cycle, if the first channel resource request is still 1111, when the first channel resource request is still 1111 and is input into the statistical processing submodule, since the counter corresponding to channel 0 is already +1, changed from null to 0, it means that channel 0 has been authorized once, and the statistical processing submodule obtains a value equal to the authorization priority weight -1, that is, the number of authorizations corresponding to the first channel resource request is 0001, so the channel request corresponding to 0 is set to 0 in the statistical processing submodule to obtain a new first channel resource request 1110, and the new first channel resource request 1110 is sent to the AND gate in the loop pointer submodule, and the first channel resource request 1111 and the number of authorizations corresponding to the first channel resource request is 0001, which is input into the enable port of the pointer register to enable the pointer register to store the second channel resource request 1110 after the above processing into the pointer register.
[0138] Then, the second arbitration unit may perform an AND operation on the new first channel resource request 1110 and the 1110 stored in the pointer register to obtain the processed fourth channel resource request 1110, and then input the processed fourth channel resource request 1110 into the first authorization submodule in the authorization submodule, and the first authorization submodule may first determine the first bit of the first channel resource request that is 1 starting from the lowest bit; then set the bits starting from the lowest bit that are 1+1 to the highest bit to be equal to 1, and the remaining bits to be 0, that is, obtain the processed fifth channel resource request 1101. Then, the processed fifth channel resource request 1101 is input into the input port in the pointer register, and the processed second channel resource request 1101 is input into the NOT gate to obtain 0010, and 0010 is input into the AND gate to perform an AND operation with the first channel resource request 1110 to obtain 0010, that is, the channel request for the authorized channel 1.
[0139] The second arbitration module inputs the first channel resource request 1110 to the second authorization submodule, which first determines the first bit that is 1 starting from the lowest bit in the first channel resource request 1110; then sets the first bit that is 1+1 starting from the lowest bit to the highest bit to be equal to 1, and the remaining bits are 0, that is, the processed second channel resource request 1101 is obtained. Then, the processed fourth channel resource request 1101 is input to the input port in the pointer register, and the processed fourth channel resource request 1101 is input to the NOT gate to obtain 0010, and 0010 is input to the AND gate to perform AND operation with the first channel resource request 1110 to obtain 0010, that is, the channel request for the authorized channel 1.
[0140] When the processed first channel resource request output by the first AND gate is all 0s, the second arbitration module stores the processed second channel resource request 1110 output by the second authorization module in the pointer register through the third multiplexer; when the processed first channel resource request output by the first AND gate is not all 0s, the second arbitration module stores the processed second channel resource request 1110 output by the first authorization module in the pointer register through the third multiplexer.
[0141] Then, the authorization channel request output by the first authorization module and the authorization channel request output by the second authorization module are sent to the second multiplexer. When the second multiplexer determines that the processed first channel resource requests are not all 0, the authorization channel request of the first authorization module is output; when the second multiplexer determines that the processed first channel resource requests are all 0, the authorization channel request of the second authorization module is output, and then the second arbitration module inputs the authorization channel request output by the second multiplexer into the counter corresponding to the authorization channel request, that is, inputs the authorization result of channel 1 into the counter corresponding to channel 1.
[0142] The process continues in this way until a normal polling arbitration is completed.
[0143] Taking the weighted polling arbitration mode as an example, there are 4 channels, for example, channel 0, channel 1, channel 2, and channel 3, and all 4 channels make channel requests, and the first channel resource request is 1111; the request processing unit receives the first channel resource request 1111, and the request processing unit obtains the arbitration mode identifier 00 of the arbitration mode through the configuration register, that is, the above-mentioned ordinary polling arbitration mode, and the authorization priority weight corresponding to the first channel resource request 1111, and the authorization priority weights are 4, 3, 2, and 1 respectively.
[0144] In the first cycle, the request processing unit sends the arbitration mode identifier 01 to the mode selector in the second arbitration module, so that the second arbitration module determines that the current arbitration mode is the weighted polling arbitration mode; the request processing unit sends the authorization priority value corresponding to the first channel resource request and the first channel resource request to the first multiplexer corresponding to each channel request, thereby outputting the first channel resource request 1111.
[0145] It should be noted that, since the authorization priority value of each channel request in the first channel resource request is not 0, the output is still 1111; if the authorization priority value of one channel request in the first channel resource request is 0, the first multiplexer sets the one channel request to 0 and outputs the channel request after it is set to 0. For example, if the first channel resource request is 1111 and the authorization priority value corresponding to channel request 0 is 0, then after passing through the first multiplexer, the output channel resource request is 1110.
[0146] Then, the second arbitration module inputs each channel request in the first channel resource request 1111 into the counter corresponding to each channel request. At this time, since it is the first time, no channel request is authorized, so the counter of each channel request remains unchanged, that is, count=null.
[0147] The second arbitration module inputs the number of authorizations corresponding to each channel request into the statistical processing submodule, obtains the sum of the number of authorizations corresponding to each channel request, and obtains the number of authorizations of the first channel resource request as null. Then, the second arbitration module inputs the first channel resource request 1111, the number of authorizations of the first channel resource request null, and the arbitration mode identifier 01 into the loop pointer submodule in the scheduling submodule through the statistical processing submodule. At this time, the loop pointer submodule performs an AND operation on the first channel resource request 1111 and the preset pointer 1111 stored in the pointer register through the first AND gate to obtain the processed first channel resource request 1111.
[0148] The processed first channel resource request is input into the first authorization submodule in the authorization submodule. The first authorization submodule can first determine the first bit of the first channel resource request that is 1 starting from the lowest bit; then set the bits starting from the lowest bit to the highest bit that are 1+1 to be equal to 1, and the remaining bits are 0, that is, the processed second channel resource request 1110 is obtained. Then, the processed second channel resource request 1110 is input into the input port in the pointer register, and the processed second channel resource request 1110 is input into the NOT gate to obtain 0001, and 0001 is input into the AND gate to perform AND operation with the first channel resource request 1111 to obtain 0001, that is, the authorized channel request.
[0149] The second arbitration module inputs the first channel resource request 1111 to the second authorization submodule, which first determines the first bit that is 1 starting from the lowest bit in the first channel resource request 1111; then sets the first bit that is 1+1 starting from the lowest bit to the highest bit to be equal to 1, and the remaining bits are 0, that is, the processed second channel resource request 1110 is obtained. Then, the processed second channel resource request 1110 is input to the input port in the pointer register, and the processed second channel resource request 1110 is input to the NOT gate to obtain 0001, and 0001 is input to the AND gate to perform AND operation with the first channel resource request 1111 to obtain 0001, that is, the channel request for the authorized channel 0.
[0150] Then, the authorization channel request output by the first authorization module and the authorization channel request output by the second authorization module are sent to the second multiplexer. When the second multiplexer determines that the processed first channel resource requests are not all 0, the authorization channel request of the first authorization module is output; when the second multiplexer determines that the processed first channel resource requests are all 0, the authorization channel request of the second authorization module is output, and then the second arbitration module inputs the authorization channel request output by the second multiplexer into the counter corresponding to the authorization channel request, that is, inputs the authorization result of channel 0 into the counter corresponding to channel 0.
[0151] In the second cycle, if the first channel resource request is still 1111, when the first channel resource request is still 1111 and is input to the statistical processing submodule, since the counter corresponding to channel 0 is already +1, it changes from null to 0, indicating that channel 0 has been authorized once, and the statistical processing submodule obtains a weight less than the authorization priority value -1. At this time, the first channel resource request is still 1111, and the first channel resource request 1111 is sent to the AND gate in the loop pointer submodule.
[0152] Then, the second arbitration unit may perform an AND operation on the first channel resource request 1111 and the 1111 stored in the pointer register to obtain the processed fourth channel resource request 1111, and then input the processed fourth channel resource request 1111 into the first authorization submodule in the authorization submodule, and the first authorization submodule may first determine the first bit that is 1 starting from the lowest bit in the first channel resource request for the processed fourth channel resource request 1111; then set the first bit that is 1+1 starting from the lowest bit to the highest bit to be equal to 1, and the remaining bits to be 0, that is, obtain the processed fifth channel resource request 1110. Then, the processed fifth channel resource request 1110 is input into the input port in the pointer register, and the processed second channel resource request 1110 is input into the NOT gate to obtain 0001, and 0001 is input into the AND gate to perform an AND operation with the first channel resource request 1111 to obtain 0001, that is, the channel request for the authorized channel 0.
[0153] The second arbitration module inputs the first channel resource request 1111 to the second authorization submodule, which first determines the first bit that is 1 starting from the lowest bit in the first channel resource request 1111; then sets the first bit that is 1+1 starting from the lowest bit to the highest bit to be equal to 1, and the remaining bits are 0, that is, the processed second channel resource request 1110 is obtained. Then, the processed fourth channel resource request 1110 is input to the input port in the pointer register, and the processed fourth channel resource request 1110 is input to the NOT gate to obtain 0001, and 0001 is input to the AND gate to perform an AND operation with the first channel resource request 1111 to obtain 0001, that is, the channel request for the authorized channel 0.
[0154] Then, the authorization channel request output by the first authorization module and the authorization channel request output by the second authorization module are sent to the second multiplexer. When the second multiplexer determines that the processed first channel resource requests are not all 0, the authorization channel request of the first authorization module is output; when the second multiplexer determines that the processed first channel resource requests are all 0, the authorization channel request of the second authorization module is output, and then the second arbitration module inputs the authorization channel request output by the second multiplexer into the counter corresponding to the authorization channel request, that is, inputs the authorization result of channel 1 into the counter corresponding to channel 0.
[0155] In the third cycle, assuming that channel 0 does not make a channel resource request, the first channel resource request is 1110. When the first channel resource request 1110 is input into the statistical processing submodule, since the number of authorizations corresponding to channel 0 is less than the authorization priority value -1, the counter corresponding to channel 0 keeps counting, that is, the authorization is kept 2 times, and then the first channel resource request 1110 is input into the AND gate in the loop pointer submodule.
[0156] Then, the second arbitration unit may perform an AND operation on the first channel resource request 1110 and 1111 stored in the pointer register to obtain the processed fourth channel resource request 1110, and then input the processed fourth channel resource request 1110 into the first authorization submodule in the authorization submodule, and the first authorization submodule may first determine the first bit of the first channel resource request that is 1 starting from the lowest bit; then set the bits starting from the lowest bit that are 1+1 to the highest bit to be equal to 1, and the remaining bits to be 0, that is, obtain the processed fifth channel resource request 1101. Then, the processed fifth channel resource request 1101 is input into the input port in the pointer register, and the processed second channel resource request 1101 is input into the NOT gate to obtain 0010, and 0010 is input into the AND gate to perform an AND operation with the first channel resource request 1110 to obtain 0010, that is, the channel request for the authorized channel 1.
[0157] The second arbitration module inputs the first channel resource request 1110 to the second authorization submodule, which first determines the first bit that is 1 starting from the lowest bit in the first channel resource request 1110; then sets the first bit that is 1+1 starting from the lowest bit to the highest bit to be equal to 1, and the remaining bits are 0, that is, the processed second channel resource request 1101 is obtained. Then, the processed fourth channel resource request 1101 is input to the input port in the pointer register, and the processed fourth channel resource request 1101 is input to the NOT gate to obtain 0010, and 0010 is input to the AND gate to perform AND operation with the first channel resource request 1110 to obtain 0010, that is, the channel request for the authorized channel 1.
[0158] Then, the authorization channel request output by the first authorization module and the authorization channel request output by the second authorization module are sent to the second multiplexer. When the second multiplexer determines that the processed first channel resource requests are not all 0, the authorization channel request of the first authorization module is output; when the second multiplexer determines that the processed first channel resource requests are all 0, the authorization channel request of the second authorization module is output, and then the second arbitration module inputs the authorization channel request output by the second multiplexer into the counter corresponding to the authorization channel request, that is, inputs the authorization result of channel 1 into the counter corresponding to channel 1.
[0159] In the fourth cycle, if the first channel resource request is still 1111, when the first channel resource request is still 1111 and is input to the statistical processing submodule, since the counter corresponding to channel 0 has been +2, it has changed from null to 2, indicating that channel 0 has been authorized twice, and the number of authorizations obtained by the statistical processing submodule is less than the authorization priority value -1, at this time, the first channel resource request is still 1111, and the first channel resource request 1111 is sent to the AND gate in the loop pointer submodule.
[0160] Then, the second arbitration unit may perform an AND operation on the first channel resource request 1111 and the 1111 stored in the pointer register to obtain the processed fourth channel resource request 1111, and then input the processed fourth channel resource request 1111 into the first authorization submodule in the authorization submodule, and the first authorization submodule may first determine the first bit that is 1 starting from the lowest bit in the first channel resource request for the processed fourth channel resource request 1111; then set the first bit that is 1+1 starting from the lowest bit to the highest bit to be equal to 1, and the remaining bits to be 0, that is, obtain the processed fifth channel resource request 1110. Then, the processed fifth channel resource request 1110 is input into the input port in the pointer register, and the processed second channel resource request 1110 is input into the NOT gate to obtain 0001, and 0001 is input into the AND gate to perform an AND operation with the first channel resource request 1111 to obtain 0001, that is, the channel request for the authorized channel 0.
[0161] The second arbitration module inputs the first channel resource request 1111 to the second authorization submodule, which first determines the first bit that is 1 starting from the lowest bit in the first channel resource request 1111; then sets the first bit that is 1+1 starting from the lowest bit to the highest bit to be equal to 1, and the remaining bits are 0, that is, the processed second channel resource request 1110 is obtained. Then, the processed fourth channel resource request 1110 is input to the input port in the pointer register, and the processed fourth channel resource request 1110 is input to the NOT gate to obtain 0001, and 0001 is input to the AND gate to perform an AND operation with the first channel resource request 1111 to obtain 0001, that is, the channel request for the authorized channel 0.
[0162] Then, the authorization channel request output by the first authorization module and the authorization channel request output by the second authorization module are sent to the second multiplexer. When the second multiplexer determines that the processed first channel resource requests are not all 0, the authorization channel request of the first authorization module is output; when the second multiplexer determines that the processed first channel resource requests are all 0, the authorization channel request of the second authorization module is output, and then the second arbitration module inputs the authorization channel request output by the second multiplexer into the counter corresponding to the authorization channel request, that is, inputs the authorization result of channel 1 into the counter corresponding to channel 0.
[0163] And so on, until the number of authorizations for all the four channels is equal to the authorization priority value - 1, at which time the weighted polling ends.
[0164] Taking the alternating weighted polling arbitration mode as an example, there are 4 channels, for example, channel 0, channel 1, channel 2, and channel 3, all of which make channel requests, and the first channel resource request is 1111; the request processing unit receives the first channel resource request 1111, and the request processing unit obtains the arbitration mode identifier 00 of the arbitration mode through the configuration register, that is, the above-mentioned ordinary polling arbitration mode, and the authorization priority weight corresponding to the first channel resource request 1111, and the authorization priority weights are 4, 3, 2, and 1 respectively.
[0165] In the first cycle, the request processing unit sends the arbitration mode identifier 10 to the mode selector in the second arbitration module, so that the second arbitration module determines that the current arbitration mode is the alternating weighted polling arbitration mode; the request processing unit sends the authorization priority value corresponding to the first channel resource request and the first channel resource request to the first multiplexer corresponding to each channel request, thereby outputting the first channel resource request 1111.
[0166] It should be noted that, since the authorization priority value of each channel request in the first channel resource request is not 0, the output is still 1111; if the authorization priority value of one channel request in the first channel resource request is 0, the first multiplexer sets the one channel request to 0 and outputs the channel request after it is set to 0. For example, if the first channel resource request is 1111 and the authorization priority value corresponding to channel request 0 is 0, then after passing through the first multiplexer, the output channel resource request is 1110.
[0167] Then, the second arbitration module inputs each channel request in the first channel resource request 1111 into the counter corresponding to each channel request. At this time, since it is the first time, no channel request is authorized, so the counter of each channel request remains unchanged, that is, count=null.
[0168] The second arbitration module inputs the number of authorizations corresponding to each channel request into the statistical processing submodule, obtains the sum of the number of authorizations corresponding to each channel request, and obtains the number of authorizations of the first channel resource request as null. Then, the second arbitration module inputs the first channel resource request 1111, the number of authorizations of the first channel resource request null, and the arbitration mode identifier 01 into the alternating weighted processor in the scheduling submodule through the statistical processing submodule. The alternating weighted processor determines that the number of authorizations of the first channel resource request is null, and directly outputs the first channel resource request 1111. At this time, the loop pointer submodule performs an AND operation on the first channel resource request 1111 and the preset pointer 1111 stored in the pointer register through the first AND gate to obtain the processed first channel resource request 1111.
[0169] The processed first channel resource request is input into the first authorization submodule in the authorization submodule. The first authorization submodule can first determine the first bit of the first channel resource request that is 1 starting from the lowest bit; then set the bits starting from the lowest bit to the highest bit that are 1+1 to be equal to 1, and the remaining bits are 0, that is, the processed second channel resource request 1110 is obtained. Then, the processed second channel resource request 1110 is input into the input port in the pointer register, and the processed second channel resource request 1110 is input into the NOT gate to obtain 0001, and 0001 is input into the AND gate to perform AND operation with the first channel resource request 1111 to obtain 0001, that is, the authorized channel request.
[0170] The second arbitration module inputs the first channel resource request 1111 to the second authorization submodule, which first determines the first bit that is 1 starting from the lowest bit in the first channel resource request 1111; then sets the first bit that is 1+1 starting from the lowest bit to the highest bit to be equal to 1, and the remaining bits are 0, that is, the processed second channel resource request 1110 is obtained. Then, the processed second channel resource request 1110 is input to the input port in the pointer register, and the processed second channel resource request 1110 is input to the NOT gate to obtain 0001, and 0001 is input to the AND gate to perform AND operation with the first channel resource request 1111 to obtain 0001, that is, the channel request for the authorized channel 0.
[0171] Then, the authorization channel request output by the first authorization module and the authorization channel request output by the second authorization module are sent to the second multiplexer. When the second multiplexer determines that the processed first channel resource requests are not all 0, the authorization channel request of the first authorization module is output; when the second multiplexer determines that the processed first channel resource requests are all 0, the authorization channel request of the second authorization module is output, and then the second arbitration module inputs the authorization channel request output by the second multiplexer into the counter corresponding to the authorization channel request, that is, inputs the authorization result of channel 0 into the counter corresponding to channel 0.
[0172] In the second cycle, if the first channel resource request is still 1111, when the first channel resource request is still 1111 and is input to the statistical processing submodule, since the counter corresponding to channel 0 has been +1, changed from null to 0, it means that channel 0 has been authorized once, and the number of authorization times of all channel requests obtained by the statistical processing submodule is less than the authorization priority weight of each channel request -1, at this time, the first channel resource request output by the statistical processing submodule is still 1111, and the first channel resource request 1111 is sent to the alternating weighted processor. At this time, the alternating weighted processor determines that channel 0 has been authorized once, then sets the channel request corresponding to channel 0 to 0, and obtains a new first channel request 1110. At this time, the loop pointer submodule performs an AND operation on the first channel resource request 1110 and the preset pointer 1111 stored in the pointer register through the first AND gate to obtain the processed first channel resource request 1110.
[0173] The processed first channel resource request is input into the first authorization submodule in the authorization submodule. The first authorization submodule can first determine the first bit of the first channel resource request that is 1 starting from the lowest bit, and then set the bits starting from the lowest bit to the highest bit to be 1+1, and the remaining bits to be 0, to obtain the processed second channel resource request 1101. Then, the processed second channel resource request 1101 is input into the input port in the pointer register, and the processed second channel resource request 1101 is input into the NOT gate to obtain 0010, and 0010 is input into the AND gate to perform AND operation with the first channel resource request 1111 to obtain 0010, i.e., the channel request for the authorized channel 2.
[0174] The second arbitration module inputs the first channel resource request 1110 to the second authorization submodule, which first determines the first bit that is 1 starting from the lowest bit in the first channel resource request 1110; then sets the first bit that is 1+1 starting from the lowest bit to the highest bit to be equal to 1, and the remaining bits are 0, that is, the processed second channel resource request 1101 is obtained. Then, the processed second channel resource request 1101 is input to the input port in the pointer register, and the processed second channel resource request 1101 is input to the NOT gate to obtain 0010, and 0010 is input to the AND gate to perform AND operation with the first channel resource request 1110 to obtain 0010, that is, the channel request for the authorized channel 1.
[0175] Then, the authorization channel request output by the first authorization module and the authorization channel request output by the second authorization module are sent to the second multiplexer. When the second multiplexer determines that the processed first channel resource requests are not all 0, the authorization channel request of the first authorization module is output; when the second multiplexer determines that the processed first channel resource requests are all 0, the authorization channel request of the second authorization module is output, and then the second arbitration module inputs the authorization channel request output by the second multiplexer into the counter corresponding to the authorization channel request, that is, inputs the authorization result of channel 0 into the counter corresponding to channel 0.
[0176] And so on, until each of the four channels completes a poll, and then the channels among the four channels whose authorization times are less than the authorization priority weight - 1 are polled again, until the authorization times of all the channels among the four channels are equal to the authorization priority weight - 1, at which time the alternating weighted polling ends.
[0177] The execution subject of the channel authorization method provided in the embodiment of the present application may be a channel authorization device, which may be an electronic device, or a functional module or arbitrator in the electronic device. The following takes the arbitrator as an example to illustrate the technical solution provided in the embodiment of the present application.
[0178] The present application embodiment provides a channel authorization method. Fig.14 A flow chart of a channel authorization method provided by an embodiment of the present application is shown. Fig.14 As shown, the channel authorization method provided in the embodiment of the present application may include the following steps 201 and 202.
[0179] Step 201: An arbitrator receives a first channel request signal.
[0180] In an embodiment of the present application, the above-mentioned first channel request signal includes: N channel requests, and obtains first configuration information from the configuration register of the arbitrator, the N channel requests correspond to N channels, and the first configuration information includes N authorization priority weights corresponding one by one to the N channels.
[0181] Step 202: The arbitrator determines an authorized channel request from the N channel requests based on the first configuration information and the channel resource request, using a target arbitration mode that matches the current operation scenario, and outputs the authorized channel request.
[0182] In the embodiment of the present application, the above-mentioned target arbitration mode includes any one of the following: fixed priority arbitration, weighted polling arbitration, ordinary polling arbitration and alternating weighted polling arbitration.
[0183] It should be noted that the specific implementation method can be found in the above embodiments and will not be described again here to avoid repetition.
[0184] Optionally, in an embodiment of the present application, after the above step 201, the channel authorization method provided in the embodiment of the present application further includes the following step 301 or step 302.
[0185] Step 301: When the target arbitration mode is the first arbitration mode, the arbitrator sends a first channel request signal to a first arbitration module in the arbitrator.
[0186] Step 302: When the target arbitration mode is the second arbitration mode, the arbitrator sends first configuration information and a first channel request signal to a second arbitration module in the arbitrator.
[0187] In the embodiment of the present application, the arbitration mode of the first arbitration module is fixed priority arbitration, and the arbitration mode of the second arbitration module is any one of the following: weighted polling arbitration, ordinary polling arbitration and alternating weighted polling arbitration.
[0188] Optionally, in the embodiment of the present application, the above step 202 can be specifically implemented by the following steps 202a and 202b.
[0189] Step 202a: The arbitrator counts the number of times each of the N channel requests is granted.
[0190] Step 202b: The arbitrator determines at least one first channel request from the N channel requests based on the number of authorizations of each channel request and the N channel requests, and authorizes the at least one first channel request in sequence to determine an authorized channel request.
[0191] In the embodiment of the present application, the number of authorization times of the above-mentioned first channel request is less than the authorization priority weight corresponding to the first channel -1, and the first channel corresponds to the first channel request.
[0192] Optionally, in the embodiment of the present application, the above step 202 can be specifically implemented through the following steps 202c to 202e.
[0193] Step 202c: When it is determined that the target arbitration mode is the alternating weighted polling arbitration mode, the arbitrator processes the first channel request signal to shield the channel request that has been authorized once among the N channel requests.
[0194] Step 202b, the arbitrator determines at least one third channel request from the second channel requests based on the number of authorizations of the second channel requests; the second channel requests are the channel requests remaining after shielding the channel requests that have been authorized once among the N channel requests, and the number of authorizations of the third channel request is equal to or greater than the authorization priority weight corresponding to the third channel request -1;.
[0195] Step 202c: The arbitrator selects an authorized channel request from the at least one authorized channel request, where the authorized channel request is a channel request other than the at least one third channel request among the N channel requests.
[0196] Optionally, in the embodiment of the present application, the above step 202 can be specifically implemented by the following steps 401 and 402.
[0197] Step 401: The arbitrator determines at least one fifth channel request from the authorized channel requests in the fourth channel requests based on the number of authorization times of the fourth channel request indicated by the first channel request signal; the number of channel authorization times of the fifth channel request is equal to or greater than the authorization priority weight corresponding to the fifth channel request -1.
[0198] Step 402: The arbitrator selects an authorized channel request from at least one authorized channel request, where the at least one authorized channel request is a channel request other than the at least one fifth channel request among the N channel requests.
[0199] Optionally, in the embodiment of the present application, the channel authorization method provided in the embodiment of the present application also includes the following step 501.
[0200] Step 501: When the number of authorization times of each channel request among N channel requests is equal to or greater than the corresponding authorization priority value - 1, the arbitrator ends this authorization.
[0201] The above-mentioned method embodiments, or various possible implementation methods in each method embodiment, can be executed separately, or, under the premise that there is no contradiction, can also be executed in combination with each other. The specific implementation can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0202] Alternatively, if Fig.15As shown, an embodiment of the present application also provides an electronic device 90, including a processor 91 and a memory 92, wherein the memory 92 stores programs or instructions that can be executed on the processor 91, and when the program or instructions are executed by the processor 91, the various steps of the above-mentioned channel authorization method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.
[0203] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0204] Fig.16 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0205] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.
[0206] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.16 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0207] The input unit 104 is used to receive a first channel request signal, the first channel request signal includes: N channel requests, and obtains first configuration information from the configuration register of the arbitrator, the N channel requests correspond to the N channels, and the first configuration information includes N authorization priority weights corresponding to the N channels one by one. The processor 110 is used to determine the authorization channel request from the N channel requests based on the first configuration information and the channel resource request, using a target arbitration mode that matches the current operating scenario, and output the authorization channel request; wherein the target arbitration mode includes any one of the following: fixed priority arbitration, weighted polling arbitration, ordinary polling arbitration, and alternating weighted polling arbitration.
[0208] The embodiment of the present application provides an electronic device. Since the electronic device can use a target arbitration mode that matches the current operating scenario according to the current operating scenario, the electronic device can use different target arbitration modes according to different operating scenarios to determine an authorized channel request from N channel requests and output the authorized channel request. In this way, the flexibility of the electronic device in performing channel authorization is improved.
[0209] Optionally, in an embodiment of the present application, the processor 110 is further configured to, after receiving the first channel request signal, send the first channel request signal to a first arbitration module in the arbitrator when the target arbitration mode is the first arbitration mode; or, when the target arbitration mode is the second arbitration mode, send the first configuration information and the first channel request signal to a second arbitration module in the arbitrator; wherein the arbitration mode of the first arbitration module is fixed priority arbitration, and the arbitration mode of the second arbitration module is any one of the following: weighted polling arbitration, ordinary polling arbitration, and alternating weighted polling arbitration.
[0210] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is specifically used to count the number of authorizations of each channel request among N channel requests; based on the number of authorizations of each channel request and the N channel requests, determine at least one first channel request from the N channel requests, and authorize them in sequence according to the request order of at least one first channel request to determine the authorized channel request; wherein, the number of authorizations of the first channel request is less than the authorization priority weight corresponding to the first channel -1, and the first channel corresponds to the first channel request.
[0211] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is specifically used to process the first channel request signal when it is determined that the target arbitration mode is the alternating weighted polling arbitration mode, so as to shield the channel requests that have been authorized once among the N channel requests; based on the number of authorizations of the second channel request, determine at least one third channel request from the second channel requests; the second channel request is the channel request remaining after shielding the channel request that has been authorized once among the N channel requests, and the number of authorizations of the third channel request is equal to or greater than the authorization priority weight corresponding to the third channel request -1; select an authorized channel request from at least one authorized channel request, and the authorized channel request is the channel request other than the at least one third channel request among the N channel requests.
[0212] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is specifically used to determine at least one fifth channel request from the authorized authorized channel requests in the fourth channel requests based on the number of authorizations of the fourth channel request indicated by the first channel request signal; the number of channel authorizations of the fifth channel request is equal to or greater than the authorization priority weight corresponding to the fifth channel request -1; and select an authorized channel request from at least one authorized channel request, and the at least one authorized channel request is a channel request other than the at least one fifth channel request among the N channel requests.
[0213] Optionally, in an embodiment of the present application, the processor 110 is further configured to terminate the authorization when the number of authorization times for each of the N channel requests is equal to or greater than the corresponding authorization priority value -1.
[0214] The electronic device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0215] The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, they will not be described again here.
[0216] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0217] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0218] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 110.
[0219] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0220] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0221] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0222] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0223] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the channel authorization method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0224] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0225] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0226] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. An arbitrator, characterized in that: The arbiter comprises: a configuration register, a request processing unit and a first arbitration unit; The request processing unit is configured to receive a first channel request signal, the first channel request signal including: N channel requests, and obtain first configuration information from a configuration register, the N channel requests corresponding to N channels, the first configuration information including N authorization priority weights corresponding one-to-one to the N channels; The request processing unit is used to send the first configuration information and the channel request to the first arbitration unit; The first arbitration unit is configured to determine an authorized channel request from the N channel requests based on the received first configuration information and the channel resource request, using a target arbitration mode matching a current operation scenario, and output the authorized channel request; The target arbitration mode includes any one of the following: fixed priority arbitration, weighted round-robin arbitration, ordinary round-robin arbitration and alternating weighted round-robin arbitration.
2. The arbitrator according to claim 1, characterized in that: The first arbitration unit includes a first arbitration module and a second arbitration module; The request processing unit is configured to send the first channel request signal to the first arbitration module when the target arbitration mode is the first arbitration mode; or, The request processing unit is configured to send the first configuration information and the first channel request signal to the second arbitration module when the target arbitration mode is the second arbitration mode; The arbitration mode of the first arbitration module is the fixed priority arbitration, and the arbitration mode of the second arbitration module is any one of the following: the weighted round-robin arbitration, ordinary round-robin arbitration and alternating weighted round-robin arbitration.
3. The arbitrator according to claim 1, characterized in that: The second arbitration module includes a statistical submodule and a scheduling submodule connected to the statistical submodule; The request processing unit is connected to the statistics submodule; The counting submodule is used to count the number of authorizations of each channel request in the N channel requests, and transmit the number of authorizations of each channel request and the first channel request signal to the scheduling submodule; The scheduling submodule is used to determine at least one first channel request from the N channel requests based on the number of authorizations of each channel request and the N channel requests, and to authorize in sequence according to the request order of the at least one first channel request to determine the authorized channel request; The number of authorization times requested by the first channel is less than the authorization priority weight corresponding to the first channel - 1, and the first channel corresponds to the first channel request.
4. The arbitrator according to claim 3, characterized in that: The statistical submodule includes: a first multiplexer, M counters and a first processor connected in sequence; An input end of the first multiplexer is connected to the request processing unit, and an output end of the first multiplexer is connected to the M counters respectively; The first multiplexer is used to determine whether the authorization priority value of the channel corresponding to each received channel request is 0; N counters among the M counters correspond one-to-one to the N channel requests; Each of the N counters is used to count +1 when the authorization priority value corresponding to the corresponding channel request is not 0; The first processor is used to count the counts of the N counters, obtain the number of authorizations of the N channel requests, and output the number of authorizations of the N channel requests and the first channel request signal.
5. The arbitrator according to claim 3, characterized in that: The scheduling submodule includes a second processor, a cycle pointer subunit, an authorization subunit, and a second multiplexer connected in sequence; The second processor is connected to the statistics submodule; The second processor is used for, when determining that the target arbitration mode is the alternating weighted polling arbitration mode, processing the first channel request signal to shield the channel request that has been authorized once among the N channel requests, and sending a second channel request to the cycle pointer subunit, wherein the second channel request is the remaining channel request after shielding the channel request that has been authorized once among the N channel requests; The cycle pointer subunit is used to determine at least one third channel request from the second channel request based on the number of authorizations of the second channel request, and send the at least one third channel request to the authorization submodule; The number of authorization times of the third channel request is equal to or greater than the authorization priority value corresponding to the third channel request - 1; The authorization submodule is used to output at least one authorization channel request to the second multiplexer, wherein the authorization channel request is a channel request other than the at least one third channel request among the N channel requests; The second multiplexer is used to select an authorized channel request from the at least one authorized channel request.
6. The arbitrator according to claim 3, characterized in that: The scheduling submodule also includes: a cycle pointer subunit, an authorization subunit and a second multiplexer; The cycle pointer subunit is connected to the statistics submodule; The cycle pointer subunit is used to determine at least one fifth channel request from the authorized channel requests in the fourth channel requests based on the number of authorizations of the fourth channel request indicated by the first channel request signal, and send the at least one fifth channel request to the authorization submodule; the number of channel authorizations of the fifth channel request is equal to or greater than the authorization priority weight corresponding to the fifth channel request - 1; The authorization submodule is used to output at least one authorization channel request to the second multiplexer, wherein the at least one authorization channel request is a channel request other than the at least one fifth channel request among the N channel requests; The second multiplexer is used to select an authorized channel request from the at least one authorized channel request.
7. The arbitrator according to claim 5 or 6, characterized in that: The cycle pointer subunit is further configured to terminate the current authorization when the number of authorization times of each channel request in the N channel requests is equal to or greater than the corresponding authorization priority value - 1.
8. The arbitrator according to claim 5 or 6, characterized in that: The loop pointer submodule includes: a first AND gate, a third multiplexer, a pointer register and a fourth multiplexer; Wherein, the first input port of the first AND gate is connected to the statistical processing submodule, or connected to the alternating weighted processor, the second input port of the first AND gate is connected to the output port of the pointer register, and the first output port of the first AND gate is respectively connected to the input port of the third multiplexer and connected to the authorization submodule; The output port of the third multiplexer is respectively connected to the control port of the fourth multiplexer and to the control port of the second multiplexer; The output port of the fourth multiplexer is connected to the input port of the pointer register.
9. The arbitrator according to claim 5 or 6, characterized in that: The authorization subunit includes: a first authorization module, a second authorization module, a first NOT gate, a second NOT gate, a second AND gate and a third AND gate; Wherein, the first input port of the first authorization module is connected to the first output port of the first AND gate, and the output end of the first authorization module is connected to the input end of the first NOT gate; The output end of the first NOT gate is connected to the first input port of the second AND gate; The second input port of the second AND gate is connected to the first input port of the first authorization module, and the output end of the second AND gate is connected to the first input port of the second multiplexer; The first input port of the second authorization module is connected to the statistical subunit, and the output port of the second authorization module is connected to the input port of the second NOT gate; The output port of the second NOT gate is connected to the first input port of the third AND gate; The second input port of the third AND gate is connected to the first input port of the second authorization module, and the output port of the third AND gate is connected to the second input port of the second multiplexer.
10. An electronic device, characterized in that: The method comprises the arbitrator according to any one of claims 1 to 9.
11. A channel authorization method, characterized in that: Applied to the electronic device according to claim 10, the electronic device includes the arbitrator, and the method includes: Receive a first channel request signal, the first channel request signal includes: N channel requests, and obtain first configuration information from a configuration register of the arbitrator, the N channel requests correspond to N channels, and the first configuration information includes N authorization priority weights corresponding one-to-one to the N channels; Based on the first configuration information and the channel resource request, adopting a target arbitration mode matching the current operation scenario, determining an authorized channel request from the N channel requests, and outputting the authorized channel request; The target arbitration mode includes any one of the following: fixed priority arbitration, weighted round-robin arbitration, ordinary round-robin arbitration and alternating weighted round-robin arbitration.
12. The method according to claim 11, characterized in that After receiving the first channel request signal, the method further includes: When the target arbitration mode is the first arbitration mode, sending the first channel request signal to the first arbitration module in the arbitrator; or When the target arbitration mode is the second arbitration mode, sending the first configuration information and the first channel request signal to the second arbitration module in the arbitrator; The arbitration mode of the first arbitration module is the fixed priority arbitration, and the arbitration mode of the second arbitration module is any one of the following: the weighted round-robin arbitration, ordinary round-robin arbitration and alternating weighted round-robin arbitration.
13. The method according to claim 11, characterized in that The determining an authorized channel request from the N channel requests based on the first configuration information and the channel resource request, using a target arbitration mode matching a current operation scenario, includes: Counting the number of authorizations for each of the N channel requests; Based on the number of authorizations of each channel request and the N channel requests, determining at least one first channel request from the N channel requests, and authorizing in sequence according to the request order of the at least one first channel request to determine the authorized channel request; The number of authorization times requested by the first channel is less than the authorization priority weight corresponding to the first channel - 1, and the first channel corresponds to the first channel request.
14. The method according to claim 13, characterized in that The determining an authorized channel request from the N channel requests based on the first configuration information and the channel resource request, using a target arbitration mode matching a current operation scenario, includes: In the case where it is determined that the target arbitration mode is the alternating weighted polling arbitration mode, processing the first channel request signal to shield the channel request that has been authorized once among the N channel requests; Based on the number of authorizations of the second channel requests, at least one third channel request is determined from the second channel requests; the second channel request is the remaining channel request after shielding the channel request that has been authorized once among the N channel requests, and the number of authorizations of the third channel request is equal to or greater than the authorization priority weight corresponding to the third channel request - 1; An authorized channel request is selected from the at least one authorized channel request, where the authorized channel request is a channel request other than the at least one third channel request among the N channel requests.
15. The method according to claim 14, characterized in that The determining an authorized channel request from the N channel requests based on the first configuration information and the channel resource request, using a target arbitration mode matching a current operation scenario, includes: Based on the number of authorizations of the fourth channel request indicated by the first channel request signal, determining at least one fifth channel request from the authorized channel requests in the fourth channel request; the number of channel authorizations of the fifth channel request is equal to or greater than the authorization priority weight corresponding to the fifth channel request - 1; An authorized channel request is selected from at least one authorized channel request, where the at least one authorized channel request is a channel request other than the at least one fifth channel request among the N channel requests.
16. The arbitrator according to claim 11, characterized in that: The method further comprises: When the number of authorization times of each channel request in the N channel requests is equal to or greater than the corresponding authorization priority value - 1, this authorization is terminated.
17. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the channel authorization method as claimed in any one of claims 11 to 16.
18. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps of the channel authorization method according to any one of claims 11 to 16 are implemented.
Citation Information
Cited By
Data transmission method and device, electronic equipment and computer readable storage medium
CN120811996A
Polling arbitration method and device supporting access of multiple master control peripheral devices
CN121996589A
Communication method and electronic equipment
CN122489477A
Communication methods and electronic devices
CN122489477B
