Multi-channel arbitration scheduling and credit calculation decoupling method and device
By decoupling the pre-switch of arbitration request based on the reserved maximum packet size of downstream credit space in data exchange, credit calculation and arbitration scheduling are solved, and the delay and overflow problems caused by credit calculation are improved, and data exchange is improved The efficiency and bandwidth are suitable for multi-channel cache sharing solutions.
Patent Information
- Application Number
- CN202411312891.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2024-12-13
AI Technical Summary
In data exchange, the coupling between credit calculation and arbitration scheduling results in logical path delay, reducing the chip's clock frequency and scheduling performance, and there are credit overflow problems, affecting bandwidth and efficiency.
In the non-shared and shared cache mode, the prejudgment of the arbitration request pre-switch is performed based on the reserved maximum packet size of the downstream credit space, and the decoupling of credit calculation and arbitration scheduling is achieved, thereby avoiding the delay in the control switch judgment caused by credit calculations. and space overflow and pause the arbitrator if necessary until the pipeline data is emptied.
The minimum packet full bandwidth is realized, which avoids the reduction of arbitration scheduling efficiency, ensures the independence of credit calculation and arbitration scheduling, improves clock frequency and arbitration efficiency, and is suitable for various cache sharing mechanisms and multi-channel arbitration scheduling strategies.
Smart Images

