Packet sending method, device, storage medium and processor

By generating a port schedule and performing port scheduling according to the table, the problem of complex and errors in port scheduling in chip verification is solved, and the accuracy and uniformity of port scheduling is achieved, ensuring the test of the switch under the full-line speed forwarding of all ports Validity.

CN116137614BActive Publication Date: 2024-12-03CHENGDU NANFEI MICROELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310177756.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-27
Publication Date
2024-12-03
Estimated Expiration
2043-02-27

AI Technical Summary

Technical Problem

In chip verification, there are problems in the existing packetization method that the port scheduling process is complex and error-prone, especially in the case of multi-port time division multiplexing, which cannot effectively cover the switch's full-line speed forwarding on all ports, resulting in the equipment during the test The problem cannot be exposed.

Method used

By obtaining port information, a port schedule is generated according to the preset port scheduling rules, a data slicing queue of each port is obtained, and port scheduled according to the schedule table to ensure that data slicing is sent to the appropriate port, thereby achieving the accuracy of port scheduling and Uniformity.

Benefits of technology

This method uses the port schedule to ensure that the contracting is carried out strictly in the scheduling order, simplifies the difficulty of port scheduling in chip verification, optimizes software overhead, and exposes the DUT problem when all ports are forwarded at full speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116137614B_ABST
    Figure CN116137614B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a packet sending method, device, storage medium and processor, which belong to the field of chip verification technology. The present invention obtains port information, and generates a port scheduling table according to the port information and the preset port scheduling rules; then obtains the data slice queue of each port, and then performs port scheduling according to the port scheduling table to obtain the scheduling port information; then according to the scheduling port information, the data slices in the data slice queue of the corresponding port are sent out. Thereby ensuring the accuracy of port scheduling. At the same time, the method is based on table lookup, without the software overhead caused by multiple random operations. By changing the content in the port scheduling table, random port scheduling, priority scheduling, etc. can also be realized, so that the scheduling rules are flexible and configurable, simplifying the difficulty of port scheduling implementation in the chip verification process and optimizing the software overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of chip verification technology, and in particular to a packet issuing method, a packet issuing device, a machine-readable storage medium and a processor. Background Art

[0002] In switch chips, due to the large number of interconnected ports and the wide coverage of port rates, most of the internal data storage and forwarding adopts port-based time-division multiplexing technology, and the multiplexing is scheduled based on the port rate or priority. So when verifying the switch chip module level (BT, BlockTest), it is very likely that the output of the upstream module is the timing of multi-port time-division multiplexing, so the packet sending component of this module needs to give incentives according to the output behavior of the upstream module. However, since the verification environment UVM is implemented based on the SystermVerilog language, it is impossible to directly call the port multiplexing module implemented in Verilog, and only SystermVerilog can be used to implement the same behavior. But in essence, both select the scheduling port to reuse the same channel based on a certain scheduling algorithm, so the core of multiplexing is scheduling.

[0003] For scheduling, SystermVerilog has the following implementation schemes:

[0004] First, with the help of the constraint function of SystermVerilog, randomization is started each time a scheduling port is selected. By constraining the weights of different ports, the probability of each port being selected is controlled.

[0005] The following two situations are introduced respectively:

[0006] 1. The speed of each port is the same. When scheduling, it is only necessary to ensure that the probability of each port being selected is equal. The simplest implementation is to set the same weight for each port through the constraint function dist. However, in this implementation, there is a possibility that the selected port will still be selected when the port is selected next time. The reason is that there is no correlation between the two random selections. The improvement method to solve this problem is to use the random traversal property (randc) of the constraint function to ensure that the ports randomly selected each time will not be repeated.

[0007] 2. There are multiple ports with different speeds. Although the weight of high-speed ports can be increased, there is still no correlation between the two random port selections. Even if randc is used, each port can only be selected in turn with the same probability, and there is no guarantee that the high-speed port will be selected with a higher probability. The impact caused by this is uneven port traffic, which cannot cover the situation where the switch forwards at full line speed on all ports, resulting in the failure to expose the problem of the device under test (DUT) in this case.

