Arbitration method, device, equipment, medium and product for input request
By using sequence number generators and verifiers for arbitration processing in multi-level interconnection networks, the maximum delay problem caused by polling arbitration is solved, streaming processing of the first-come, first-served policy is realized, resource overhead is reduced and Improved throughput.
Patent Information
- Application Number
- CN202410823782.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-06-25
AI Technical Summary
In traditional multi-level interconnection networks, the polling arbitration algorithm causes the input data that arrives first to fail to receive the earliest response with a high probability, which increases the maximum delay of the request. In addition, chips based on digital logic circuits implement first-request-first-serve. The method is complex, consumes a lot of resources, and reduces the throughput rate of the Internet network.
A sequence number generator is used to detect and mark the input channel in the current clock cycle, and the sequence number is used for arbitration request processing, which reduces resource overhead and enables streaming processing. The second sequence number generator checksum is used to process the arbitration request, and the arbitration request is processed according to the predetermined Set the rule to be transferred to the output channel.
Without increasing the average delay, the maximum delay of requests is reduced, resource overhead is saved, and the throughput rate of the Internet network is improved.
Smart Images

Figure CN118377743B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of hardware technology, and in particular to an arbitration method, device, equipment, medium and product for input requests. Background Art
[0002] A multi-level interconnection network is generally composed of multiple switching nodes, which are divided into multiple levels and connected to each other to complete the data exchange between input ports and output ports, such as Figure 1 It is a typical multi-level interconnection network. The arbitrator is an indispensable logic in the multi-level interconnection network, which is used to arbitrate multiple input channels and select the appropriate one as the output. Traditional arbitrators often use the Round-Robin algorithm. The output port starts from the last authorized input port, queries the next valid input port and grants authorization, and then starts with the input port next time, and so on. However, due to the random nature of polling arbitration, the input data that arrives at the node first will most likely not get the first response, but will need to wait. Therefore, compared to first-come, first-served, although polling arbitration does not change the total delay of all requests, it will increase the maximum delay of the request, which also means that the system needs to prepare more cache resources.
[0003] The traditional first-request, first-served approach can effectively solve the above problems. This approach requires that when a node receives a request, it records the arrival time of the request. Then, an arbitrator sorts the arrival times of all requests to prioritize the earliest request. This approach is suitable for processor-based software implementations, but for digital logic chip implementations, it has the following problems: recording timestamps requires a large data bit width, which results in high resource overhead; sorting multiple data to find the minimum value generally requires multiple clock cycles, which prevents requests from being streamed and significantly reduces internet throughput; and implementing minimum value search in hardware circuits is complex because finding the minimum value requires comparing multiple numbers pairwise. For hardware circuits, each value is an input signal, which means that a circuit path must exist between each two signals, which complicates the circuit.
[0004] Therefore, the above technical problems are in urgent need of being solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the present invention aims to provide an arbitration method, apparatus, device, medium, and product for input requests, which can reduce the maximum latency of requests, save resource overhead, and achieve streaming processing of requests. The specific solution is as follows:
[0006] In a first aspect, the present invention discloses an arbitration method for input requests, which is applied to an arbitrator connected to any output channel, wherein the arbitrator is connected to at least two input channels, comprising:
[0007] Detecting each of the input channels in a current clock cycle to determine whether there is an input request that meets a preset valid request condition in each of the input channels;
[0008] If there is an input request that meets the preset valid request condition in at least one input channel, marking the input request of the at least one input channel using the current sequence number generated by the first sequence number generator in the current clock cycle, and storing the marked input requests into a cache;
[0009] The input request output by the cache is verified using the current expected sequence number generated by the second sequence number generator to generate an arbitration request for the input request that passes the verification, and the arbitration request is transmitted to the output channel for processing according to a preset rule.
[0010] Optionally, if there is an input request that meets the preset valid request condition in at least one input channel, the method further includes:
[0011] A first sequence number switching instruction is sent to the first sequence number generator so that when the first sequence number generator detects the presence of an input request that meets a preset valid request condition in at least one input channel in the next clock cycle, the first sequence number generator generates a next sequence number corresponding to the current sequence number in a preset sequence number order, so as to use the next sequence number to mark the input request of the input channel.
[0012] Optionally, after determining whether there is an input request that meets a preset valid request condition in each input channel, the method further includes:
[0013] If there is no input request that meets the preset valid request condition in each of the input channels, it is prohibited to send the first serial number switching instruction to the first serial number generator, so that when the first serial number generator detects that there is an input request that meets the preset valid request condition in at least one input channel in the next clock cycle, it generates the current serial number and uses the current serial number to mark the input request of the input channel.
[0014] Optionally, when the first serial number generator obtains the first serial number switching instruction, it generates a preset number of serial numbers with different numerical values in sequence according to the preset serial number sequence; wherein, the preset serial number sequence includes a first serial number sequence for generating serial numbers in a manner from small to large numerical values, a second serial number sequence for generating serial numbers in a manner from large to small numerical values, and a third serial number sequence for generating serial numbers according to the arrangement order of custom values.
[0015] Optionally, the arbitration method for input requests further includes:
[0016] Determine the maximum number of input requests that the cache supports storing;
[0017] The preset number is set based on the maximum number; wherein the preset number is not less than the maximum number.
[0018] Optionally, the second serial number generator generates serial numbers in the same manner as the first serial number generator, and the second serial number generator and the first serial number generator use the same type of counter and the same initial value of the counter.
[0019] Optionally, after transmitting the arbitration request to the output channel for processing according to a preset rule, the method further includes:
[0020] After checking that all the arbitration requests have been processed, a second sequence number switching instruction is sent to the second sequence number generator so that the second sequence number generator generates the next expected sequence number corresponding to the current expected sequence number according to the preset sequence number sequence, so as to use the next expected sequence number to verify the input request of the cache output.
[0021] Optionally, if there is an input request that meets the preset valid request condition in at least one input channel, the method further includes:
[0022] Counting the total number of input requests that meet the preset valid request condition, and storing the total number in the target memory;
[0023] Accordingly, checking whether all arbitration requests have been processed includes:
[0024] Obtain the total quantity from the target storage;
[0025] detecting whether the number of processed arbitration requests is the same as the total number;
[0026] If they are the same, it is determined that all the arbitration requests have been processed.
[0027] Optionally, each of the input channels is connected to a different buffer;
[0028] Accordingly, storing the marked input requests into a cache includes:
[0029] Each of the marked input requests is stored in a buffer connected to the corresponding output channel.
[0030] Optionally, the cache is a first-in-first-out memory, and the first-in-first-out memory is used to output each of the input requests after the mark written into the current clock cycle in the same clock cycle.
[0031] Optionally, the determining whether there is an input request that meets a preset valid request condition in each input channel includes:
[0032] Detecting whether there is a data packet start marker corresponding to a valid input request in each of the input channels;
[0033] If the data packet start mark exists, determining whether the target input request with the data packet start mark completes data handshake with the corresponding cache according to the preset flag bit of the cache;
[0034] If the data handshake is completed, the target input request is determined to be an input request that meets the preset valid request condition.
[0035] Optionally, the sending the first sequence number switching instruction to the first sequence number generator includes:
[0036] Performing an XOR operation on the data packet start mark and the preset flag bit;
[0037] If the XOR operation result is a preset value, a first serial number switching instruction is generated and sent to the first serial number generator.
[0038] Optionally, verifying the input request output by the cache using the current expected sequence number generated by the second sequence number generator to generate an arbitration request for the input request that passes the verification includes:
[0039] Obtain the current expected sequence number generated by the second sequence number generator;
[0040] Comparing the sequence number of each input request output by the cache with the current expected sequence number to filter out input requests having the same sequence number as the current expected sequence number;
[0041] An arbitration request is generated for an input request having a sequence number that is the same as the current expected sequence number.
[0042] Optionally, transmitting the arbitration request to the output channel for processing according to a preset rule includes:
[0043] If the number of the arbitration request is one, directly transmitting the arbitration request to the output channel for processing;
[0044] If there are multiple arbitration requests, each arbitration request is sequentially transmitted to the output channel for processing according to a preset multi-request processing rule.
[0045] Optionally, sequentially transmitting each arbitration request to the output channel for processing according to a preset multi-request processing rule includes:
[0046] Determining the channel number of the input channel corresponding to each arbitration request;
[0047] The arbitration requests are polled in sequence according to the channel numbers from small to large, so as to transmit the arbitration requests to the output channel for processing.
[0048] Optionally, sequentially transmitting each arbitration request to the output channel for processing according to a preset multi-request processing rule includes:
[0049] Determining a current value of the target register; the current value is determined based on the sum of the channel number of the input channel corresponding to the first arbitration request polled in the previous round and a preset channel number interval;
[0050] Starting from the current value, each arbitration request is polled in sequence based on the channel number of the input channel corresponding to each arbitration request, so as to transmit each arbitration request to the output channel for processing.
[0051] In a second aspect, the present invention discloses an arbitration device for input requests, which is applied to an arbitrator connected to any output channel, wherein the arbitrator is connected to at least two input channels, and the device comprises:
[0052] a request detection module, configured to detect each of the input channels in a current clock cycle to determine whether there is an input request in each of the input channels that meets a preset valid request condition;
[0053] a sequence number marking module, configured to mark the input requests of the at least one input channel using a current sequence number generated by the first sequence number generator in the current clock cycle if there is an input request that meets the preset valid request condition in the at least one input channel, and store the marked input requests in a cache;
[0054] A verification module is used to verify the input request output by the cache using the current expected sequence number generated by the second sequence number generator, so as to generate an arbitration request for the input request that passes the verification, and transmit the arbitration request to the output channel for processing according to preset rules.
[0055] In a third aspect, the present invention discloses an electronic device, comprising:
[0056] Memory, used to store computer programs;
[0057] The processor is configured to execute the computer program to implement the steps of the aforementioned arbitration method for input requests.
[0058] In a fourth aspect, the present invention discloses a computer program product, comprising a computer program / instruction, which implements the steps of the aforementioned input request arbitration method when executed by a processor.
[0059] In a fifth aspect, the present invention discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the arbitration method of the input request disclosed above are implemented.
[0060] It can be seen that the present invention discloses an arbitration method for input requests, which is applied to an arbitrator connected to any output channel, and the arbitrator is connected to at least two input channels. The method includes: detecting each of the input channels in the current clock cycle to determine whether there is an input request that meets a preset valid request condition in each of the input channels; if there is an input request that meets the preset valid request condition in at least one input channel, marking the input request of the at least one input channel using a current sequence number generated by a first sequence number generator in the current clock cycle, and storing each marked input request in a cache; verifying the input request output from the cache using a current expected sequence number generated by a second sequence number generator, so as to generate an arbitration request for the input request that passes the verification, and transmitting the arbitration request to the output channel for processing according to preset rules.
[0061] Beneficial Effects: Each output channel in the present invention is connected to a corresponding arbiter, which is connected to at least two input channels. This means that the arbiter in the present invention is suitable for multi-input, single-output scenarios. First, the arbiter checks each input channel in the current clock cycle to determine whether there are input requests that meet the preset valid request conditions in each input channel, that is, to determine whether there are valid requests in each input channel. If there is an input request that meets the preset valid request conditions in at least one input channel, the input request of the at least one input channel is marked using the current sequence number generated by the first sequence number generator in the current clock cycle, and then each marked input request is stored in a cache. Specifically, first, the present invention does not use the timestamp of the request arrival for marking, but instead uses the current sequence number generated by the first sequence number generator to mark the request. Because the data bit width of the sequence number is much smaller than the data bit width of the timestamp, this saves resource overhead. Second, the present invention checks all input channels in the current clock cycle. Therefore, if there are input requests that meet the preset valid request conditions in multiple input channels, these input requests are marked with the same current sequence number so that these identically marked requests can be processed together later. Furthermore, the present invention verifies incoming requests from the cache using the current expected sequence number generated by a second sequence number generator, rather than using a sorting circuit. This reduces processing clock cycles and enables streaming of requests. Finally, arbitration requests are generated for incoming requests that pass verification and transmitted to the output channel for processing according to pre-set rules. This approach, based on a first-come, first-served arbitration strategy, reduces the maximum latency of requests without increasing the average latency. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0063] Figure 1 A schematic diagram of a multi-level interconnection network disclosed in the present invention;
[0064] Figure 2 A flow chart of an arbitration method for inputting a request disclosed in the present invention;
[0065] Figure 3 A connection diagram of an arbitrator disclosed in the present invention;
[0066] Figure 4 A schematic diagram of a sequence number switching logic disclosed in the present invention;
[0067] Figure 5 A schematic diagram of a cache connection disclosed in the present invention;
[0068] Figure 6 A flowchart of a specific arbitration method for inputting a request disclosed in the present invention;
[0069] Figure 7 A schematic diagram of a serial number verification logic disclosed in the present invention;
[0070] Figure 8 A flowchart of processing an arbitration request disclosed in the present invention;
[0071] Figure 9 This is a schematic structural diagram of an arbitration device for inputting a request disclosed in the present invention;
[0072] Figure 10 This is a structural diagram of an electronic device disclosed in the present invention. DETAILED DESCRIPTION
[0073] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0074] Figure 1 This is a typical multi-stage interconnection network, consisting of three levels of nodes. Each first-level node has four inputs, connected to four input ports, and five outputs, connected to each second-level node. Each second-level node has four inputs, connected to each first-level node, and five outputs, connected to each third-level node. Each third-level node has five inputs, connected to each second-level node, and four outputs, connected to four output ports. As can be seen, since these nodes perform multi-input and multi-output data exchange, an arbitrator is required to arbitrate the input data and switch it to the appropriate output channel.
[0075] Traditional arbitrators often use a round-robin scheduling algorithm, where the output port starts with the last authorized input port, queries the next valid input port and grants authorization, then starts with that input port again, and so on. However, due to the inherent randomness of round-robin arbitration, the input data that arrives at the node first will most likely not receive the first response, but will need to wait. Therefore, compared to first-come, first-served, round-robin arbitration does not change the total delay of all requests, but will increase the maximum delay of requests, which also means that the system needs to prepare more cache resources. For delay-sensitive applications such as audio, video, or feedback control systems, the increase in maximum delay is even more unacceptable. More seriously, for multi-level interconnected networks, each cascade level will further exacerbate the above-mentioned maximum delay increase effect.
[0076] The traditional first-request, first-served approach can effectively solve the above problems. This approach requires that when a node receives a request, it records the arrival time of the request. Then, an arbitrator sorts the arrival times of all requests to prioritize the earliest request. This approach is suitable for processor-based software implementations, but for digital logic chip implementations, it has the following problems: recording timestamps requires a large data bit width, which results in high resource overhead; sorting multiple data to find the minimum value generally requires multiple clock cycles, which prevents requests from being streamed and significantly reduces internet throughput; and implementing minimum value search in hardware circuits is complex because finding the minimum value requires comparing multiple numbers pairwise. For hardware circuits, each value is an input signal, which means that a circuit path must exist between each two signals, which complicates the circuit.
[0077] To this end, embodiments of the present invention disclose an arbitration method, apparatus, device, medium, and product for input requests, which can reduce the maximum delay of requests, save resource overhead, and implement streaming processing of requests.
[0078] See also Figure 2 As shown, an embodiment of the present invention discloses an input request arbitration method, which is applied to an arbitrator connected to any output channel, wherein the arbitrator is connected to at least two input channels. The method includes:
[0079] Step S11: detecting each of the input channels in the current clock cycle to determine whether there is an input request in each of the input channels that meets a preset valid request condition.
[0080] In this embodiment, any output channel is connected to a corresponding arbitrator, and the arbitrator is connected to at least two input channels, that is, the arbitrator in the present invention is suitable for multi-input-single-output scenarios. For a multi-level interconnection network, each multi-input multi-output switching node can be connected according to Figure 3 It is abstracted into multiple multi-input-single-output channels, each output channel contains a multi-input-single-output arbitrator, that is, Figure 3 As shown, it is assumed that there are N input channels and M output channels, each output channel is connected to an arbiter, and the arbiters are connected to the N input channels.
[0081] In the current clock cycle, the serial number switching logic inside the arbiter will detect each input channel to determine whether there is an input request that meets the preset valid request conditions in each input channel, that is, to determine whether there is a valid request in each input channel.
[0082] In a specific embodiment, determining whether an input request that meets the preset valid request conditions exists in each input channel includes: detecting whether a packet start marker corresponding to a valid input request exists in each input channel; if the packet start marker exists, determining, based on a preset flag bit of the cache, whether the target input request that has the packet start marker has completed data handshaking with the corresponding cache; if data handshaking has been completed, determining the target input request as an input request that meets the preset valid request conditions. Specifically, for each input channel, determining whether a packet start marker corresponding to a valid input request exists in each input channel in the current clock cycle, i.e., determining whether the channel is a valid request, and whether the valid request has completed data handshaking with the corresponding cache; if data handshaking has been completed, determining the target input request as an input request that meets the preset valid request conditions. Determining the valid request start marker not only identifies valid requests but also ensures that multi-cycle requests with data are only calculated once. It's understandable that data transmission protocols typically define special bytes to indicate the start of a data packet, known as a packet start marker. Detecting the packet start marker indicates whether the channel is a valid request. Furthermore, when the cache is ready to receive data, it also sets a preset flag value to enable handshake completion with the request. Therefore, when a valid request is received on the input channel and the data handshake completes, the input request is considered to meet the preset valid request conditions.
[0083] It's important to note that if a write fails due to a full cache, even if the request is valid, it doesn't satisfy the aforementioned pre-set valid request conditions. Furthermore, for requests with data, if the data packet is long, only confirmation of whether the request was written is required. Furthermore, it's important to note that each input request is counted as meeting the pre-set valid request conditions only once. That is, once an input request is determined to meet the pre-set valid request conditions in a given clock cycle, certain actions must be taken to ensure that the request isn't counted as meeting the conditions again in the next clock cycle.
[0084] The specific approach is as follows: First, a state machine is set up with two states: idle and packet receive. After the circuit is reset, the state machine is set to the idle state. When a valid request is received and successfully written to the cache, the state machine jumps to the packet receive state in the next clock cycle. When the packet end condition is detected, the state machine jumps back to the idle state in the next clock cycle. If both the packet start condition and the packet end condition are met, the state machine remains in the idle state for the next clock cycle. In addition, a packet counter is set up. Each clock cycle, if a data handshake is completed, the count value is incremented by one and the counter is written to the next clock cycle. If the packet end condition is detected, the counter is cleared to zero in the next clock cycle. If both the above conditions are met, the counter is cleared to zero in the next clock cycle. The packet end condition is that the packet ends if the data handshake is completed in the current clock cycle and the packet counter value incremented by one equals the packet length. After implementing these steps, the method to ensure that a request is not written multiple times is to only consider the request to be satisfied when the following conditions are met: when the state machine is in the idle state and a valid request is received.
[0085] Step S12: If there is an input request that meets the preset valid request condition in at least one input channel, the input request of the at least one input channel is marked using the current serial number generated by the first serial number generator in the current clock cycle, and the marked input requests are stored in the cache.
[0086] In this embodiment, if an input request that meets a preset valid request condition exists in at least one input channel, the input request of the at least one input channel is marked using the current sequence number generated by the first sequence number generator in the current clock cycle, and then each marked input request is stored in a cache. Specifically, first, the present invention does not use the timestamp of the request arrival for marking, but instead uses the current sequence number generated by the first sequence number generator to mark the request. Because the data bit width of the sequence number is much smaller than the data bit width of the timestamp, this saves resource overhead. Second, the present invention checks all input channels in the current clock cycle. Therefore, when input requests that meet the preset valid request condition exist on multiple input channels, these input requests are marked with the same tag using the current sequence number, so that these identically marked requests can be processed together later.
[0087] In a specific embodiment, if there is an input request that meets the preset valid request condition in at least one input channel, the above-mentioned method further includes: sending a first sequence number switching instruction to the first sequence number generator, so that when the first sequence number generator detects that there is an input request that meets the preset valid request condition in at least one input channel in the next clock cycle, it generates a next sequence number corresponding to the current sequence number according to the preset sequence number sequence, so as to use the next sequence number to mark the input request of the input channel. That is, if there is an input request that meets the preset valid request condition in any input channel among all the input channels, the first sequence number switching instruction is sent to the first sequence number generator, so that when there is a valid request in the next clock cycle, the sequence number is switched according to the preset sequence number sequence. For example, assuming that the preset sequence number sequence is 0, 1, 2...N, and the current sequence number is 2, then the next clock cycle switches to the next sequence number 3.
[0088] Specifically, sending the first sequence number switching instruction to the first sequence number generator includes: performing an XOR operation on the data packet start mark and the preset flag bit; if the XOR operation result is a preset value, generating a first sequence number switching instruction, and sending the first sequence number switching instruction to the first sequence number generator. That is, the input request and data handshake signal will be sent to the sequence number switching logic, so that the sequence number switching logic will perform an XOR operation on the data packet start mark and the preset flag bit. If the XOR operation result is a preset value, then the first sequence number switching instruction will be generated and sent to the first sequence number generator. An implementation example of the sequence number switching logic is as follows: Figure 4 As shown, the judgment logic output of each channel generates a serial number switching instruction through the exclusive OR logic.
[0089] In another specific embodiment, after determining whether there is an input request that meets the preset valid request condition in each of the input channels, the method further includes: if there is no input request that meets the preset valid request condition in each of the input channels, prohibiting the sending of the first sequence number switching instruction to the first sequence number generator, so that when the first sequence number generator detects the presence of an input request that meets the preset valid request condition in at least one input channel in the next clock cycle, it generates the current sequence number and uses the current sequence number to mark the input request of the input channel. In other words, if no input channel has an input request that meets the preset valid request condition, the first sequence number switching instruction cannot be sent to the first sequence number generator, and the sequence number generated by the first sequence number generator needs to remain unchanged. Therefore, when the first sequence number generator detects the presence of an input request that meets the preset valid request condition in at least one input channel in the next clock cycle, it still generates the current sequence number and uses the current sequence number to mark the input request of the input channel.
[0090] When the first serial number generator obtains the first serial number switching instruction, it generates a preset number of serial numbers with different numerical values in sequence according to the preset serial number sequence; wherein, the preset serial number sequence includes a first serial number sequence for generating serial numbers in a manner of numerical values from small to large, a second serial number sequence for generating serial numbers in a manner of numerical values from large to small, and a third serial number sequence for generating serial numbers according to an arrangement order of user-defined values. That is, the first serial number generator is used to generate serial numbers, and the generator needs to be able to generate a preset number (L) of serial numbers with different numerical values in sequence, and then loop. wherein, the preset serial number sequence can be to generate serial numbers in a manner of numerical values from small to large, to generate serial numbers in a manner of numerical values from large to small, or to generate serial numbers according to an arrangement order of user-defined values.
[0091] Furthermore, the above method further includes: determining the maximum number of input requests that the cache supports storing; setting the preset number based on the maximum number; wherein the preset number is not less than the maximum number. That is, the preset number L needs to be greater than or equal to the maximum number of input requests that can be stored in the cache. A simple serial number generator is an N-bit counter, where 2 N ≥L, when the counter is equal to 2 N -1 and receives a switching instruction, the counter returns to zero.
[0092] Among them, Figure 5 As shown, each input channel is connected to a different cache; accordingly, storing each marked input request in the cache includes storing each marked input request in the cache connected to the corresponding output channel. That is, the input request is stored in the cache along with the current sequence number. In a specific embodiment, the cache is a first-in-first-out (FIFO) memory, which is configured to output each marked input request written in the current clock cycle in the same clock cycle. That is, if input requests from any multiple input channels complete data handshakes with the corresponding cache in the same clock cycle, i.e., if multiple input requests are written to the cache in the same clock cycle, the FIFO memory can ensure that the multiple input requests appear at the cache output in the same clock cycle (which may be several clock cycles later). It should be noted that the cache is an optional component used to improve the performance of multi-stage interconnects. If a cache is not used, data can be passed directly to the next stage, or a pipeline with several stages can be used.
[0093] Step S13: using the current expected sequence number generated by the second sequence number generator to verify the input request output by the cache, to generate an arbitration request for the input request that passes the verification, and to transmit the arbitration request to the output channel for processing according to a preset rule.
[0094] In this embodiment, the current expected sequence number generated by the second sequence number generator is used to verify the input request output by the cache, rather than using a sorting circuit, thereby reducing the processing clock cycle, allowing the request to be streamed, and finally generating an arbitration request for the input request that passes the verification, and transmitting the arbitration request to the output channel for processing according to preset rules.
[0095] The second serial number generator generates serial numbers in the same manner as the first serial number generator, and the second serial number generator uses the same type of counter as the first serial number generator, and the initial value of the counter is the same. That is, the second serial number generator needs to generate the same serial number as the first serial number generator and have the same initial state as the first serial number generator. For example, when the first serial number generator is implemented using an N-bit counter, the second serial number generator also needs to be implemented using an N-bit counter, and the two counters have the same initial value. When the second serial number generator receives a serial number switching instruction in a certain clock cycle, it will switch to the next serial number.
[0096] In a specific embodiment, after transmitting the arbitration requests to the output channel for processing according to a preset rule, the method further includes: after verifying that each arbitration request has been processed, sending a second sequence number switching instruction to the second sequence number generator, so that the second sequence number generator generates a next expected sequence number corresponding to the current expected sequence number according to the preset sequence number sequence, and uses the next expected sequence number to verify the input request output by the cache. That is, after verifying that each arbitration request has been processed, sending a second sequence number switching instruction to the second sequence number generator, so that the second sequence number generator switches the sequence number according to the preset sequence number sequence. This embodiment can adopt a synchronous FIFO, where the input and output use the same clock to ensure that input requests marked with the same sequence number appear at the output of the cache at the same time, and then undergo verification and generate arbitration requests simultaneously. This avoids the situation where, when multiple input requests with the same sequence number arrive at the cache output at different times, the cache may assume that all arbitration requests have been processed and switch the expected sequence number to the next one, causing the later-arriving input request to fail verification and be locked.
[0097] Furthermore, this embodiment specifically provides a method for determining whether all arbitration requests have been processed. Specifically, if at least one input channel contains an input request that meets the preset valid request condition, the method further includes: counting the total number of input requests that meet the preset valid request condition and storing the total number in a target memory. Accordingly, checking whether all arbitration requests have been processed includes: obtaining the total number from the target memory; detecting whether the number of processed arbitration requests is the same as the total number; if so, determining that all arbitration requests have been processed. Specifically, the method counts the number of all valid requests in the input channel and stores the total number in the target memory. When checking whether all arbitration requests have been processed, the method obtains the total number from the target memory and detects whether the number of processed arbitration requests is the same as the total number. If so, processing has been completed; otherwise, processing has not yet been completed.
[0098] It can be seen that the present invention discloses an arbitration method for input requests, which is applied to an arbitrator connected to any output channel, and the arbitrator is connected to at least two input channels. The method includes: detecting each of the input channels in the current clock cycle to determine whether there is an input request that meets a preset valid request condition in each of the input channels; if there is an input request that meets the preset valid request condition in at least one input channel, marking the input request of the at least one input channel using a current sequence number generated by a first sequence number generator in the current clock cycle, and storing each marked input request in a cache; verifying the input request output from the cache using a current expected sequence number generated by a second sequence number generator, so as to generate an arbitration request for the input request that passes the verification, and transmitting the arbitration request to the output channel for processing according to preset rules.
[0099] Beneficial Effects: Each output channel in the present invention is connected to a corresponding arbiter, which is connected to at least two input channels. This means that the arbiter in the present invention is suitable for multi-input, single-output scenarios. First, the arbiter checks each input channel in the current clock cycle to determine whether there are input requests that meet the preset valid request conditions in each input channel, that is, to determine whether there are valid requests in each input channel. If there is an input request that meets the preset valid request conditions in at least one input channel, the input request of the at least one input channel is marked using the current sequence number generated by the first sequence number generator in the current clock cycle, and then each marked input request is stored in a cache. Specifically, first, the present invention does not use the timestamp of the request arrival for marking, but instead uses the current sequence number generated by the first sequence number generator to mark the request. Because the data bit width of the sequence number is much smaller than the data bit width of the timestamp, this saves resource overhead. Second, the present invention checks all input channels in the current clock cycle. Therefore, if there are input requests that meet the preset valid request conditions in multiple input channels, these input requests are marked with the same current sequence number so that these identically marked requests can be processed together later. Furthermore, the present invention verifies incoming requests from the cache using the current expected sequence number generated by a second sequence number generator, rather than using a sorting circuit. This reduces processing clock cycles and enables streaming of requests. Finally, arbitration requests are generated for incoming requests that pass verification and transmitted to the output channel for processing according to pre-set rules. This approach, based on a first-come, first-served arbitration strategy, reduces the maximum latency of requests without increasing the average latency.
[0100] See also Figure 6 As shown, the embodiment of the present invention discloses a specific arbitration method for input requests. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, it includes:
[0101] Step S21: Detecting each of the input channels in the current clock cycle to determine whether there is an input request that meets a preset valid request condition in each of the input channels.
[0102] Step S22: If there is an input request that meets the preset valid request condition in at least one input channel, the input request of the at least one input channel is marked using the current serial number generated by the first serial number generator in the current clock cycle, and each marked input request is stored in the cache.
[0103] Step S23: Obtain the current expected sequence number generated by the second sequence number generator; compare the sequence number of each input request output by the cache with the current expected sequence number to filter out the input request whose sequence number is the same as the current expected sequence number; generate an arbitration request for the input request whose sequence number is the same as the current expected sequence number.
[0104] In this embodiment, the sequence number of the input request output from the cache will be passed through the sequence number verification logic. The sequence number verification logic compares the sequence number of the input request with the current expected sequence number generated by the second sequence number generator to ensure that only input requests with the current expected sequence number can issue arbitration requests. Requests that pass the verification will generate arbitration requests, while requests that fail the verification will not generate arbitration requests for the time being. The arbitrator only processes valid requests in response to the arbitration request, thereby avoiding the timestamp-based sorting logic.
[0105] It is understandable that the traditional method uses a timestamp and a sorting circuit to select the request with the earliest timestamp. This circuit is relatively complex and requires multiple clock cycles. The embodiment of the present invention does not use a timestamp, but a serial number. Therefore, at the output port of the cache, the request with the same expected serial number as the current one is the earliest request and needs to be processed first. If it is not equal, it needs to wait. Therefore, the core of the serial number verification logic circuit of the present invention is a comparator circuit with equal comparison values, and the structure is very simple. An example of a serial number verification logic is as follows: Figure 7 As shown, similar to the sequence number switching logic, the verification logic also needs to judge the packet start for the multi-cycle request packet. When the start marker of the data packet of the valid request is detected, the data handshake is completed, and the sequence number of the input request is equal to the current expected sequence number, an arbitration request is generated.
[0106] Step S24: If the number of the arbitration request is one, directly transmit the arbitration request to the output channel for processing.
[0107] In this embodiment, the arbitrator processes arbitration requests from all channels and generates a sequence number switching instruction after the processing is completed. Figure 8 As shown, when the arbitrator receives only one arbitration request, it authorizes the input channel of the arbitration request, directly transmits the arbitration request to the output channel for processing, and switches the expected sequence number after the processing is completed.
[0108] Step S25: If there are multiple arbitration requests, each arbitration request is sequentially transmitted to the output channel for processing according to a preset multi-request processing rule.
[0109] In this embodiment, when the arbitrator receives multiple arbitration requests, it sequentially transmits all arbitration requests to the output channel for processing according to the preset multi-request processing rules, that is, it sequentially authorizes the input channel corresponding to each arbitration request according to the preset multi-request processing rules, and switches the expected sequence number after all arbitration requests are processed, such as Figure 8 shown.
[0110] In one specific embodiment, sequentially transmitting each arbitration request to the output channel for processing according to a preset multi-request processing rule includes: determining the channel number of the input channel corresponding to each arbitration request; and sequentially polling each arbitration request in ascending order of the channel numbers to transmit each arbitration request to the output channel for processing. That is, when there are multiple arbitration requests, a most direct method is to use round-robin polling, i.e., determining the channel number of the input channel corresponding to each arbitration request, and sequentially polling each arbitration request in ascending order of the channel numbers. Alternatively, polling can be performed in descending order, which is not limited in this embodiment.
[0111] In another specific embodiment, the method of sequentially transmitting each arbitration request to the output channel for processing according to a preset multi-request processing rule includes: determining a current value of a target register; the current value is determined based on the sum of the channel number of the input channel corresponding to the first arbitration request polled in the previous round and a preset channel number interval; and starting from the current value, sequentially polling each arbitration request based on the channel number of the input channel corresponding to each arbitration request, so as to transmit each arbitration request to the output channel for processing. It is understandable that if a polling method is adopted, the priority of the channel may be potentially determined by the channel number. For example, if the channel number is polled in ascending order, the channel with a small channel number has a natural advantage. This advantage will make the delay of the channel with a small number always smaller than that of the channel with a large number. In essence, the delay of the channel with a large number is always increased in exchange for the low delay of the channel with a low number. Therefore, the present invention sets a target register with an initial value of 0. When multiple arbitration requests are received, polling begins with the channel represented by the current value in the target register. Assuming the preset channel number interval is 1, that is, the channel numbers are a series of consecutive numbers, after each polling, the value of the target register is set to the number of the first channel polled in the previous round + 1. This way, the first channel processed in each polling will receive the lowest priority in the next polling, so the channel with the lowest delay will most likely receive the highest delay in the next polling. This facilitates equalization of delays between channels, reduces the maximum delay, and thus optimizes delay distribution.
[0112] For more specific processing procedures of the above steps S21 and S22, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0113] It can be seen that the present invention uses a relatively simple comparator circuit to determine the order of input requests. The core is to use the second sequence number generator that is the same as the first sequence number generator, and only process the input request with the same expected sequence number at a time. After all requests with the same expected sequence number are processed, it switches to the next expected sequence number. For the first-come-first-served method using a timestamp, the present invention will have a simpler circuit structure, less hardware resources, and the comparison logic can be easily completed in one clock cycle, which can achieve streaming processing of requests, and the throughput will be much higher than the traditional method. In addition, the present invention uses sequence numbers to mark the order of input requests. The characteristics are that the data bit width of the sequence number is much lower than the data bit width of the timestamp, and the input requests in the same clock cycle will be marked with the same sequence number, and the input requests in different clock cycles will be marked with different sequence numbers; and each sequence number will be used for at least one input request, and there will be no situation where some sequence numbers are skipped and not used. Compared with the traditional method of using polling arbitration, the solution of the present invention can not increase the average delay and can significantly reduce the maximum delay of the request being served. In random scenarios, the delay distribution of the service will be more concentrated on the average delay, so the distribution characteristics are better.
[0114] See also Figure 9 As shown, an embodiment of the present invention discloses an arbitration device for input requests, which is applied to an arbitrator connected to any output channel, wherein the arbitrator is connected to at least two input channels, and the device includes:
[0115] The request detection module 11 is configured to detect each of the input channels in a current clock cycle to determine whether there is an input request in each of the input channels that meets a preset valid request condition;
[0116] a sequence number marking module 12 configured to mark the input requests of the at least one input channel using the current sequence number generated by the first sequence number generator in the current clock cycle if there are input requests that meet the preset valid request condition in the at least one input channel, and store the marked input requests in a cache;
[0117] The verification module 13 is used to verify the input request output by the cache using the current expected sequence number generated by the second sequence number generator, to generate an arbitration request for the input request that passes the verification, and to transmit the arbitration request to the output channel for processing according to preset rules.
[0118] It can be seen that the present invention discloses an arbitration device for input requests, which is applied to an arbitrator connected to any output channel, and the arbitrator is connected to at least two input channels, comprising: a request detection module, used to detect each of the input channels in the current clock cycle to determine whether there is an input request that meets the preset valid request condition in each of the input channels; a sequence number marking module, used to mark the input request of the at least one input channel using the current sequence number generated by a first sequence number generator in the current clock cycle if there is an input request that meets the preset valid request condition in at least one input channel, and store the marked input requests into a cache; a verification module, used to verify the input requests output by the cache using the current expected sequence number generated by a second sequence number generator, so as to generate an arbitration request for the input request that passes the verification, and transmit the arbitration request to the output channel for processing according to preset rules.
[0119] Beneficial Effects: Each output channel in the present invention is connected to a corresponding arbiter, which is connected to at least two input channels. This means that the arbiter in the present invention is suitable for multi-input, single-output scenarios. First, the arbiter checks each input channel in the current clock cycle to determine whether there are input requests that meet the preset valid request conditions in each input channel, that is, to determine whether there are valid requests in each input channel. If there is an input request that meets the preset valid request conditions in at least one input channel, the input request of the at least one input channel is marked using the current sequence number generated by the first sequence number generator in the current clock cycle, and then each marked input request is stored in a cache. Specifically, first, the present invention does not use the timestamp of the request arrival for marking, but instead uses the current sequence number generated by the first sequence number generator to mark the request. Because the data bit width of the sequence number is much smaller than the data bit width of the timestamp, this saves resource overhead. Second, the present invention checks all input channels in the current clock cycle. Therefore, if there are input requests that meet the preset valid request conditions in multiple input channels, these input requests are marked with the same current sequence number so that these identically marked requests can be processed together later. Furthermore, the present invention verifies incoming requests from the cache using the current expected sequence number generated by a second sequence number generator, rather than using a sorting circuit. This reduces processing clock cycles and enables streaming of requests. Finally, arbitration requests are generated for incoming requests that pass verification and transmitted to the output channel for processing according to pre-set rules. This approach, based on a first-come, first-served arbitration strategy, reduces the maximum latency of requests without increasing the average latency.
[0120] In some specific embodiments, if there is an input request that meets the preset valid request condition in at least one input channel, the device is further used to send a first sequence number switching instruction to the first sequence number generator, so that when the first sequence number generator detects that there is an input request that meets the preset valid request condition in at least one input channel in the next clock cycle, it generates a next sequence number corresponding to the current sequence number in accordance with a preset sequence number sequence, so as to use the next sequence number to mark the input request of the input channel.
[0121] In some specific embodiments, after determining whether there is an input request that meets the preset valid request condition in each of the input channels, the device is further used to prohibit sending the first sequence number switching instruction to the first sequence number generator if there is no input request that meets the preset valid request condition in each of the input channels, so that when the first sequence number generator detects that there is an input request that meets the preset valid request condition in at least one input channel in the next clock cycle, it generates the current sequence number and uses the current sequence number to mark the input request of the input channel.
[0122] In some specific embodiments, when the first serial number generator obtains the first serial number switching instruction, it generates a preset number of serial numbers with different numerical values in sequence according to the preset serial number sequence; wherein, the preset serial number sequence includes a first serial number sequence for generating serial numbers in a manner from small to large numerical values, a second serial number sequence for generating serial numbers in a manner from large to small numerical values, and a third serial number sequence for generating serial numbers according to an arrangement order of custom values.
[0123] In some specific embodiments, the apparatus further comprises:
[0124] a maximum number determining unit, configured to determine a maximum number of the input requests that the cache supports storing;
[0125] A setting unit is configured to set the preset number based on the maximum number; wherein the preset number is not less than the maximum number.
[0126] In some specific embodiments, the second serial number generator generates serial numbers in the same manner as the first serial number generator, and the second serial number generator and the first serial number generator use the same type of counter and the same initial value of the counter.
[0127] In some specific embodiments, after transmitting the arbitration request to the output channel for processing according to preset rules, the device is also used to send a second sequence number switching instruction to the second sequence number generator after checking that each of the arbitration requests has been processed, so that the second sequence number generator generates a next expected sequence number corresponding to the current expected sequence number according to the preset sequence number sequence, so as to use the next expected sequence number to verify the input request of the cache output.
[0128] In some specific embodiments, if there is an input request that meets the preset valid request condition in at least one input channel, the apparatus further includes:
[0129] a quantity counting unit, configured to count the total number of input requests that meet the preset valid request condition and store the total number in a target memory;
[0130] Correspondingly, the device is further configured to obtain the total number from the target memory; detect whether the number of arbitration requests that have been processed is the same as the total number; if they are the same, determine that all arbitration requests have been processed.
[0131] In some specific embodiments, each of the input channels is connected to a different buffer;
[0132] Correspondingly, the device is further configured to store each of the marked input requests into a cache connected to the corresponding output channel.
[0133] In some specific embodiments, the cache is a first-in-first-out memory, and the first-in-first-out memory is used to output each of the input requests after the mark written in the current clock cycle in the same clock cycle.
[0134] In some specific embodiments, the device is further used to perform an XOR operation on the data packet start marker and the preset flag bit; if the XOR operation result is a preset value, a first sequence number switching instruction is generated and the first sequence number switching instruction is sent to the first sequence number generator.
[0135] In some specific embodiments, the verification module further includes:
[0136] an expected sequence number obtaining unit, configured to obtain a current expected sequence number generated by the second sequence number generator;
[0137] a comparing unit, configured to compare the sequence number of each input request output by the cache with the current expected sequence number, so as to filter out input requests having a sequence number identical to the current expected sequence number;
[0138] The arbitration request generating unit is configured to generate an arbitration request for an input request having a sequence number identical to the current expected sequence number.
[0139] In some specific embodiments, the verification module may specifically include:
[0140] a single request processing unit, configured to directly transmit the arbitration request to the output channel for processing if the number of the arbitration request is one;
[0141] The multi-request processing unit is configured to, if there are multiple arbitration requests, transmit each arbitration request to the output channel for processing in sequence according to a preset multi-request processing rule.
[0142] In some specific embodiments, the multi-request processing unit is specifically used to determine the channel number of the input channel corresponding to each arbitration request; poll each arbitration request in ascending order of the channel number, so as to transmit each arbitration request to the output channel for processing.
[0143] In some specific embodiments, the multi-request processing unit is specifically used to determine the current value of the target register; the current value is determined based on the sum of the channel number of the input channel corresponding to the first arbitration request polled in the previous round and a preset channel number interval; starting from the current value, each arbitration request is polled in turn based on the channel number of the input channel corresponding to each arbitration request, so as to transmit each arbitration request to the output channel for processing.
[0144] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Specifically, the device may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the input request arbitration method performed by the electronic device disclosed in any of the aforementioned embodiments.
[0145] In this embodiment, the power supply 23 is used to provide operating voltage for various hardware devices on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices. The communication protocol it follows is any communication protocol that can be applied to the technical solution of the present invention and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0146] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0147] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.
[0148] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device, enabling the processor 21 to calculate and process the massive amount of data 223 in the memory 22. It can be Windows, Unix, Linux, etc. In addition to including computer programs capable of implementing the arbitration method for input requests performed by the electronic device disclosed in any of the aforementioned embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks. Data 223 may include data received by the electronic device from external devices as well as data collected by its own input / output interface 25.
[0149] Furthermore, an embodiment of the present invention also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the arbitration method steps of the input request disclosed in any of the aforementioned embodiments are implemented.
[0150] Furthermore, an embodiment of the present invention also discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the input request arbitration method disclosed in any of the aforementioned embodiments.
[0151] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0152] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the composition and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0153] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a compact disc read-only memory (CD-ROM), or any other form of storage medium known in the art.
[0154] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0155] The above describes in detail the arbitration method, apparatus, device, medium, and product for input requests provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only intended to help understand the method and core concept of the present invention. At the same time, for those skilled in the art, according to the concept of the present invention, there may be changes in the specific implementation methods and application scope. In summary, the contents of this specification should not be understood as limiting the present invention.
Claims
1. A method of arbitration of an input request, It is characterized in that Applied to an arbiter connected to any output channel, the arbiter being connected to at least two input channels, the method comprising: Detecting each of the input channels in the current clock cycle to determine whether there is an input request that meets a preset valid request condition in each of the input channels; If there is an input request satisfying the preset valid request condition in at least one input channel, marking the input request of the at least one input channel using the current sequence number generated by the first sequence number generator in the current clock cycle, and storing the marked input requests into a cache; The input request output by the cache is verified using the current expected sequence number generated by the second sequence number generator to generate an arbitration request for the input request that passes the verification, and the arbitration request is transmitted to the output channel for processing according to a preset rule.
2. The arbitration method of input request according to claim 1, It is characterized in that After the input request that satisfies the preset valid request condition exists in at least one input channel, the method further includes: A first sequence number switching instruction is sent to the first sequence number generator so that when the first sequence number generator detects in the next clock cycle that there is an input request that meets a preset valid request condition in at least one input channel, the first sequence number generator generates a next sequence number corresponding to the current sequence number in a preset sequence number order, so as to use the next sequence number to mark the input request of the input channel.
3. The arbitration method of input request according to claim 2, It is characterized in that After determining whether there is an input request satisfying a preset valid request condition in each of the input channels, the method further includes: If there is no input request that meets the preset valid request condition in each of the input channels, it is prohibited to send the first sequence number switching instruction to the first sequence number generator, so that when the first sequence number generator detects the existence of an input request that meets the preset valid request condition in at least one input channel in the next clock cycle, it generates the current sequence number and uses the current sequence number to mark the input request of the input channel.
4. The arbitration method of input request according to claim 2, It is characterized in that When the first serial number switching instruction is obtained, the first serial number generator generates a preset number of serial numbers with different numerical values in sequence according to the preset serial number sequence; wherein the preset serial number sequence includes a first serial number sequence for generating serial numbers in a manner of increasing numerical values, a second serial number sequence for generating serial numbers in a manner of increasing numerical values, and a third serial number sequence for generating serial numbers according to an arrangement order of custom values.
5. The arbitration method of input request according to claim 4, It is characterized in that Also includes: Determine the maximum number of the input requests that the cache supports storing; The preset number is set based on the maximum number; wherein the preset number is not less than the maximum number.
6. The arbitration method of input request according to claim 4, It is characterized in that The second serial number generator generates serial numbers in the same manner as the first serial number generator, and the second serial number generator and the first serial number generator use the same type of counter and the same initial value of the counter.
7. The arbitration method of input request according to claim 4, It is characterized in that After transmitting the arbitration request to the output channel for processing according to the preset rule, the method further includes: After checking that each of the arbitration requests has been processed, a second sequence number switching instruction is sent to the second sequence number generator so that the second sequence number generator generates a next expected sequence number corresponding to the current expected sequence number according to the preset sequence number sequence, so as to use the next expected sequence number to verify the input request of the cache output.
8. The arbitration method of input request according to claim 7, It is characterized in that After the input request that satisfies the preset valid request condition exists in at least one input channel, the method further includes: Counting the total number of input requests that meet the preset valid request condition, and storing the total number in the target memory; Accordingly, checking whether all the arbitration requests have been processed includes: Obtain the total quantity from the target storage; Detecting whether the number of arbitration requests that have been processed is the same as the total number; If they are the same, it is determined that all the arbitration requests have been processed.
9. The arbitration method of input request according to claim 2, It is characterized in that Each of the input channels is connected to a different buffer; Correspondingly, storing the marked input requests into a cache includes: Each of the marked input requests is stored in a cache connected to a corresponding output channel.
10. The arbitration method of input request according to claim 9, It is characterized in that The cache is a first-in-first-out memory, and the first-in-first-out memory is used to output each of the input requests after the mark written in the current clock cycle in the same clock cycle.
11. The arbitration method of input request according to claim 9, It is characterized in that The determining whether there is an input request satisfying a preset valid request condition in each of the input channels comprises: Detecting whether there is a data packet start mark corresponding to a valid input request in each of the input channels; If the data packet start mark exists, determining whether the target input request with the data packet start mark has completed data handshake with the corresponding cache according to the preset flag bit of the cache; If the data handshake is completed, the target input request is determined as an input request that meets the preset valid request condition.
12. The arbitration method of input request according to claim 11, It is characterized in that The sending a first sequence number switching instruction to the first sequence number generator includes: Performing an XOR operation on the data packet start mark and the preset flag bit; If the XOR operation result is a preset value, a first sequence number switching instruction is generated, and the first sequence number switching instruction is sent to the first sequence number generator.
13. The arbitration method of input request according to claim 1, It is characterized in that The step of verifying the input request output by the cache using the current expected sequence number generated by the second sequence number generator to generate an arbitration request for the input request that passes the verification includes: Obtain the current expected sequence number generated by the second sequence number generator; Compare the sequence number of each of the input requests output by the cache with the current expected sequence number to filter out the input requests whose sequence numbers are the same as the current expected sequence number; An arbitration request is generated for an input request having a sequence number that is the same as the current expected sequence number.
14. The arbitration method of input request according to any one of claims 1 to 13, It is characterized in that The step of transmitting the arbitration request to the output channel for processing according to a preset rule includes: If the number of the arbitration request is one, directly transmitting the arbitration request to the output channel for processing; If there are multiple arbitration requests, each arbitration request is transmitted to the output channel for processing in sequence according to a preset multiple request processing rule.
15. The arbitration method of input request according to claim 14, It is characterized in that The step of sequentially transmitting each arbitration request to the output channel for processing according to a preset multi-request processing rule includes: Determining the channel number of the input channel corresponding to each of the arbitration requests; The arbitration requests are polled in sequence according to the channel numbers from small to large, so as to transmit the arbitration requests to the output channel for processing.
16. The arbitration method of input request according to claim 14, It is characterized in that The step of sequentially transmitting each arbitration request to the output channel for processing according to a preset multi-request processing rule includes: Determine a current value of the target register; the current value is determined based on the sum of the channel number of the input channel corresponding to the first arbitration request polled in the previous round and the preset channel number interval; Starting from the current value, the arbitration requests are polled in sequence based on the channel number of the input channel corresponding to each arbitration request, so as to transmit each arbitration request to the output channel for processing.
17. An arbitration device for inputting a request, It is characterized in that An arbiter connected to any output channel, the arbiter connected to at least two input channels, the device comprising: A request detection module, used to detect each of the input channels in a current clock cycle to determine whether there is an input request that meets a preset valid request condition in each of the input channels; A sequence number marking module, configured to mark the input requests of the at least one input channel using the current sequence number generated by the first sequence number generator in the current clock cycle if there are input requests satisfying the preset valid request condition in the at least one input channel, and store the marked input requests into a cache; The verification module is used to verify the input request output by the cache using the current expected sequence number generated by the second sequence number generator, so as to generate an arbitration request for the input request that passes the verification, and transmit the arbitration request to the output channel for processing according to a preset rule.
18. An electronic device, It is characterized in that include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the arbitration method for input requests according to any one of claims 1 to 16.
19. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instruction is executed by a processor, the steps of the arbitration method of input request described in any one of claims 1 to 16 are implemented.
20. A non-volatile storage medium, It is characterized in that Used to store a computer program; wherein, when the computer program is executed by a processor, the steps of the arbitration method for input requests as claimed in any one of claims 1 to 16 are implemented.
