Implementation method for PCIe Switch WRR arbitration

By adopting the dynamic masking method in PCIe switch and strictly implementing the WRR phase table weighting processing in the PCIe protocol specification, the problems of poor compatibility and insufficient information in the PCIe switch WRR arbitration in the prior art are solved, and high-performance and low-latency WRR arbitration are achieved.

CN119865392APending Publication Date: 2025-04-22WUXI CORE FIELD MICROELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510076487.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The existing PCIe switch WRR arbitration implementation method has poor compatibility, limited application scenarios, and insufficient information, so it is impossible to effectively implement the weighted processing of the WRR phase table method specified in the PCIe protocol specification.

Method used

The dynamic mask method is used to perform fast polling arbitration on the phase arbitration request sequence, and the weighting processing in the PCIe protocol specification is strictly implemented through the WRR phase table to ensure the retention and application of all weighted information.

Benefits of technology

It realizes WRR arbitration with small logical delay, good timing characteristics, high processing performance and low resource utilization. It can effectively adapt to different application needs in PCIe switch and is compatible with PCIe protocol specifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119865392A_ABST
    Figure CN119865392A_ABST
Patent Text Reader

Abstract

The invention discloses a PCIe Switch WRR arbitration realization method, and relates to the technical field of computers, and the realization method comprises the following steps: S100, generating a source end arbitration request signal according to a TLP indication signal of each request source; s200, according to the WRR phase table, decoding the arbitration request of the numbering request source corresponding to each phase value into a phase arbitration request; s300, performing fast polling arbitration on the phase arbitration request sequence by adopting a dynamic mask mode; and S400, restoring the serial number of the original request source corresponding to the phase arbitration request according to the authorized phase arbitration request position, and outputting the TLP message of the request source through a destination port according to the serial number of the original request source. The authorization phase in the phase arbitration request sequence is inquired in a dynamic mask mode, the result can be obtained in one period, logic is simple, and time delay is small. In the aspect of performance, compared with a conventional mode of querying one request in one period, the performance is greatly improved; and in the aspect of resource occupation, a large amount of resources are saved compared with a conventional mode of realizing one-by-one jumping of multiple request sources through a state machine. Therefore, polling arbitration is carried out in a dynamic mask mode, and the method has the advantages of being small in logic delay, good in time sequence characteristic, high in processing performance, few in occupied resources and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and system for implementing PCIe Switch WRR arbitration. Background Art

[0002] PCIe switch is widely used because it can expand the connectivity of the system, such as data centers and servers that have high bandwidth and performance requirements. As one of the PCIe devices, PCIe switch follows the PCIe protocol specification and supports QoS (Quality of Service). Priority arbitration is an important basis for the PCIe system to support QoS (Quality of Service). Two aspects of priority arbitration are performed at the output port of the PCIe switch: port arbitration and virtual channel VC (Virtual Channel) arbitration.

[0003] According to the PCIe protocol specification, both port arbitration and VC arbitration support round-robin arbitration RR (Round Robin) and weighted round-robin arbitration WRR (Weighted Round-Robin). For port WRR arbitration, each phase corresponds to a port number; for VC WRR arbitration, each phase corresponds to a VC number. If a phase value does not have a valid port number or VC number corresponding to it, then the phase is an invalid phase. For a valid phase, when it rotates to this phase, the request of the corresponding port or the request of the corresponding VC will be authorized. WRR arbitration is widely used in PCIe switches because it can flexibly adjust weights according to different needs.

[0004] At present, PCIe switch WRR arbitration generally counts the number of times each request source is allowed to perform weighted processing. However, this weighted implementation method not only has relatively poor compatibility and relatively limited application scenarios, but also covers much less information than the weighted information carried by the WRR phase table method specified in the PCIe protocol specification. Summary of the invention

[0005] The present invention aims at solving one or more of the above existing problems and proposes a method for implementing PCIe Switch WRR arbitration.