[0008] Therefore, in the field of chip verification, the existing packet sending method has the problem that the port scheduling process is complex and prone to errors. Summary of the invention

[0009] The purpose of the embodiments of the present application is to provide a package sending method, a package sending device, a machine-readable storage medium and a processor.

[0010] In order to achieve the above-mentioned purpose, the first aspect of the present application provides a contract issuance method, comprising:

[0011] Acquire port information, and generate a port scheduling table according to the port information and preset port scheduling rules;

[0012] Get the data slice queue of each port;

[0013] Perform port scheduling according to the port scheduling table to obtain scheduling port information;

[0014] According to the scheduling port information, the data slices in the data slice queue of the corresponding port are sent out.

[0015] In the embodiment of the present application, the port information includes port bandwidth and port quantity, and the port scheduling table is generated according to the port information and the preset port scheduling rules, including:

[0016] According to the port bandwidth of each port, a port bandwidth ratio is obtained;

[0017] According to the port bandwidth ratio and the preset port scheduling rule, a port scheduling number is obtained, wherein the port scheduling number is used to characterize a single port scheduling number of ports with different bandwidths;

[0018] A port scheduling table is generated according to the port scheduling times and the port information.

[0019] In the embodiment of the present application, performing port scheduling according to the port scheduling table to obtain scheduling port information includes:

[0020] A1: establishing a port index of the port scheduling table according to the port scheduling times and the port information, and setting the index value of the port index to n;

[0021] A2: extracting corresponding port information according to the index value of the port index;

[0022] A3: Determine whether the corresponding port has available credit according to the corresponding port information. If so, determine the scheduling port information according to the corresponding port information; if not, set n=n+1 and jump to A2.

[0023] In the embodiment of the present application, in step A3, if the corresponding port credit is unavailable, the process further includes:

[0024] Determine whether all port credits in the port scheduling table are unavailable. If so, wait for the next valid clock edge to arrive and execute A2; if not, set n=n+1 and jump to A2.

[0025] In the embodiment of the present application, before executing A2, the following steps are also included:

[0026] Determine whether the effective clock edge has arrived. If so, set n=n+1 and execute A2; if not, jump to A2.

[0027] In the embodiment of the present application, the number of port scheduling is the number of single scheduling of each bandwidth port when the minimum bandwidth port completes one scheduling. In step A1, the port index of the port scheduling table is established according to the number of port scheduling and the port information, including:

[0028] Determine the number of minimum bandwidth ports according to the port information;

[0029] According to the port scheduling times and the number of the minimum bandwidth ports, a total scheduling times for one round of scheduling is calculated;

[0030] A port index of the port scheduling table is established according to the total scheduling times.

[0031] In the embodiment of the present application, obtaining the data slice queue of each port includes:

[0032] Get multiple message data;

[0033] Slicing each of the message data respectively to obtain data slices corresponding to each message data;

[0034] According to the destination port of the message data, the corresponding data slice is stored in the data queue of the corresponding port to obtain the data slice queue of each port.

[0035] A second aspect of the present application provides a package issuing device, the package issuing device comprising:

[0036] Establishing a module for acquiring port information and generating a port scheduling table according to the port information and preset port scheduling rules;

[0037] The acquisition module is used to obtain the data slice queue of each port;

[0038] A scheduling module, used to perform port scheduling according to the port scheduling table to obtain scheduling port information;

[0039] The packet sending module is used to send out the data slices in the data slice queue of the corresponding port according to the scheduling port information.

[0040] A third aspect of the present application provides a processor configured to execute the above-mentioned packet sending method.

[0041] A fourth aspect of the present application provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the above-mentioned packet sending method.