Figure CN119135768A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of network data exchange, and in particular relates to a method and device for decoupling multi-channel arbitration scheduling and credit calculation. Background Art
[0002] In data exchange such as IB / Ethemet / PCIe, there is an application demand to divide virtual channels for different business flows. The traffic between virtual channels is isolated through independent caches, which can effectively improve the independence of traffic and reduce traffic blocking and deadlock. However, the traffic of different businesses may be uneven, and the current application trend is to use a shared cache mechanism to implement multi-channel applications. Summary of the invention
[0003] The purpose of the present application is to provide a method and device for decoupling multi-channel arbitration scheduling and credit calculation, aiming to achieve decoupling between credit calculation and arbitration scheduling.
[0004] According to a first aspect of the present application, a method for decoupling multi-channel arbitration scheduling and credit calculation is provided, comprising:
[0005] In the non-shared cache mode, when there is a data packet to be sent in the virtual channel, the downstream credit value of the virtual channel in the current beat is determined, and if the credit value is greater than or equal to the sum of the data packet to be sent and the predefined maximum data packet size, the virtual channel is allowed to initiate arbitration scheduling;
[0006] In shared cache mode, when there are data packets to be sent on a virtual channel, the exclusive space credit value and the shared space credit value of the virtual channel in the downstream of the current beat are determined. If the sum of the exclusive space credit value and the shared space credit value is greater than or equal to the sum of the data packet to be sent and the predefined maximum data packet size, the virtual channel is allowed to initiate arbitration scheduling.
[0007] In an optional implementation manner, the step of determining that the virtual channel is after the downstream credit value of the current beat further includes:
[0008] If the credit value is smaller than the sum of the size of the data packet to be sent and the predefined maximum data packet size, the virtual channel is prohibited from initiating arbitration scheduling.
[0009] In an optional implementation manner, after determining the exclusive space credit value and the shared space credit value of the virtual channel downstream of the current beat, further includes:
[0010] If the sum of the exclusive space credit value and the shared space credit value is smaller than the sum of the size of the data packet to be sent and the predefined maximum data packet size, the virtual channel is prohibited from initiating arbitration scheduling.
[0011] In an optional implementation, the method is applied to an arbitrator pre-switch.
[0012] In an optional implementation, when all virtual channels are prohibited from initiating arbitration scheduling, the arbiter is suspended until the data on the pipeline is drained.
[0013] According to a second aspect of the present application, a multi-channel arbitration scheduling and credit calculation decoupling device is provided, comprising:
[0014] A first arbitration scheduling unit is used for, in a non-shared cache mode, when there is a data packet to be sent on a virtual channel, determining a downstream credit value of the virtual channel in a current beat, and allowing the virtual channel to initiate arbitration scheduling if the credit value is greater than or equal to the sum of the data packet to be sent and a predefined maximum data packet size;
[0015] The second arbitration scheduling unit is used to determine the downstream exclusive space credit value and the shared space credit value of the virtual channel in the current beat when there is a data packet to be sent in the virtual channel in the shared cache mode; if the sum of the exclusive space credit value and the shared space credit value is greater than or equal to the sum of the data packet to be sent and the predefined maximum data packet size, the virtual channel is allowed to initiate arbitration scheduling.
[0016] Compared with the related art, the technical solution of this application has the following advantages:
[0017] The arbitration request pre-switch is pre-determined by reserving the maximum data packet cache in the downstream credit space, and a compensation fallback mechanism is implemented to reserve space when no data packet is sent or no credit space allows data packet to be sent, thereby realizing the flow between credit calculation and arbitration scheduling, avoiding space overflow caused by control switch judgment delay caused by credit calculation flow during packet control, and not wasting downstream credit space. The scheme of the present application can ensure that the minimum packet is sent with full bandwidth, and will not reduce the efficiency of arbitration scheduling, realize the decoupling between credit calculation and arbitration scheduling, and is conducive to the deployment of various cache sharing mechanisms and multi-channel arbitration scheduling strategies, and can be widely used in multi-channel scheduling based on credit back pressure and multi-channel cache sharing schemes.
[0018] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained through the structures and processes indicated in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. It is obvious that the drawings described below are certain embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 It is a schematic diagram of the connection relationship between multiple virtual channels and an arbitrator according to the relevant technology of the present application.
[0021] Figure 2 This is a schematic diagram of the credit judgment hysteresis phenomenon caused by register delay according to the related technology of this application.
[0022] Figure 3 It is a schematic diagram of a delay pipeline stage according to the related technology of this application.
[0023] Figure 4 The figure is a flow chart of a method for decoupling multi-channel arbitration scheduling and credit calculation according to an exemplary embodiment of the present application.
[0024] Figure 5 Schematic diagram of upstream components and downstream components according to an exemplary embodiment of the present application.
[0025] Figure 6 It is a schematic diagram of virtual channel reserved space according to an exemplary embodiment of the present application.
[0026] Figure 7 is a schematic diagram of a shared cache reserved space according to an exemplary embodiment of the present application.
[0027] Figure 8 It is a schematic diagram of pipeline data draining according to an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0029] The virtual channel only implements the multi-buffer mechanism. There is still only one actual interface channel. Therefore, the traffic output between the channels needs to use an arbitrator to arbitrate the interface resources. Figure 1In addition, the virtual channel mechanism is usually based on credit back pressure. During arbitration, it is necessary to judge the credit of the downstream virtual channel. Arbitration can only be initiated if the credit is sufficient. That is, the independence of the channel is achieved in this way.
[0030] The cache sharing mechanism introduces complex downstream credit calculations, which together with the feedback of the arbitrator results form a feedback loop, leading to a significant increase in logic path delays, which in turn causes the chip to be unable to operate at a higher clock frequency, reducing scheduling performance.
[0031] Traditional designs use pipeline design to split the combinational logic, but the use of register delay will lead to a lag in credit judgment, which will lead to credit overflow problems during back-to-back transmission, such as Figure 2 As shown in FIG. 1 , the credit consumed at time t1 cannot be reflected at time t2, resulting in a credit overflow in the next beat at time t2. To address this problem, the solution in the related art is to suspend the arbiter for a corresponding number of beats according to the number of delay pipeline stages, such as Figure 3 As shown, however, its disadvantage is that the bandwidth will be reduced for single-beat data packets.
[0032] In summary, in credit calculation and multi-channel arbitration scheduling, the use of credit depends on the arbitration result of the previous arbitration, so when solving the timing problem, register pipeline processing cannot be simply performed. If arbitration is waited according to the pipeline situation, the performance will be reduced for smaller data packets.
[0033] Based on the above analysis, the present application exemplarily provides a method and device for decoupling multi-channel arbitration scheduling and credit calculation. On the basis of the pipeline processing of credit calculation and arbitration scheduling logic, without changing the arbitration strategy, the judgment algorithm of the front-end channel switch of the arbitration is improved, and the pre-judgment of the arbitrator front switch is completed based on the downstream credit space margin during credit judgment, thereby realizing the decoupling of the arbitration algorithm and credit calculation, so that they will not affect each other, thereby avoiding reducing the arbitration scheduling performance of smaller data packets, and improving the clock frequency at the same time.
[0034] See also Figure 4 Flow chart, illustratively, the multi-channel arbitration scheduling and credit calculation decoupling method provided by the present application includes:
[0035] Step 401: In non-shared cache mode, when there is a data packet to be sent in a virtual channel, determine the downstream credit value of the virtual channel in the current beat, and if the credit value is greater than or equal to the sum of the data packet to be sent and a predefined maximum data packet size, allow the virtual channel to initiate arbitration scheduling.
[0036] like Figure 5As shown, illustratively, the mechanism of the present application includes an upstream component and a downstream component. The downstream component performs credit maintenance and feedback, and performs cache management. The upstream component determines which path of data flow to send based on the credit feedback from the downstream and the data flow to be sent currently, combined with the arbitration strategy.
[0037] For example, when the arbitration strategy is more complex or the credit calculation is more complex, the arbitration transmission of the channel cannot be completed in one clock cycle, and pipeline processing is required on these complex logics. At the same time, according to the size of the data packet, the arbitrator pre-switch judgment logic makes a packet transmission judgment. The judgment of each beat reserves a maximum data packet based on the credit value at the beat moment, such as Figure 6 As shown in the figure. Assuming that the size of the data packet to be sent by the head of a virtual channel queue is len_pkt, and the maximum data packet length is len_max, the remaining space of the channel is calculated as credit; in the case of a first-level pipeline storage, if the following formula ① is satisfied, the channel is allowed to participate in arbitration at the switch module. Among them, credit is a real-time value calculated at each beat.
[0038] credit>=len _ pkt+len _ max ①
[0039] Accordingly, the method further includes prohibiting the virtual channel from initiating arbitration scheduling if the credit value is smaller than the sum of the size of the data packet to be sent and a predefined maximum data packet size.
[0040] Step 402: In the shared cache mode, when there are data packets to be sent on the virtual channel, the exclusive space credit value and the shared space credit value of the downstream of the virtual channel in the current beat are determined. If the sum of the exclusive space credit value and the shared space credit value is greater than or equal to the sum of the data packet to be sent and the predefined maximum data packet size, the virtual channel is allowed to initiate arbitration scheduling.
[0041] Many designs use shared cache solutions. When using the shared cache mechanism, most of the time you only need to create a margin for the shared space, such as Figure 7 As shown. For example, assuming that the maximum packet length is len _ max, the exclusive credit space of virtual channel 1 is credit _ dedicatel, the length of the queue head packet of virtual channel 1 is len _ pkt1, the exclusive credit space of virtual channel 2 is credit _ dedicate2, the length of the queue head packet of virtual channel 2 is len _ pkt2, shared credit space is credit _If virtual channel 1 and virtual channel 2 satisfy formulas ② and ③ respectively, arbitration scheduling can be initiated:
[0042] credit _ dedicate 1+credit_share>=len_pkt 1+len_max; ②
[0043] credit _ dedicate2+credit_share>=len_pkt2+len_max; ③
[0044] Accordingly, after determining the downstream exclusive space credit value and shared space credit value of the virtual channel in the current beat, if the sum of the exclusive space credit value and the shared space credit value is less than the sum of the data packet to be sent and the predefined maximum data packet size, the virtual channel is prohibited from initiating arbitration scheduling.
[0045] In the above judgment, both virtual channels use shared credits. Since the arbitration result is that only one channel will be hit at the same time, there will be no situation where different channels occupy the shared space together, such as Figure 7 As shown, as long as the shared space is not exhausted, only one maximum data packet needs to be reserved in the shared space.
[0046] Through the above method, the number of pipeline stages is increased and relying on the credit margin, the isolation of credit calculation and channel arbitration scheduling is achieved, thereby improving the arbitration efficiency.
[0047] In a further embodiment, when all virtual channels are prohibited from initiating arbitration scheduling, the arbiter is paused until the data in the pipeline is drained.
[0048] For example, when there is less space left, all paths cannot send data, and the arbitrator will pause for one beat, at which time the data on the pipeline will be drained, and the reserved space will be reused in the next beat and provided to the arbitrator front switch.
[0049] like Figure 8 As shown, illustratively, data cannot be sent at time t1, the pipeline is drained in the next beat, and the reserved space is fully utilized, ensuring that there is no waste of credit space.
[0050] It can be seen that the multi-channel arbitration scheduling and credit calculation decoupling method provided by the present application has the following advantages compared with the related technologies:
[0051] The arbitration request pre-switch is pre-determined by reserving the maximum data packet cache in the downstream credit space, and a compensation fallback mechanism is implemented to reserve space when no data packet is sent or no credit space allows data packet to be sent, thereby realizing the flow between credit calculation and arbitration scheduling, avoiding space overflow caused by control switch judgment delay caused by credit calculation flow during packet control, and not wasting downstream credit space. The scheme of the present application can ensure that the minimum packet is sent with full bandwidth, and will not reduce the efficiency of arbitration scheduling, realize the decoupling between credit calculation and arbitration scheduling, and is conducive to the deployment of various cache sharing mechanisms and multi-channel arbitration scheduling strategies, and can be widely used in multi-channel scheduling based on credit back pressure and multi-channel cache sharing schemes.
[0052] Accordingly, illustratively, the present application provides a multi-channel arbitration scheduling and credit calculation decoupling device in a second aspect, comprising:
[0053] A first arbitration scheduling unit is used for, in a non-shared cache mode, when there is a data packet to be sent on a virtual channel, determining a downstream credit value of the virtual channel in a current beat, and allowing the virtual channel to initiate arbitration scheduling if the credit value is greater than or equal to the sum of the data packet to be sent and a predefined maximum data packet size;
[0054] The second arbitration scheduling unit is used to determine the downstream exclusive space credit value and the shared space credit value of the virtual channel in the current beat when there is a data packet to be sent in the virtual channel in the shared cache mode; if the sum of the exclusive space credit value and the shared space credit value is greater than or equal to the sum of the data packet to be sent and the predefined maximum data packet size, the virtual channel is allowed to initiate arbitration scheduling.
[0055] In an optional implementation manner, the first arbitration scheduling unit is further configured to:
[0056] If the credit value is smaller than the sum of the size of the data packet to be sent and the predefined maximum data packet size, the virtual channel is prohibited from initiating arbitration scheduling.
[0057] In an optional implementation manner, the second arbitration scheduling unit is further configured to:
[0058] If the sum of the exclusive space credit value and the shared space credit value is smaller than the sum of the size of the data packet to be sent and the predefined maximum data packet size, the virtual channel is prohibited from initiating arbitration scheduling.
[0059] In an optional implementation, the device is applied to an arbitrator pre-switch.
[0060] In an optional implementation manner, the first arbitration scheduling unit and the second arbitration scheduling unit are further configured to:
[0061] When all virtual channels are prohibited from initiating arbitration scheduling, the arbiter is paused until the data on the pipeline is drained.
[0062] The above-mentioned device can be implemented by the multi-channel arbitration scheduling and credit calculation decoupling method provided by the embodiment of the first aspect above. The specific implementation method can be found in the description of the embodiment of the first aspect, which will not be repeated here.
[0063] It is understood that the structures, names and parameters described in the above embodiments are only examples. Those skilled in the art can also easily think of combinations and adjustments to the structural features of the above embodiments according to the use requirements, and should not limit the concept of the present application to the specific details of the above examples.
[0064] Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that he or she may still modify the technical solutions described in the aforementioned embodiments, or make equivalent substitutions for some of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for decoupling multi-channel arbitration scheduling and credit calculation, It is characterized in that include: In the non-shared cache mode, when there is a data packet to be sent in the virtual channel, the downstream credit value of the virtual channel in the current beat is determined, and if the credit value is greater than or equal to the sum of the data packet to be sent and the predefined maximum data packet size, the virtual channel is allowed to initiate arbitration scheduling; In shared cache mode, when there are data packets to be sent on a virtual channel, the exclusive credit value, exclusive space credit value and shared space credit value of the virtual channel in the downstream of the current beat are determined. If the sum of the exclusive space credit value and the shared space credit value is greater than or equal to the sum of the data packet to be sent and the predefined maximum data packet size, the virtual channel is allowed to initiate arbitration scheduling.
2. The method for decoupling multi-channel arbitration scheduling and credit calculation according to claim 1, It is characterized in that The step of determining that the virtual channel is after the downstream credit value of the current beat further includes: If the credit value is smaller than the sum of the size of the data packet to be sent and the predefined maximum data packet size, the virtual channel is prohibited from initiating arbitration scheduling.
3. The method for decoupling multi-channel arbitration scheduling and credit calculation according to claim 1, It is characterized in that After determining the exclusive space credit value and the shared space credit value of the virtual channel downstream of the current beat, the method further includes: If the sum of the exclusive space credit value and the shared space credit value is smaller than the sum of the size of the data packet to be sent and the predefined maximum data packet size, the virtual channel is prohibited from initiating arbitration scheduling.
4. The method for decoupling multi-channel arbitration scheduling and credit calculation according to claim 1, It is characterized in that The method is applied to an arbitrator pre-switch.
5. The method for decoupling multi-channel arbitration scheduling and credit calculation according to claim 1, It is characterized in that Further including: When all virtual channels are prohibited from initiating arbitration scheduling, the arbiter is paused until the data on the pipeline is drained.
6. A multi-channel arbitration scheduling and credit calculation decoupling device, It is characterized in that include: A first arbitration scheduling unit is used for, in a non-shared cache mode, when there is a data packet to be sent on a virtual channel, determining a downstream credit value of the virtual channel in a current beat, and allowing the virtual channel to initiate arbitration scheduling if the credit value is greater than or equal to the sum of the data packet to be sent and a predefined maximum data packet size; The second arbitration scheduling unit is used to determine the downstream exclusive space credit value and the shared space credit value of the virtual channel in the current beat when there is a data packet to be sent in the virtual channel in the shared cache mode; if the sum of the exclusive space credit value and the shared space credit value is greater than or equal to the sum of the data packet to be sent and the predefined maximum data packet size, the virtual channel is allowed to initiate arbitration scheduling.
7. The multi-channel arbitration scheduling and credit calculation decoupling device according to claim 6, It is characterized in that The first arbitration scheduling unit is further configured to: If the credit value is smaller than the sum of the size of the data packet to be sent and the predefined maximum data packet size, the virtual channel is prohibited from initiating arbitration scheduling.
8. The multi-channel arbitration scheduling and credit calculation decoupling device according to claim 6, It is characterized in that The second arbitration scheduling unit is further used to: If the sum of the exclusive space credit value and the shared space credit value is smaller than the sum of the size of the data packet to be sent and the predefined maximum data packet size, the virtual channel is prohibited from initiating arbitration scheduling.
9. The multi-channel arbitration scheduling and credit calculation decoupling device according to claim 6, It is characterized in that The device is applied to a pre-switch of an arbitrator.
10. The multi-channel arbitration scheduling and credit calculation decoupling device according to claim 6, It is characterized in that The first arbitration scheduling unit and the second arbitration scheduling unit are further configured to: When all virtual channels are prohibited from initiating arbitration scheduling, the arbiter is paused until the data on the pipeline is drained.
Citation Information
Patent Citations
Credit based flow control system, apparatus and method
CN101115008A
Data transmission method and data transmission system
CN117793009A
Shared cache release method and device based on credit back pressure
CN118101597A
Cited By
Bus link layer, on-chip bus and chip
CN121029677A
Data processing method and device, computer equipment, storage medium and program product
CN121187991A