[0006] According to a first aspect of the present application, a method for implementing PCIe Switch WRR arbitration is proposed, and the method comprises the following steps: S100. Generates a source arbitration request signal according to the TLP indication signal of each request source; S200. According to the WRR phase table, each phase value corresponding to the number of the request source arbitration request is decoded into a phase arbitration request; S300. Perform fast polling arbitration on the phase arbitration request sequence using a dynamic mask method; S400. Restore the number of the original request source corresponding to the phase arbitration request according to the authorized phase arbitration request position, and output the TLP message of the request source through the destination port according to the number of the original request source.

[0007] As an achievable preferred method, step S100. generates a source arbitration request signal according to the TLP indication signal of each request source, specifically including the following contents: TLP messages are divided into multi-beat TLP messages and single-beat TLP messages according to the number of valid beats, and the TLP indication signal includes a header valid signal srcN_tlp_hv, a data valid signal srcN_tlp_dv and an end indication signal srcN_tlp_eot. For multi-beat TLP messages, the generated arbitration request signal srcN_tlp_req must start from the effective start of the header valid signal srcN_tlp_hv and continue until the effective end of the end indication signal srcN_tlp_eot to maintain a high level; for a single-beat TLP message, the generated arbitration request signal srcN_tlp_req is consistent with the header valid signal srcN_tlp_hv.

[0008] As a preferred implementation method, step S200. According to the WRR phase table, the arbitration request of each phase value corresponding number request source is decoded into a phase arbitration request, including the following contents: Correspond each phase value in the phase table to the corresponding request source number; Assigning the request source arbitration request to the corresponding phase arbitration request; Determine whether the request source arbitration request is valid. If it is valid, the corresponding phase arbitration request is valid. If it is invalid, the corresponding phase arbitration request is 0, and the phase arbitration request is invalid. It is determined whether the request source number corresponding to the phase value is valid. If it is valid, the corresponding phase arbitration request is valid. If it is invalid, the phase arbitration request is assigned a value of 0, indicating that the phase arbitration request is invalid.

[0009] As an achievable preferred method, step S300. using a dynamic mask method to perform fast polling arbitration on the phase arbitration request sequence includes the following steps: S301. Separate the phase arbitration request sequence into a request sequence to be queried and a request sequence that has been queried; S302. Find the first valid request for the query request sequence and the queried request sequence according to the defined order respectively; S303. If a valid request is found in the request sequence to be queried, the request is an authorization request; if no valid request is found in the request sequence to be queried, the valid request found in the request sequence that has been queried is taken as the authorization request; S304. Determine the location of the authorization request found, and update the sequence mask of the request to be queried and the sequence mask of the request to be queried according to the location; S305. Repeat steps S302-304 until all valid requests in the phase arbitration request sequence are authorized.

[0010] As an achievable preferred manner, S303 further includes: if there are no valid requests in the request sequence to be queried and the request queue that has been queried, the mask of the request sequence to be queried and the mask of the request sequence that has been queried remain unchanged.

[0011] As a preferred method that can be implemented, S400. restore the number of the original request source corresponding to the phase arbitration request according to the authorized phase arbitration request position, and output the TLP message of the request source through the destination port according to the number of the original request source; specifically including: Obtain the number of the corresponding request source according to the authorized phase arbitration request, Query the phase value corresponding to the request source number according to the phase table; The request source with the corresponding number of the phase request is obtained according to the phase value, and the TLP message of the request source with the corresponding number is sent to the output port of the WRR arbitration module.

[0012] Compared with the prior art, the present invention has the following beneficial effects: 1. This application uses a dynamic mask method to query the authorized phase in the phase arbitration request sequence, and the result can be obtained within one cycle, with simple logic and low delay. In terms of performance, it is greatly improved compared to the conventional method of querying one request in one cycle; in terms of occupied resources, it saves a lot of resources compared to the conventional method of implementing multiple request sources one by one through a state machine. Therefore, this application uses a dynamic mask method for polling arbitration, which has the advantages of small logical delay, good timing characteristics, high processing performance, and less resource occupation.

[0013] 2. The WRR arbitration method adopted in this application strictly implements the weighting by loading the WRR phase table specified in the PCIe protocol specification. This implementation method retains all the information carried by the WRR phase table in the PCIe protocol specification. By changing the configuration of the WRR phase table, for a certain source request, both centralized authorization and decentralized authorization can be achieved to meet different application requirements.