[0042] Through the above technical solution, by obtaining the port information, and according to the port information, according to the preset port scheduling rules, a port scheduling table is generated; then the data slice queue of each port is obtained; then the port scheduling is performed according to the port scheduling table to obtain the scheduling port information; and then according to the scheduling port information, the data slices in the data slice queue of the corresponding port are sent out. Since various port scheduling information is generated in advance according to the preset port scheduling rules and configured in the port scheduling table, and then the port information in the port scheduling table is traversed and read out, the read port can meet the preset port scheduling rules. The sent packet is strictly scheduled, thereby ensuring the accuracy of port scheduling. At the same time, the method is based on table lookup, without the software overhead caused by multiple random operations. By changing the content in the port scheduling table, random port scheduling, priority scheduling, etc. can also be realized, making the scheduling rules flexible and configurable, simplifying the difficulty of port scheduling implementation in the chip verification process, and optimizing software overhead. This method strictly sends packets in the order of port scheduling. Even if some ports have no traffic coming in, the entire packet sending device still schedules packets according to fixed rules, thereby ensuring uniform distribution of port traffic. This can cover the situation where the switch forwards at full line speed on all ports, and the problems of the DUT can be exposed.

[0043] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:

[0045] Figure 1 A schematic diagram of an application environment of a method for issuing a package according to an embodiment of the present application is schematically shown;

[0046] Figure 2 A schematic diagram of a process flow of a method for issuing a package according to an embodiment of the present application is shown schematically;

[0047] Figure 3The module diagram of the packet sending method according to the embodiment of the present application is schematically shown;

[0048] Figure 4 A schematic diagram of a port scheduling process according to an embodiment of the present application is shown schematically;

[0049] Figure 5 A schematic diagram of a port scheduling table according to an embodiment of the present application is schematically shown;

[0050] Figure 6 A structural block diagram of a packet sending device according to an embodiment of the present application is schematically shown;

[0051] Figure 7 The internal structure diagram of a computer device according to an embodiment of the present application is schematically shown.

[0052] Description of Reference Numerals

[0053] 102-terminal; 104-server; 410-establishment module; 420-acquisition module; 430-scheduling module; 440-packet sending module; A01-processor; A02-network interface; A03-internal memory; A04-display screen; A05-input device; A06-non-volatile storage medium; B01-operating system; B02-computer program. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme 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. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0055] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0056] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0057] The present application provides a method for issuing a contract, which can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The server 104 obtains the port information from the terminal 102, and generates a port scheduling table according to the port information and the preset port scheduling rules; obtains the data slice queue of each port; performs port scheduling according to the port scheduling table to obtain the scheduling port information; according to the scheduling port information, sends the data slices in the data slice queue of the corresponding port. Thereby simplifying the difficulty of port scheduling implementation in the verification process, optimizing the software overhead, and providing a packet sending method that can be configured based on different scheduling rules. Among them, the terminal 102 can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0058] Figure 2 The following schematically shows a flow chart of a method for sending a package according to an embodiment of the present application. Figure 1 As shown, in one embodiment of the present application, a packet sending method is provided, and the present invention can be applied to the field of chip verification, and the process of port scheduling can be realized by the UVM packet sending component. Figure 1 Taking the terminal 102 (or server 104) in FIG. 1 as an example, the following steps are included:

[0059] Step 210: Acquire port information, and generate a port scheduling table according to the port information and preset port scheduling rules;

[0060] In this embodiment, the port information may refer to the port information in the verification chip, including port attributes, specifications or types, such as the number of ports, port bandwidth, port number, priority, weight and other information. For example, the verification chip is a switch chip, and the port information includes: a total of 56 ports, including 32 1G ports (port numbers: 0-15, 28-43), 22 10G ports (port numbers: 16-27, 44-50, 52-54) and 2 40G ports (port numbers: 51, 55).

[0061] The preset port scheduling rules can be set according to actual conditions, such as RR scheduling, SP, weight scheduling, port bandwidth scheduling, etc. For example, in this embodiment, the port scheduling rules can be set as follows: high-speed ports are more scheduled, low-speed ports are less scheduled, and each outlet should meet the speed limit requirements after scheduling.

[0062] The generation of the above port scheduling table includes the following two situations:

[0063] (1) For multiple ports with only one rate, you only need to write the port scheduling table in order from small to large port numbers. It should be noted that the initial scheduling order is not important, and non-continuous port scheduling will occur after several rounds of scheduling.

[0064] (2) There are multiple ports with different speeds, with more high-speed ports and fewer low-speed ports. The ratio of high-speed ports to low-speed ports is set according to the port bandwidth ratio.

[0065] For the second situation above, in one implementation, when the port information includes the port bandwidth and the number of ports, the step of generating the port scheduling table based on the port scheduling rule may include the following steps:

[0066] First, the port bandwidth ratio is obtained according to the port bandwidth of each port; in this embodiment, the port bandwidth refers to the bandwidth corresponding to each port, and the port bandwidth is different according to different chips and ports, and the port bandwidth ratio refers to the bandwidth ratio between ports. For example, in the above example, the port bandwidth includes 40G, 10G and 1G, and the port bandwidth ratio can be obtained as 40:10:1.

[0067] Then, according to the port bandwidth ratio and the preset port scheduling rules, the number of port scheduling is obtained, and the number of port scheduling is used to characterize the number of single port scheduling of ports with different bandwidths; in this embodiment, in order to meet the requirements of more scheduling of high-speed ports and less scheduling of low-speed ports, and each outlet should meet the speed limit requirement after scheduling, when the port bandwidth ratio is 40:10:1, it can be obtained that: when the 40G port is scheduled 4 times, the 10G port is scheduled once, and when the 10G port is scheduled 10 times, the 1G port is scheduled once. That is, when the 1G port is scheduled once, the 10G port is scheduled 10 times, and the 40G port is scheduled 40 times. That is, the number of port scheduling is obtained.

[0068] Finally, a port scheduling table is generated according to the number of port scheduling and the port information. In this embodiment, the port scheduling table includes the port information of each scheduling, such as the port number. In order to save storage space, the port scheduling table can only store the information of all port scheduling in one round. During the port scheduling process, the scheduling table can be continuously traversed, and the port number read out is the port corresponding to the scheduling relationship.

[0069] It should be noted that this embodiment uses port bandwidth to illustrate how the port scheduling rule generates a port scheduling table. In other embodiments, the port scheduling table can also be generated based on other information in the port information, such as port attributes, specifications or types.

[0070] In this embodiment, the ports can be arranged based on the port scheduling times according to the port numbers in the port information, thereby obtaining a port scheduling table, so that ports with the same rate can automatically switch to other ports after scheduling, ensuring fair scheduling of all ports.

[0071] Please see Figure 5 , Figure 5 The schematic diagram of the port scheduling table according to the embodiment of the present application is schematically shown. For example: in the above example, according to the rule that when the 40G port is scheduled 4 times, the 10G port is scheduled once, and when the 10G port is scheduled 10 times, the 1G port is scheduled once, the above ports are arranged to obtain the port scheduling table. In the above example, after the 1G port is scheduled once, the 40G port is then scheduled 4 times, and then the 10G port is scheduled once. It should be noted that the above port order is not limited, as long as the port scheduling times are met.

[0072] In another embodiment, the number of port scheduling can be set according to the test needs, for example, when a 1G port is scheduled once, a 10G port is scheduled 20 times, and a 40G port is scheduled 80 times. Then, a port scheduling table is generated according to the number of port scheduling and the port information. Thus, port scheduling can be controlled according to actual needs, which improves the flexibility of port scheduling.

[0073] Step 220: Obtain the data slice queue of each port. In this embodiment, in order to satisfy the data output of all ports through a group of interfaces, when all ports have data packets to send, it is required that each port can send packets and meet the port line speed requirements. Therefore, it is necessary to set a data slice queue at each port. The above-mentioned data slice queue includes data slices arranged in sequence, and each data slice occupies 64 bytes.

[0074] Wherein, when the data is message data, the data slice queue of each port may be obtained by the following steps:

[0075] First, multiple message data are obtained; in this embodiment, in order to satisfy that all ports have data packets, each port corresponds to a message data, and the lengths of the message data can be the same or different. It should be noted that the number of messages for each port can be the same or different, which can be determined according to actual conditions and is not limited in this embodiment.