[0014] 3. The WRR arbitration method implemented in this application has good adaptability and can be used for both VC WRR arbitration of PCIe switch and port WRR arbitration. At the same time, its dynamic mask design concept can also be directly applied to RR arbitration. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 is a schematic diagram of upstream and downstream modules associated with the WRR arbitration module; Figure 2 It is a schematic diagram of the structure of the PCIe VC capability register group; Figure 3 Arbitration request signals corresponding to multi-beat TLP messages and single-beat TLP messages; Figure 4 A flowchart of a method for implementing PCIe Switch WRR arbitration; Figure 5 It is a flowchart of step S300 in a method for implementing PCIe Switch WRR arbitration; The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 creative work are within the scope of protection of the present invention.

[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items. In the absence of conflict, the following embodiments and the features in the embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0018] Before describing the implementation method of PCIe switch WRR arbitration in detail, the upstream and downstream modules associated with the WRR arbitration module are first described. Figure 1 shown. Figure 1 The source end message processing, i.e. source end message processing module, target end output, i.e. target end output module, and words such as src, have different references in different WRR arbitrations. In port WRR arbitration, it refers to each source port message processing module, target port output module, src0, src1...srcN, etc., which refer to each source port number; in VC WRR arbitration, it refers to each source VC message processing module, target VC output module, src0, src1...srcN, etc., which refer to each source VC number.

[0019] The egress port refers to the sending port, that is, the port used by data to leave the Switch; the ingress port refers to the receiving port, that is, the port used by data to enter the Switch.

[0020] For port WRR arbitration, Figure 1 The source-side message processing module is located at the ingress end of the PCIe port. The ingress end of each source port selects the route of the received TLP (Transaction Layer Packet) message based on the type information carried in the header and the configuration information of each switch port to determine the final destination port. Before sending to the target port, it is first cached with FIFO, because the sending resources of the same target port may be shared by multiple source ports. Before each source port obtains authorization, the TLP message is temporarily stored in the FIFO and waits. When the source-side TLP message obtains WRR arbitration authorization, it is pushed from the source end to the target-side output module. The WRR arbitration module and the target-side output module are both located at the egress end of the target port.

[0021] For VC WRR arbitration, Figure 1 The location of the source-side message processing module is different from that of the port WRR arbitration. It is located at the egress end of the target port together with the WRR arbitration module and the target-side output module. VC WRR arbitration is located after the port arbitration. Therefore, in VC WRR arbitration, the source-side message processing module can be understood as the port arbitration module of each VC. Of course, the port arbitration module of each VC is not necessarily the port WRR arbitration module. According to the configuration of the PCIe switch system, the port arbitration can be RR arbitration or WRR arbitration, or some ports use RR arbitration and other ports use WRR arbitration. Like the port WRR arbitration, the source-side message processing module generally integrates a FIFO cache, which plays a role in logical isolation and optimizes timing on the one hand, and also serves as a buffer waiting area before the message is sent on the other hand.

[0022] Figure 1 The WRR phase table loading module is the WRR phase table loading module. Figure 2The figure shows a schematic diagram of the PCIe VC capability register structure. The WRR phase table loading module is used to transmit the register data corresponding to the VC arbitration table or the port arbitration table in the PCIe VC capability register group to the final application module, namely the WRR arbitration module.

[0023] After describing the peripheral structure of the WRR arbitration module, the present application describes in detail the implementation method of the PCIe switch WRR arbitration, such as Figure 4 As shown, the implementation method includes the following steps: S100. Generates a source arbitration request signal according to the TLP indication signal of each request source; As shown in Table 1, interface signals between a request source numbered N (N is an integer between 0 and the maximum request source number) and the WRR arbitration module are listed.

[0024] Table 1

[0025] The TLP indication signals in this application refer to srcN_tlp_hv, srcN_tlp_dv and srcN_tlp_eot.

[0026] TLP messages can be divided into multi-beat TLP messages and single-beat TLP messages based on the number of effective beats.

[0027] A characteristic of multi-beat TLP messages is that the srcN_tlp_hv signal and the srcN_tlp_eot signal are not valid in the same clock cycle, and the srcN_tlp_dv signal is also valid during the period when srcN_tlp_hv and srcN_tlp_eot are valid. Figure 3 As shown in req1 in the figure, the generated arbitration request signal srcN_tlp_req should maintain a high level from the effective start of srcN_tlp_hv until the effective end of srcN_tlp_eot. If a low level appears in the middle, the request will be misjudged as multiple requests, and multiple independent authorizations will be performed.

[0028] For a single-beat TLP message, the srcN_tlp_hv signal and the srcN_tlp_eot signal are valid in the same beat, and the srcN_tlp_dv signal may be valid or invalid depending on the type of TLP. Figure 3 As shown in req2 and req3, the generated arbitration request signal srcN_tlp_req is consistent with srcN_tlp_hv.

[0029] S200. According to the WRR phase table, each phase value corresponding to the number of the request source arbitration request is decoded into a phase arbitration request; specifically comprising the following steps: Correspond each phase value in the phase table to the corresponding request source number; Assigning the request source arbitration request to the corresponding phase arbitration request; Determine whether the request source arbitration request is valid. If it is valid, the corresponding phase arbitration request is valid. If it is invalid, the corresponding phase arbitration request is 0, and this phase arbitration request is invalid. It is determined whether the request source number corresponding to the phase value is valid. If it is valid, the corresponding phase arbitration request is valid. If it is invalid, the phase arbitration request is assigned a value of 0, indicating that this phase arbitration request is invalid.

[0030] It should be noted that in the PCIe specification, port WRR arbitration has 32-phase, 64-phase, 128-phase and 256-phase types, and VC WRR arbitration has 32-phase, 64-phase and 128-phase types. PCIe switch WRR arbitration can flexibly select the number of WRR phases based on considerations such as the number of ports, the number of VCs, and weight configuration.

[0031] The number of phase WRRs selected will ultimately generate the number of phase arbitration requests. The number of phase arbitration requests is independent of the number of request sources, but the phase arbitration request originates from the arbitration request of the request source. So how is the correspondence between the phase arbitration request and the request source arbitration request established and mapped? Specifically, according to the request source number corresponding to each phase value in the phase table, the request source arbitration request is assigned to the corresponding phase arbitration request. If the request source arbitration request is valid, the corresponding phase arbitration request is valid, otherwise the corresponding phase arbitration request is 0. If the request source number corresponding to the phase value is invalid, the phase arbitration request is assigned a value of 0, indicating that this phase arbitration request is invalid.

[0032] Here, this application takes 32 phases and 8 request sources as an example for illustration.

[0033] Table 2 is an example of the arrangement of a 32-phase table. In Table 2, the phase value refers to the request source number, 0-7 refers to src0-src7 respectively, and the value exceeding 7 is an invalid request source.

[0034] Table 2

[0035] Table 3 shows examples of valid statuses of current requests from eight request sources. A valid status of 1 indicates that the request source currently has a valid request; a valid status of 0 indicates that the request source currently has no valid request.

[0036] Table 3

[0037] It should be noted that based on the phase table arrangement of Table 2 and Figure 3 The valid state of the request source can be decoded according to the above method to obtain the arbitration request of each phase. The phase value of Phase0 is 0, which corresponds to the arbitration request of src0. The arbitration request state of src0 is 0, so phase0_req is 0; the phase value of Phase1 is 1, which corresponds to the arbitration request of src1. The arbitration request state of src1 is 1, so phase1_req is 1; thus, the states of arbitration requests of all phases can be deduced as follows: {phase31_req,phase30_req,...,phase0_req}=32'b0000_1010_0101_1010_0101_1010_0101_1010; The WRR arbitration method adopted in this application strictly implements the weighting by loading the WRR phase table as specified in the PCIe protocol specification. This implementation method retains all the information carried by the WRR phase table in the PCIe protocol specification. By changing the configuration of the WRR phase table, for a certain source request, both centralized authorization and decentralized authorization can be achieved to meet different application requirements. This implementation method is backward compatible with the weighted polling arbitration method by setting the number of authorizations for each request source.