[0076] Then, each of the message data is sliced ​​to obtain a data slice corresponding to each message data; in the above slicing process, multiple data slices are obtained according to the length of the message data, and each data slice occupies 64 bytes.

[0077] It should be noted that even if the data in the data slice is not 64 bytes, the data slice still occupies 64 bytes, thereby ensuring that the bytes occupied by the data sent by each port are the same, thereby improving the accuracy of the port test.

[0078] Finally, according to the destination port of the message data, the corresponding data slice is stored in the data queue of the corresponding port to obtain the data slice queue of each port. In this embodiment, the destination port refers to the port corresponding to the message data. For example, if the destination port of message data A is port 23, the data slice of message data A is stored in the data queue of port 23 to wait for data packet transmission.

[0079] Step 230: Perform port scheduling according to the port scheduling table to obtain scheduling port information;

[0080] In order to ensure that the obtained dispatch port is available, you can check whether the credit of the dispatch port is available. Figure 4 , Figure 4 The schematic diagram of the port scheduling process according to the embodiment of the present application is schematically shown. Specifically, the following steps are included:

[0081] Step A1: Establish a port index of the port scheduling table according to the number of port scheduling and the port information, and set the index value of the port index to n; in this embodiment, in order to facilitate port scheduling, a port index can be established, and the port information can be determined by the index value, and n is less than or equal to the total number of scheduling times of all ports after one round of scheduling. Among them, when the number of port scheduling is the number of single schedulings of each bandwidth port when the minimum bandwidth port completes one scheduling, the port index of the port scheduling table is established according to the number of port scheduling and the port information, including the following steps:

[0082] First, the number of minimum bandwidth ports is determined according to the port information; for example, in the above example, the minimum bandwidth port is 1G, and the number of corresponding ports is: 32.

[0083] Then, according to the port scheduling times and the number of the minimum bandwidth ports, the total scheduling times for one round of scheduling is calculated;

[0084] In this embodiment, the number of port scheduling times and the number of minimum bandwidth ports can be substituted into the following formula to calculate:

[0085]

[0086] Among them, P is the total number of scheduling times after a round of scheduling, S i is the number of single scheduling of each bandwidth port when the minimum bandwidth port completes one scheduling, N1 is the number of minimum bandwidth ports, i is the bandwidth type, and k is the maximum bandwidth type.

[0087] Finally, a port index of the port scheduling table is established according to the total scheduling times.

[0088] For example, in the above example, when a 1G port is scheduled once, a 10G port is scheduled 10 times, and a 40G port is scheduled 40 times. Substituting the above formula, P = (40 + 10 + 1) × 32 = 1632. A total of 1632 times are required to schedule all 1G ports in one round. The index value can be a natural number starting from 0, that is, the port scheduling table can use indexes 0 to 1631 to indicate all scheduled ports. It can be obtained that the index value of the port index is from 0 to 1631, and each index value corresponds to a different port number.

[0089] Step A2: extract the corresponding port information according to the index value of the port index; in this embodiment, within one clock cycle, the corresponding port information can be obtained according to the current index value, and the above port information can be the port number, the port position or other information that can distinguish the port.

[0090] Step A3: Determine whether the corresponding port has available credit according to the corresponding port information. If so, determine the scheduling port information according to the corresponding port information; if not, set n=n+1 and jump to A2. In order to ensure that the scheduled port is valid and the corresponding port is available, a port credit check can be performed, that is, check whether the credit is available. If not, extract the port corresponding to the next index value, that is, set n=n+1 and jump to A2; otherwise, if it is available, it means that the corresponding port is available, and the corresponding port information is used as the scheduling port information.

[0091] Wherein, in the above step A3, if the corresponding port credit is unavailable, the step further includes:

[0092] It is determined whether all the port credits in the port scheduling table are unavailable. If so, wait for the next effective clock edge to arrive and jump to A2; if not, set n=n+1 and jump to A2. In this embodiment, after querying whether each port credit is available, n=n+1. If it is found that all the port credits are unavailable, the current n is not changed, and it only needs to wait for the next effective clock edge to arrive.