[0038] S300. Use a dynamic mask method to perform fast polling arbitration on the phase arbitration request sequence; it should be explained that after converting the arbitration request of the request source end into a phase arbitration request in the previous step, the weighted polling arbitration is converted into an ordinary polling arbitration, and the next step is to perform polling arbitration on the phase request sequence. The present application uses a dynamic mask method to quickly query and authorize the current highest priority valid request within one cycle. The current highest priority here means that the request source that is ahead of the request source has been queried, and the current request source is the first valid request source polled.

[0039] This step combines the phase arbitration request sequence to explain the principle of polling arbitration in this application. When the phase request sequence is authorized, it is advanced in a certain order. Here, it is defined according to general convention: high bits are on the left and low bits are on the right, such as the signal phase_req[31:0]. Authorization query can be in the order from low bits to high bits and from right to left, or from high bits to low bits and from left to right. The efficiency of both is equal and there is no distinction between high and low. For the convenience of expression, this application uses the order from low bits to high bits and from right to left. At the beginning of polling, start with the first request of the lowest bit. If the current request is invalid, advance to the next bit to continue querying; if the current request is valid, authorize the request source corresponding to the request. When the authorization request is processed and the next query is started, it will continue to advance to the high bits that have not been queried, but at this time, the low bits that have been queried may have new requests. At this time, the low-bit requests will not be processed. After one round is over, the low-bit requests will be looped back and queried again for authorization.

[0040] Therefore, this step specifically includes: S301. Separate the phase arbitration request sequence into a request sequence to be queried and a request sequence that has been queried; Specifically, the request sequence to be queried and the request sequence that has been queried correspond to a mask respectively. The polling of this application adopts a right-to-left order. The request sequence to be queried is defined as left_req[phaseNum-1:0], and the corresponding mask is defined as left_mask[phaseNum-1:0]; the request sequence that has been queried is defined as right_req[phaseNum-1:0], and the corresponding mask is defined as right_mask[phaseNum-1:0]; the entire phase arbitration request sequence is defined as phase_req[phaseNum-1:0]. (Where phaseNum refers to the phase number of WRR, that is, the number of phase arbitration requests; the subsequent expression no longer carries a bit vector, and is directly abbreviated as left_req / left_mask / right_req / right_mask / phase_req).