[0093] Before executing A2, the following steps are also included:

[0094] Determine whether the effective clock edge has arrived. If so, set n=n+1 and jump to A2; if not, jump to A2.

[0095] In this embodiment, an accumulator can be set to implement index value accumulation, that is, an index adder. When the effective edge of the clock arrives, the accumulator will be automatically triggered to add 1. At the current moment, if the credit of the selected port is not available, the accumulator will also be triggered to add 1 through ⑦; in the above example, if the credit of 56 ports is not available, you can go to ⑧ and wait for the next effective edge of the clock to arrive before triggering the accumulator. After the accumulator is filled with 1631, it will automatically flip to 0. After each new index value is obtained, the port scheduling table is queried to retrieve the corresponding port number.

[0096] At the same time, credit control can also be performed, that is, the port number retrieved is used to check whether the current port credit is available. If available, continue to step ③; if not available, go to step ⑥⑦ to accumulate the index value, and then get a new port number, and check again whether the new port number credit is available. If available, go to step ③. If still unavailable, repeat the process of ⑥⑦. If all the ports retrieved from the port scheduling table at the current moment have no credit, wait for the next effective clock edge and start again from step ①.

[0097] Step 240: According to the scheduling port information, the data slices in the data slice queue of the corresponding port are sent out. In this embodiment, the scheduling port information can be a port number, and the corresponding port is found by the port number, and then the first data slice in the data slice queue of the port is sent out to implement packet sending. For example, Figure 4 In the process, the first data slice of the specified queue is taken and sent out through ④. Repeating the above steps can realize sending out all the data slices in the data slice queues of each port.

[0098] Please see Figure 3 , Figure 3 The module diagram of the packet sending method according to the embodiment of the present application is schematically shown. In one embodiment, the data of each port is a message, and the packet sending can be completed through message slice storage, table index control, scheduling table (information) generation, message slice selection and sending. Among them, message slice storage: storage based on the message slices stored on the port. Table index control: control whether to move to the next address after the port is selected. Scheduling table (information) generation: This part mainly generates the port number to be downloaded to the table according to the scheduling rules to obtain the port scheduling table. Message slice selection and sending: find the corresponding message slice according to the selected port number and send it out.

[0099] In the above implementation process, by obtaining port information, and according to the port information, according to the preset port scheduling rules, a port scheduling table is generated; then the data slice queue of each port is obtained; and then the port scheduling is performed according to the port scheduling table to obtain the scheduling port information; and then according to the scheduling port information, the data slices in the data slice queue of the corresponding port are sent out. When there are multiple ports with different rates, if the scheduling requires more scheduling of high-speed ports and less scheduling of low-speed ports, and each outlet should meet the speed limit requirements after scheduling, based on the above port scheduling rule requirements, the number of port scheduling is allocated according to the bandwidth ratio of each port, and a port scheduling table is generated. The table stores the information of all port scheduling in one round, and the scheduling table is traversed all the time. The port read out is the port that meets the scheduling rule, which ensures the accuracy of port scheduling. At the same time, the method is based on table lookup, without the software overhead caused by multiple random operations. By changing the content in the port scheduling table, random port scheduling, priority scheduling, etc. can also be realized, so that the scheduling rules are flexible and configurable, simplifying the difficulty of port scheduling implementation in the chip verification process, and optimizing the software overhead.

[0100] Since various port scheduling information is generated in advance according to the preset port scheduling rules and configured in the port scheduling table, and then the port information in the port scheduling table is traversed and read out, the read port can meet the preset port scheduling rules. The packets sent are strictly scheduled. Prepare the port scheduling table corresponding to all port scheduling rules in advance. When the UVM environment is started, the corresponding port scheduling information can be downloaded according to the selection. This method strictly sends packets in the order of port scheduling. Even if some ports have no traffic coming in, the entire packet sending device still schedules packets according to fixed rules, thereby ensuring uniform distribution of port traffic. It can cover the situation where the switch forwards at full line speed on all ports, and the problems of DUT can be exposed.