[0041] Among them, the mask left_mask of the request sequence to be queried is ANDed with the entire phase arbitration request sequence phase_req, and the result is the request sequence to be queried left_req. The mask right_mask of the queried request sequence is the bitwise inversion of the mask left_mask of the request sequence to be queried. The mask left_mask of the queried request sequence is ANDed with the entire phase arbitration request sequence phase_req, and the result is the queried request sequence right_req. That is: left_req = phase_req & left_mask; right_mask = ~left_mask; right_req = phase_req & right_mask; At the beginning of a query round, no phase arbitration request has been authorized, and the mask corresponding to the sequence to be queried is all 1, that is, left_mask={phaseNum{1'b1}}, and the request sequence to be queried is the entire phase request sequence, that is, left_req=phase_req. At this time, the mask right_mask of the queried sequence is all 0, and the queried sequence right_req is all 0.

[0042] S302. Find the first valid request for the query request sequence and the queried request sequence respectively according to the defined order; S303. If a valid request is found in the request sequence to be queried, the request is an authorization request; if no valid request is found in the request sequence to be queried, the valid request found in the request sequence that has been queried is taken as the authorization request; Therefore, the first valid request is searched from right to left for the query request sequence left_req and the queried request sequence right_req. If a valid request is found in the query request sequence left_req, this request becomes an authorization request; otherwise, the valid request found in the queried request sequence right_req is taken as the authorization request.

[0043] S304. Determine the location of the authorization request found, and update the to-be-queried request sequence mask left_mask and the queried request sequence mask right_mask according to the location; Define the position of the authorization request as grantNum (the possible value range of grantNum is an integer between 0 and phaseNum-1). For the request sequence mask left_mask to be queried, the authorization position grantNum bit and the bits below are all set to 0, and the authorization position grantNum bit and the bits above are all set to 1; for the queried request sequence mask right_mask, it is the opposite of the request sequence mask left_mask to be queried. The formula is as follows: left_mask= {{(phaseNum-grantNum-1){1'b1}},{(grantNum+1){1'b0}}}; right_mask= {{(phaseNum-grantNum-1){1'b0}},{(grantNum+1){1'b1}}}; S305. Repeat steps S302-304 until all valid requests in the phase arbitration request sequence are authorized. In addition, if there are no valid requests in the request sequence to be queried and the request queue to be queried, the request sequence mask to be queried and the request sequence mask to be queried remain unchanged.

[0044] For example: This application uses a 4-phase request to illustrate the above process. The minimum number of WRR phases specified in the PCIe protocol specification is 32, but the simplified 4-phase request example does not affect the display of the above design concept.

[0045] Example: Initial phase arbitration request: phase_req = 4'b0110 Request sequence mask to be queried: left_mask = 4'b1111 Request sequence to be queried: left_req = 4'b0110 Query request sequence mask: right_mask = 4'b0000 Query request sequence: right_req = 4'b0000 Result of the first query: There are valid requests in the request sequence left_req to be queried. The first valid request is left_req[1], and the corresponding phase arbitration request is phase_req[1]. At this time, phase_req[1] is authorized. After the phase_req[1] request is authorized and processed, the next query is started.

[0046] If phase_req[0] receives a new request at this time, then: Phase arbitration request: phase_req = 4'b0101 Request sequence mask to be queried: left_mask = 4'b1100 Request sequence to be queried: left_req = 4'b0100 Query request sequence mask: right_mask = 4'b0011 Query request sequence: right_req = 4'b0001 The result of the second query is: there are valid requests in the request sequence left_req to be queried. The first valid request is left_req[2], and the corresponding phase arbitration request is phase_req[2]. At this time, although there is a valid request right_req[0] in the request queue right_req, phase_req[2] is still authorized. After the phase_req[2] request is authorized and processed, the next query is started.

[0047] At this time, if phase_req[2] receives a new request, then: Phase request phase_req = 4'b0101 Request sequence mask to be queried: left_mask = 4'b1000 Request sequence to be queried: left_req = 4'b0000 Query request sequence mask: right_mask = 4'b0111 Query request sequence: right_req = 4'b0101 The result of the third query: there is no valid request in the request sequence left_req to be queried, and the first valid request in the request queue right_req that has been queried is right_req[0]. The corresponding phase arbitration request is phase_req[0], so phase_req[0] is authorized.

[0048] Then update the request sequence mask left_mask and the queried request sequence mask right_mask according to the above method, and continue the next query. If there are no valid requests in the request sequence left_req and the queried request sequence right_req, the request sequence mask left_mask and the queried request sequence mask right_mask remain unchanged.

[0049] S400. Restore the number of the original request source corresponding to the phase arbitration request according to the authorized phase arbitration request position, and output the TLP message of the request source through the destination port according to the number of the original request source.

[0050] S400. Restore the original request source number corresponding to the phase arbitration request according to the authorized phase arbitration request position, and output the TLP message of the request source through the destination port according to the original request source number; specifically including: Obtain the number of the corresponding request source according to the authorized phase arbitration request, Query the phase value corresponding to the request source number according to the phase table; The request source with the corresponding number of the phase request is obtained according to the phase value, and the TLP message of the request source with the corresponding number is sent to the output port of the WRR arbitration module.

[0051] An example is given according to Table 2. Assuming that the phase arbitration request numbered phase11 is authorized, according to the phase table in Table 2, it can be found that the phase value corresponding to phase11 is 3, that is, the phase request corresponds to the request source numbered 3, and then the TLP message of the request source numbered 3 is sent to the output port of the WRR arbitration module.

[0052] As shown in Table 4, Figure 1 The interface signal between the WRR arbitration module and the target output module.

[0053] Table 4

[0054] The TLP message of the request source numbered 3 is sent to the output port of the WRR arbitration module. The specific operation is to assign src3_tlp_hv to dst_tlp_hv, src3_tlp_dv to dst_tlp_dv, src3_tlp_eot to dst_tlp_eot, src3_tlp_header to dst_tlp_header, and src3_tlp_data to dst_tlp_data through the selector.

[0055] A necessary condition for the source arbitration request to be authorized to be output is that dst_halt is 0, that is, the output end is not blocked. When a source request is authorized, the srcN_halt signal output to other source requests is set to 1, indicating that these source requests are held and waiting for authorization to be sent.

[0056] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

[0057] The above are only some embodiments of the present invention. For those skilled in the art, several modifications and improvements can be made without departing from the creative concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A method for implementing PCIe Switch WRR arbitration, characterized in that: The implementation method comprises the following steps: S100. Generates a source arbitration request signal according to the TLP indication signal of each request source; S200. According to the WRR phase table, each phase value corresponding to the number of the request source arbitration request is decoded into a phase arbitration request; S300. Perform fast polling arbitration on the phase arbitration request sequence using a dynamic mask method; S400. Restore the number of the original request source corresponding to the phase arbitration request according to the authorized phase arbitration request position, and output the TLP message of the request source through the destination port according to the number of the original request source.

2. A method for implementing PCIe Switch WRR arbitration according to claim 1, characterized in that: Step S100. Generate a source arbitration request signal according to the TLP indication signal of each request source, specifically including the following contents: TLP messages are divided into multi-beat TLP messages and single-beat TLP messages according to the number of valid beats, and the TLP indication signal includes a header valid signal srcN_tlp_hv, a data valid signal srcN_tlp_dv and an end indication signal srcN_tlp_eot. For multi-beat TLP messages, the generated arbitration request signal srcN_tlp_req must start from the effective start of the data valid signal srcN_tlp_hv and continue until the end indication signal srcN_tlp_eot effectively ends, and must maintain a high level; for single-beat TLP messages, the generated arbitration request signal srcN_tlp_req is consistent with the header valid signal srcN_tlp_hv.

3. A method for implementing PCIe Switch WRR arbitration according to claim 2, characterized in that: Step S200. According to the WRR phase table, decode the arbitration request of each phase value corresponding number request source into a phase arbitration request, including the following contents: Correspond each phase value in the phase table to the corresponding request source number; Assigning the request source arbitration request to the corresponding phase arbitration request; Determine whether the request source arbitration request is valid. If it is valid, the corresponding phase arbitration request is valid. If it is invalid, the corresponding phase arbitration request is 0, and the phase arbitration request is invalid. It is determined whether the request source number corresponding to the phase value is valid. If it is valid, the corresponding phase arbitration request is valid. If it is invalid, the phase arbitration request is assigned a value of 0, indicating that the phase arbitration request is invalid.

4. A method for implementing PCIe Switch WRR arbitration according to claim 3, characterized in that: Step S300: Perform fast polling arbitration on the phase arbitration request sequence using a dynamic mask method, including the following steps: S301. Separate the phase arbitration request sequence into a request sequence to be queried and a request sequence that has been queried; S302. Find the first valid request for the query request sequence and the queried request sequence respectively according to the defined order; S303. If a valid request is found in the request sequence to be queried, the request is an authorization request; if no valid request is found in the request sequence to be queried, the valid request found in the request sequence that has been queried is taken as the authorization request; S304. Determine the location of the authorization request found, and update the sequence mask of the request to be queried and the sequence mask of the request to be queried according to the location; S305. Repeat steps S302-304 until all valid requests in the phase arbitration request sequence are authorized.

5. A method for implementing PCIe Switch WRR arbitration according to claim 4, characterized in that: The S303 further includes: if there are no valid requests in the request sequence to be queried and the request queue to be queried, the mask of the request sequence to be queried and the mask of the request sequence to be queried remain unchanged.

6. A method for implementing PCIe Switch WRR arbitration according to claim 5, characterized in that: S400. Restore the original request source number corresponding to the phase arbitration request according to the authorized phase arbitration request position, and output the TLP message of the request source through the destination port according to the original request source number; specifically including: Obtain the number of the corresponding request source according to the authorized phase arbitration request, Query the phase value corresponding to the request source number according to the phase table; The request source with the corresponding number of the phase request is obtained according to the phase value, and the TLP message of the request source with the corresponding number is sent to the output port of the WRR arbitration module.