[0101] Figure 2 FIG. 1 is a flow chart of a method for sending a package in an embodiment. It should be understood that although Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0102] In one embodiment, Figure 6 As shown, Figure 6 The structural block diagram of a packet issuing device according to an embodiment of the present application is schematically shown. A packet issuing device is provided, comprising a establishing module 410, an acquiring module 420, a scheduling module 430 and a packet issuing module 440, wherein:

[0103] Establishing module 410, for acquiring port information, and generating a port scheduling table according to the port information and preset port scheduling rules;

[0104] An acquisition module 420 is used to acquire a data slice queue of each port;

[0105] The scheduling module 430 is used to perform port scheduling according to the port scheduling table to obtain scheduling port information;

[0106] The packet sending module 440 is used to send out the data slices in the data slice queue of the corresponding port according to the scheduling port information.

[0107] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters can be adjusted to achieve simple and accurate port scheduling during the packet sending process.

[0108] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0109] An embodiment of the present application provides a storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned packet sending method is implemented.

[0110] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05 and a memory (not shown in the figure) connected through a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A06. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor A01, a method for sending a package is implemented. The display screen A04 of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device A05 of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0111] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0112] In one embodiment, the packet issuing device provided in the present application can be implemented in the form of a computer program. The computer program can be Figure 7 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the packet issuing device, for example, Figure 6The establishment module 410, acquisition module 420, scheduling module 430 and packet sending module 440 are shown. The computer program composed of various program modules enables the processor to execute the steps of the packet sending method of each embodiment of the present application described in this specification.

[0113] Figure 7 The computer device shown can be Figure 6 The establishment module 410 in the packet sending device shown executes step 210. The computer device can execute step 220 through the acquisition module 420, execute step 230 through the scheduling module 430, and execute step 240 through the packet sending module 440.

[0114] The embodiment of the present application provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented:

[0115] Acquire port information, and generate a port scheduling table according to the port information and preset port scheduling rules;

[0116] Get the data slice queue of each port;

[0117] Perform port scheduling according to the port scheduling table to obtain scheduling port information;

[0118] According to the scheduling port information, the data slices in the data slice queue of the corresponding port are sent out.

[0119] In one embodiment, the port information includes port bandwidth and port quantity, and generating a port scheduling table according to the port information and a preset port scheduling rule includes:

[0120] According to the port bandwidth of each port, a port bandwidth ratio is obtained;

[0121] According to the port bandwidth ratio and the preset port scheduling rule, a port scheduling number is obtained, wherein the port scheduling number is used to characterize a single port scheduling number of ports with different bandwidths;

[0122] A port scheduling table is generated according to the port scheduling times and the port information.

[0123] In one embodiment, performing port scheduling according to the port scheduling table to obtain scheduling port information includes:

[0124] A1: establishing a port index of the port scheduling table according to the port scheduling times and the port information, and setting the index value of the port index to n;

[0125] A2: extracting corresponding port information according to the index value of the port index;

[0126] A3: Determine whether the corresponding port has available credit according to the corresponding port information. If so, determine the scheduling port information according to the corresponding port information; if not, set n=n+1 and jump to A2.

[0127] In one embodiment, in the above step A3, if the corresponding port credit is not available, the method further includes:

[0128] Determine whether all port credits in the port scheduling table are unavailable. If so, wait for the next effective clock edge to arrive and jump to A2; if not, set n=n+1 and jump to A2.

[0129] In one embodiment, before executing A2, the following steps are also included:

[0130] Determine whether the effective clock edge has arrived. If so, set n=n+1 and jump to A2; if not, jump to A2.

[0131] In one embodiment, the number of port scheduling is the number of single scheduling of each bandwidth port when the minimum bandwidth port completes one scheduling. In step A1, the port index of the port scheduling table is established according to the number of port scheduling and the port information, including:

[0132] Determine the number of minimum bandwidth ports according to the port information;

[0133] According to the port scheduling times and the number of the minimum bandwidth ports, a total scheduling times for one round of scheduling is calculated;

[0134] A port index of the port scheduling table is established according to the total scheduling times.

[0135] In one embodiment, obtaining the data slice queue of each port includes:

[0136] Acquire multiple message data, the number of the message data is the same as the total number of ports in the port information;

[0137] Slicing each of the message data respectively to obtain data slices corresponding to each message data;

[0138] According to the destination port of the message data, the corresponding data slice is stored in the data queue of the corresponding port to obtain the data slice queue of each port.

[0139] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0140] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0141] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0142] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0143] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0144] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0145] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0146] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0147] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for issuing a package, It is characterized in that include: Acquire port information, and generate a port scheduling table according to the port information and preset port scheduling rules; The port information refers to the port information in the verification chip; Get the data slice queue of each port; Perform port scheduling according to the port scheduling table to obtain scheduling port information; According to the scheduling port information, the data slices in the data slice queue of the corresponding port are sent out; The port information includes port bandwidth and port quantity, and generating a port scheduling table according to the port information and preset port scheduling rules includes: According to the port bandwidth of each port, a port bandwidth ratio is obtained; According to the port bandwidth ratio and the preset port scheduling rule, a port scheduling number is obtained, wherein the port scheduling number is used to characterize a single port scheduling number of ports with different bandwidths; A port scheduling table is generated according to the port scheduling times and the port information.

2. The method according to claim 1, It is characterized in that The performing port scheduling according to the port scheduling table to obtain scheduling port information includes: A1: establishing a port index of the port scheduling table according to the port scheduling times and the port information, and setting the index value of the port index to n; A2: extracting corresponding port information according to the index value of the port index; A3: Determine whether the corresponding port has available credit according to the corresponding port information. If so, determine the scheduling port information according to the corresponding port information; if not, set n=n+1 and jump to A2.

3. The method according to claim 2, It is characterized in that In step A3, if the corresponding port credit is not available, the process further includes: Determine whether all port credits in the port scheduling table are unavailable. If so, wait for the next effective clock edge to arrive and jump to A2; if not, set n=n+1 and jump to A2.

4. The method according to claim 2, It is characterized in that Before executing A2, the following steps are also included: Determine whether the effective clock edge has arrived. If so, set n=n+1 and execute A2; if not, execute A2.

5. The method according to claim 2, It is characterized in that The port scheduling times are the times of single scheduling of each bandwidth port when the minimum bandwidth port completes one scheduling; In step A1, a port index of the port scheduling table is established according to the port scheduling times and the port information, including: Determine the number of minimum bandwidth ports according to the port information; According to the port scheduling times and the number of the minimum bandwidth ports, a total scheduling times for one round of scheduling is calculated; A port index of the port scheduling table is established according to the total scheduling times.

6. The method according to claim 1, It is characterized in that The step of obtaining the data slice queue of each port includes: Get multiple message data; Slicing each of the message data respectively to obtain data slices corresponding to each message data; According to the destination port of the message data, the corresponding data slice is stored in the data queue of the corresponding port to obtain the data slice queue of each port.

7. A package issuing device, It is characterized in that include: Establishing a module for acquiring port information and generating a port scheduling table according to the port information and preset port scheduling rules; The port information refers to the port information in the verification chip, and the port information includes the port bandwidth and the number of ports; including: obtaining a port bandwidth ratio according to the port bandwidth of each port; obtaining a port scheduling number according to the port bandwidth ratio and a preset port scheduling rule, wherein the port scheduling number is used to characterize a single port scheduling number of ports with different bandwidths; generating a port scheduling table according to the port scheduling number and the port information; The acquisition module is used to obtain the data slice queue of each port; A scheduling module, used to perform port scheduling according to the port scheduling table to obtain scheduling port information; The packet sending module is used to send out the data slices in the data slice queue of the corresponding port according to the scheduling port information.

8. A machine-readable storage medium having instructions stored thereon, It is characterized in that When the instruction is executed by a processor, the processor is configured to execute the packet sending method according to any one of claims 1 to 6.