Chip testing methods, apparatus, systems, equipment, storage media, and software products
Patent Information
- Application Number
- CN202511553576.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2045-10-28
AI Technical Summary
Existing technologies for testing the data link layer of multi-protocol chips are inefficient and inaccurate, unable to detect sudden faults during chip operation in a timely manner, and are costly and complex to maintain, making it difficult to support comprehensive testing of multiple protocols.
By generating test data corresponding to multiple ports of the target under test, generating test data according to protocol type and data generation parameters, and performing self-testing through the verification module, the reference data generated by the first and second data frame generators is compared with the returned data to achieve self-testing of the data link layer.
It can achieve real-time and accurate multi-protocol chip data link layer testing without relying on professional external equipment and personnel, promptly detect faults, and improve testing efficiency and accuracy.
Smart Images

Figure CN121441799B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and specifically to chip testing methods, apparatus, systems, devices, storage media, and program products. Background Technology
[0002] In modern communication networks, with the increasing complexity and diversity of application scenarios, chips that integrate multiple protocols have emerged, such as chips combining Ethernet and InfiniBand (IB) networks. Since different protocols differ significantly in frame format, verification mechanisms, and transmission rates, and the data link layer in multi-protocol chips acts as a hub for conversion between these protocols, how to test the data link layer of multi-protocol chips has become an urgent problem to be solved.
[0003] In related technologies, testing of the data link layer relies on professional external testing equipment. However, external testing equipment is expensive and complex to maintain. It requires professional personnel to manually connect to each port of the multi-protocol chip to perform tests, which is inefficient, makes it difficult to perform real-time testing of the data link layer, and fails to detect sudden faults in the chip's operation in a timely manner. It is also inaccurate and time-sensitive, and most of them can only support testing of a single protocol, which is not comprehensive enough. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a chip testing method, apparatus, system, device, storage medium and program product to solve the problems of low efficiency and poor accuracy when testing the data link layer of multi-protocol chips in related technologies.
[0005] In a first aspect, the present invention provides a chip testing method applied to the data link layer, the method comprising: Test data corresponding to multiple ports of the target under test is generated; the test data is generated by the first data frame generator corresponding to the port according to the protocol type and data generation parameters; Based on the bandwidth of the multiple ports, the test data is scheduled to the multiple ports to send the test data to the corresponding ports; Receive the return data from the multiple ports based on the corresponding test data, and distribute the return data from the multiple ports to multiple verification modules according to the corresponding protocol type; The second data frame generator of the verification module generates reference data corresponding to the distributed return data; the protocol type and data generation parameters of the reference data are the same as those of the corresponding return data. The returned data is compared with the reference data to obtain the first test result.
[0006] In one optional implementation, the data generation parameters include a data generation mode and a message length; the method further includes: Get the protocol type, data generation mode, and message length; Configure the frame header of the test data according to the protocol type; Generate the payload field of the test data based on the data generation mode and message length; Test data is generated based on the frame header and the payload field.
[0007] In one optional implementation, the data generation mode includes an increasing mode, a decreasing mode, and a pseudo-random mode; the method further includes: When the data generation mode is incremental mode, the effective payload single-byte data corresponding to each test data is generated in increments of 1, and the effective payload single-byte data is used to fill the effective payload field of the corresponding test data. When the data generation mode is decreasing mode, the effective payload single-byte data corresponding to each test data is generated in increments of 255, and the effective payload single-byte data is used to fill the effective payload field of the corresponding test data. When the data generation mode is pseudo-random mode, the payload single-byte data corresponding to each test data is generated by the pseudo-random algorithm, and the payload field of the corresponding test data is filled by the payload single-byte data.
[0008] In one optional implementation, the message length includes a random length; the method further includes: Get the preset maximum message length and preset minimum message length; Subtract the preset maximum message length from the preset minimum message length to obtain the message length difference; Random numbers are generated using a pseudo-random algorithm; Calculate the number of significant binary bits in the message length difference; Based on the number of significant binary bits of the message length difference, the random number is truncated to obtain the truncated random number value; When the truncated value of the random number is greater than the message length difference, the preset minimum message length is added to the random number and then the message length difference is subtracted to obtain the message length. When the truncated value of the random number is less than the difference in message length, the preset minimum message length is added to the random number to obtain the message length.
[0009] In an optional implementation, the method further includes: The step of scheduling the test data to the multiple ports based on their bandwidth, so as to send the test data to the corresponding ports, includes: Based on the priority and bandwidth of the multiple ports, the test data of the multiple ports are scheduled to the sending end corresponding to the multiple media access control modules of the media access control layer; The test data from the sending end corresponding to the multiple media access control modules is classified according to the port number and scheduled to multiple media access control modules in the media access control layer, so that the multiple media access control modules can perform data loopback and loop back the test data to the receiving end corresponding to the multiple media access control modules to obtain the returned data. The receiving of return data from the multiple ports based on corresponding test data includes: Receive return data sent by the receiving end corresponding to the multiple media access control modules.
[0010] Secondly, the present invention provides a chip testing apparatus applied to the data link layer, the apparatus comprising: The first data acquisition module is used to generate test data corresponding to multiple ports of the target under test; the test data is generated by the first data frame generator corresponding to the port according to the protocol type and data generation parameters; The scheduling module is used to schedule the test data to the multiple ports according to the bandwidth of the multiple ports, so as to send the test data to the corresponding ports; The distribution module is used to receive the return data from the multiple ports based on the corresponding test data, and distribute the return data from the multiple ports to multiple verification modules according to the corresponding protocol type. The second data acquisition module is used to generate reference data corresponding to the distributed return data through the second data frame generator of the verification module; the protocol type and data generation parameters of the reference data are the same as those of the corresponding return data. The comparison module is used to compare the returned data with the reference data to obtain a first test result.
[0011] Thirdly, the present invention provides a chip testing system applied to the data link layer, the system comprising: A data frame generation module is used to generate test data corresponding to multiple ports of the target under test through a first data frame generator corresponding to multiple ports of the target under test; the test data is generated according to the protocol type and data generation parameters. The scheduling module is used to schedule the test data to the multiple ports according to the bandwidth of the multiple ports, so as to send the test data to the corresponding ports; The data distribution module is used to receive the return data from the multiple ports based on the corresponding test data, and distribute the return data from the multiple ports to multiple verification modules according to the corresponding protocol type. The verification module is used to generate reference data corresponding to the distributed return data through the second data frame generator; the protocol type and data generation parameters of the reference data are the same as those of the corresponding return data. The verification module is also used to compare the returned data with the reference data to obtain a first test result.
[0012] Fourthly, the present invention provides a computer device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the chip testing method of the first aspect or any corresponding embodiment described above.
[0013] Fifthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the chip testing method of the first aspect or any corresponding embodiment described above.
[0014] In a sixth aspect, the present invention provides a computer program product, including computer instructions for causing a computer to execute the chip testing method of the first aspect or any corresponding embodiment described above.
[0015] The technical solution provided by this invention may include the following beneficial effects: The chip testing method provided by this invention is applied to the data link layer. First, test data corresponding to multiple ports of the target under test is generated. This test data is generated by a first data frame generator corresponding to each port according to the protocol type and data generation parameters. By adjusting the protocol type and data generation parameters, it is applicable to multiple protocols and can generate various test data to comprehensively test the modules included in the chip's data link layer, improving test accuracy. Next, based on the bandwidth of the multiple ports, the test data is scheduled to multiple ports to send the test data to the corresponding ports, achieving maximum line-rate packet transmission. Then, return data from multiple ports based on the corresponding test data is received. Next, according to the corresponding protocol type, the return data from these multiple ports is distributed to multiple verification modules. Then, the second data frame generator of the verification module generates reference data corresponding to the distributed return data. The protocol type and data generation parameters of this reference data are the same as the corresponding return data, thereby verifying the integrity and correctness of the corresponding return data through the reference data. Finally, the return data is compared with the reference data to obtain the first test result, realizing self-testing of the data link layer. The above solution does not rely on professional external testing equipment or require manual testing by professionals. It can perform real-time testing of the data link layer through the generated test data, promptly detect sudden faults in the chip operation process, and is highly efficient, accurate, and real-time. Attached Figure Description
[0016] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 This is a schematic flowchart of a chip testing method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating another chip testing method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the test data structure according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a chip testing system according to an embodiment of the present invention; Figure 5 This is a data scheduling diagram according to an embodiment of the present invention; Figure 6 This is a schematic diagram of data distribution according to an embodiment of the present invention; Figure 7 This is a schematic diagram of a loopback test according to an embodiment of the present invention; Figure 8 This is a structural block diagram of a chip testing apparatus according to an embodiment of the present invention; Figure 9 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] In modern communication networks, with the increasing complexity and diversity of application scenarios, chips that integrate multiple protocols have emerged, such as chips that combine Ethernet and InfiniBand (IB) networks. Ethernet is widely used in local area networks (LANs) and other scenarios, becoming the mainstream choice for basic network connections due to its strong compatibility and low deployment costs. Ethernet includes the Physical Layer (PHY), Data Link Layer, and Network Layer. IB networks, with their high bandwidth and low latency, play a crucial role in fields with stringent data transmission requirements, such as high-performance computing and data centers. IB networks include the Physical Layer (PHY), Data Link Layer, Network Layer, Transport Layer, and Application Layer.
[0020] Different protocols exhibit significant differences in frame format, verification mechanisms, and transmission rates. Ethernet uses a specific MAC frame format, its verification mechanism is based on the CRC (Cyclic Redundancy Check) algorithm, and its transmission rates vary. IB networks have unique frame structures including unique Local Routing Headers (LRHs), and their verification methods and transmission rates differ greatly from Ethernet. Since the data link layer (the link layer in IB networks) acts as a hub for conversion between different protocols in multi-protocol chips, and also handles frame encapsulation / decapsulation, error control, and flow control, how to test the data link layer of multi-protocol chips has become a pressing issue.
[0021] In related technologies, testing of the data link layer relies on specialized external testing equipment. The disadvantages of this approach are: high cost and complex maintenance; significant investment is required to purchase and maintain such equipment; it necessitates manual connection by professionals to each port of the multi-protocol chip for testing, which is time-consuming, labor-intensive, and inefficient; it makes it difficult to comprehensively and in real-time test the internal data link layer of the chip, failing to promptly detect sudden faults during chip operation, resulting in poor accuracy and timeliness; and most technologies only support testing of a single protocol, failing to meet the comprehensive testing requirements of multi-protocol coexisting chips for the data link layer, thus lacking comprehensiveness.
[0022] According to an embodiment of the present invention, a chip testing method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0023] This embodiment provides a chip testing method applied to the data link layer. Figure 1 This is a flowchart of a chip testing method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Generate test data corresponding to multiple ports of the target under test.
[0024] This data link layer serves as both the data link layer for the target chip under test (the device under test) in Ethernet and the link layer in the IB network protocol. The Media Access Control (MAC) sublayer, located in both the Ethernet data link layer and the IB network link layer, is responsible for controlling and connecting the physical layer. The physical layer includes the Physical Coding Sublayer (PCS), Physical Medium Attachment (PMA), and Physical Media Dependent (PMD) sublayers. SerDes (Serializer / Deserializer) is the concrete implementation of the PMA and PMD sublayers.
[0025] In this step, multiple ports are used to indicate scheduling input ports. Each port corresponds to a first data frame generator. The test data is generated by the first data frame generator corresponding to the port according to the protocol type and data generation parameters. The protocol type and data generation parameters are selected based on actual needs. For example, for a chip combining Ethernet and IB networks, the protocol type is selected as Ethernet protocol and IB network protocol. Other types of protocols can also be adapted according to the actual application scenario. The data generation parameters are used to indicate the attributes and status of the generated test data and can be selected according to specific testing requirements. For example, multiple test data of different lengths, formats, and generation methods can be selected for subsequent testing. The test data also includes the source address and destination address of the data, facilitating the tracing of the test data and the location of the target device for subsequent transmission.
[0026] Step S102: Based on the bandwidth of the multiple ports, schedule the test data to the multiple ports so that the test data is sent to the corresponding ports.
[0027] After generating test data for each port, the test data is scheduled to the ports based on their bandwidth to achieve maximum line-rate packet transmission. The test data is then sent to the corresponding port, and thus enters the sub-target under test corresponding to that port within the target under test through the corresponding port.
[0028] Step S103: Receive the return data from the multiple ports based on the corresponding test data, and distribute the return data from the multiple ports to multiple verification modules according to the corresponding protocol type.
[0029] The target under test performs a data loopback test based on the received test data to obtain test result data, and then uses the test result data as feedback as return data. In other words, the test data and the return data are corresponding, and the return data contains the protocol type and data generation parameters of the corresponding test data.
[0030] To enable self-checking at the data link layer, multiple verification modules are configured within the data link layer, each containing a second data frame generator. The corresponding protocol types can be pre-defined for each verification module, resulting in a simple structure, low latency, and improved verification reliability. Upon receiving return data from multiple ports, the data is distributed to the appropriate verification module according to its corresponding protocol type.
[0031] Step S104: The second data frame generator of the verification module generates reference data corresponding to the distributed return data.
[0032] The protocol type and data generation parameters of the reference data are the same as those of the corresponding returned data, which is also the same as the test data corresponding to the returned data. In other words, the configuration parameters of the second data frame generator that generates the reference data and the first data frame generator that generates the test data corresponding to the reference data are the same, thereby verifying the integrity and correctness of the corresponding test data through the reference data.
[0033] Step S105: Compare the returned data with the reference data to obtain the first test result.
[0034] When verifying the completeness and correctness of the returned data using reference data, the returned data is compared with the reference data. If they match, the first test result is that the returned data is correct, indicating that there is no problem with the target under test. If they do not match, the first test result is that the returned data contains errors, indicating that there is a problem with the target under test and repair is required.
[0035] The chip testing method provided in this embodiment is applied to the data link layer. First, test data corresponding to multiple ports of the target under test is generated. This test data is generated by a first data frame generator corresponding to each port based on the protocol type and data generation parameters. By adjusting the protocol type and data generation parameters, it is applicable to multiple protocols and can generate various test data to comprehensively test the modules included in the chip's data link layer, improving test accuracy. Next, based on the bandwidth of the multiple ports, the test data is scheduled to multiple ports to send the test data to the corresponding ports, achieving maximum line-rate packet transmission. Then, return data from multiple ports based on the corresponding test data is received. Next, according to the corresponding protocol type, the return data from these multiple ports is distributed to multiple verification modules. Then, the second data frame generator of the verification module generates reference data corresponding to the distributed return data. The protocol type and data generation parameters of this reference data are the same as the corresponding return data, thereby verifying the integrity and correctness of the corresponding return data through the reference data. Finally, the return data is compared with the reference data to obtain the first test result, realizing self-testing of the data link layer. The above solution does not rely on professional external testing equipment or require manual testing by professionals. It can perform real-time testing of the data link layer through the generated test data, promptly detect sudden faults in the chip operation process, and is highly efficient, accurate, and real-time.
[0036] This embodiment provides a chip testing method applied to the data link layer. Figure 2 This is a flowchart of a chip testing method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps: Step S201: Generate test data corresponding to multiple ports of the target under test.
[0037] The test data is generated by the first data frame generator corresponding to the port, based on the protocol type and data generation parameters.
[0038] In one optional implementation, the data generation parameters include a data generation mode and a message length. The data generation mode indicates how the payload field in the test data is generated, and the message length indicates the length of the test data. Generally, the message length is adjusted by adjusting the data length of the payload field. When generating test data, the protocol type, data generation mode, and message length are first obtained. Then, according to the protocol type, the frame header of the test data is configured. According to the data generation mode and message length, the payload field of the test data is generated. Finally, the test data is generated based on the frame header and the payload field. Through the configurable frame header mechanism, dynamic adaptation to any Layer 2 protocol (such as Ethernet, IB networks, and custom protocols) is supported. It can adapt to heterogeneous network environments without hardware refactoring, offering good flexibility.
[0039] For example, Figure 3 This is a schematic diagram of the test data structure according to an embodiment of the present invention. The test data is a data frame. When the protocol type is Ethernet, the frame header of the test data includes the destination address (DA), the source address (SA), and the type / length (Type / Length). The test data also includes a payload field (PAYLOAD). The destination address is used to identify the physical address of the target device of the data frame, the source address is used to identify the physical address of the sending device of the data frame, the type (Type) is used to indicate the upper-layer protocol type of the data in the payload field, and the length (Length) is used in some protocols (e.g., IEEE 802.3) to indicate the number of bytes in the payload field. When the protocol type is IB network protocol, the frame header of the test data includes the Local Base Header (LBH), the Global Routing Header (GRH), and the Base Transport Header (BTH). The Local Base Header contains the frame's metadata (such as length, type, priority, etc.), the Global Routing Header provides global routing information (such as source / destination global addresses, hop count limits, etc.) when communicating across subnets or wide area networks (WANs), and the Base Transport Header is used to manage end-to-end transport layer control (such as reliability, fragmentation, sequence numbers, etc.).
[0040] Optionally, the data generation mode includes an increasing mode, a decreasing mode, and a pseudo-random mode, thereby generating multiple test data that conform to a certain pattern in batches. When the data generation mode is increasing, it increments by 1 (Step Size, the change between two adjacent values in the sequence), sequentially generating single-byte payload data (8 bits) for each test data. This single-byte payload data is then used to fill the payload field of the corresponding test data, with each byte being filled in units of 1 byte. Users can preset a starting value, for example, starting from 3 and increasing by 1 each time. The value range of this single-byte payload data is 0~255. When the data generation mode is decreasing, it increments by 255, sequentially generating single-byte payload data for each test data, and then filling the payload field of the corresponding test data. Combining the characteristics of binary data, incrementing by 255 can effectively cause data overflow, thus achieving the effect of decreasing by 1 step. For example, an increment / decrement data generation logic is implemented through an 8-bit selector and adder. The generate for statement in the hardware description language (a statement used to implement repeated assignment and module instantiation) is used to efficiently generate the amount of data required for one clock cycle, meeting the needs of test data order changes in different test scenarios.
[0041] When the data generation mode is pseudo-random, a pseudo-random algorithm is used to generate single-byte payload data for each test data point, and this single-byte payload data is then used to fill the payload field of the corresponding test data. Specifically, when the single-byte payload data generated by the pseudo-random algorithm exceeds 8 bits, 8 bits are truncated from the least significant bit to obtain the final single-byte payload data. For example, the PRBS9 (Pseudo-Random Binary Sequence, a pseudo-random binary sequence of length 9) algorithm is used to generate pseudo-random numbers. The generator polynomial of the PRBS9 algorithm is 1+x. 5 +x 9 By using randomized test data, the performance of the link when handling complex data patterns can be tested, improving the flexibility of test data generation and thus enhancing the comprehensiveness of subsequent tests. A seed value can also be configured, and combined with the PRBS9 algorithm, other seed values are generated by adding a sequence number to the configured seed value, resulting in a repeatable random sequence. This balances the randomness and reproducibility of the test, ensuring that randomized tests are reproducible, facilitating fault tracing, and increasing the diversity of test data.
[0042] In one optional implementation, the message length includes a fixed length, which the user can preset to generate test data of that fixed length, in order to test the performance of the data link layer when processing data frames of a specific length.
[0043] In one optional implementation, the message length includes a random length. When generating test data, a preset maximum message length and a preset minimum message length are first obtained, which are preset by the user. Then, the preset maximum message length and the preset minimum message length are subtracted to obtain the message length difference. A random number is then generated using a pseudo-random algorithm. Next, the number of significant bits in the binary representation of the message length difference is calculated. Based on the number of significant bits in the binary representation of the message length difference, the random number is truncated to obtain a truncated value. When the truncated value is greater than the message length difference, the preset minimum message length is added to the random number, and then the message length difference is subtracted to obtain the message length. When the truncated value is less than the message length difference, the preset minimum message length is added to the random number to obtain the message length.
[0044] For example, the PRBS15 algorithm is used to generate pseudo-random numbers, with the generating polynomial being 1+x. 14 +x 15 The random number can take values from 1 to 32768 (2 15 -1), and take the lower 14 bits of the random number starting from the least significant bit as the final value range of the random number 1–16383. By performing a wrapping process on the random number within the range of the preset maximum message length and the preset minimum message length, a message length that meets the requirements is obtained, avoiding the waste of invalid data and improving computational efficiency.
[0045] For example, assuming the preset maximum message length is RAND_MAX, the preset minimum message length is RAND_MIN, the message length difference is RAND_DIFF, the random number is RAND_VALUE, and the message length is FRAME_LENGTH, then RAND_DIFF = RAND_MAX - RAND_MIN. Based on the valid bits of RAND_DIFF, the value of RAND_VALUE is truncated to RAND_VALUE_TRUN. The statement for wrapping is as follows: FRAME_LENGTH=(RAND_VALUE_TRUN>RAND_DIFF)? (RAND_MIN+RAND_VAULE-RAND_DIFF): (RAND_MIN+RAND_VAULE); In one optional implementation, the message sending quantity and message sending method are set. Users can preset the message sending quantity to a fixed number, sending this fixed amount of test data each time to obtain the fixed amount of test data. This facilitates precise test case control and result analysis, meets standard compliance testing requirements, and improves test accuracy. The message sending method can be continuous sending, such as continuously sending test data according to a preset cycle to simulate high network load conditions, thereby testing the performance of the data link layer under high load conditions and improving test comprehensiveness. Each test data can also be configured with a unique sequence number identifier, so that the continuity of the sequence number identifier can be used to determine the integrity of the test data transmission. This allows for accurate checking for packet loss in the link when acquiring test data, achieving zero-latency packet loss detection and improving test real-time performance.
[0046] Step S202: Based on the bandwidth of the multiple ports, schedule the test data to the multiple ports so that the test data is sent to the corresponding ports.
[0047] Specifically, step S202 includes: Step S2021: Based on the priority and bandwidth of the multiple ports, distribute the test data of the multiple ports to the sending end corresponding to the multiple media access control modules of the media access control layer.
[0048] Optionally, before distributing test data, a weighted differential round-robin (WDRR) scheduling algorithm is used to assign corresponding packet sending weights to each port based on its priority and bandwidth requirements at the data link layer. During data distribution, the distribution order of the test data is determined according to the priority and bandwidth of these ports, i.e., according to their packet sending weights. The test data from these ports is then distributed to the corresponding sending ends of the various media access control (MAC) modules at the media access control layer according to this order.
[0049] Step S2022: The test data of the sending end corresponding to the multiple media access control modules is classified according to the port number and distributed to the multiple media access control modules in the media access control layer, so that the multiple media access control modules can perform data loopback and loop back the test data to the receiving end corresponding to the multiple media access control modules to obtain the returned data.
[0050] Each of the multiple media access control modules has a corresponding port number. The sending end and receiving end of the media access control module are in one-to-one correspondence. Both the sending end and the receiving end contain the port number of the corresponding media access control module. Therefore, the test data at the sending end (TX) can be distributed to the corresponding media access control module according to the port number of the media access control module. Data loopback is performed inside the media access control module to loop the test data back to the receiving end (RX) of the corresponding media access control module to obtain the returned data.
[0051] Step S203: Receive the return data from the multiple ports based on the corresponding test data, and distribute the return data from the multiple ports to multiple verification modules according to the corresponding protocol type.
[0052] After the receiving end of the media access control module receives the returned data, it sends the returned data back. At this time, it needs to receive the returned data sent by the receiving ends of the multiple media access control modules.
[0053] Optionally, each of the multiple ports has a corresponding port number and protocol type, and each verification module has a corresponding protocol type. When distributing the returned data, the protocol type of the port can be determined according to the port number, and the returned data can be classified according to the port number, thereby distributing the returned data of the multiple ports to multiple verification modules.
[0054] Step S204: The second data frame generator of the verification module generates reference data corresponding to the distributed test data.
[0055] The protocol type and data generation parameters of the reference data are the same as those of the corresponding returned data.
[0056] Specifically, each verification module instantiates a corresponding second data frame generator. When the verification module receives the distributed return data, it uses the second data frame generator to generate reference data with the same protocol type and data generation parameters as the return data.
[0057] Step S205: Compare the test data with the reference data to obtain the first test result.
[0058] The verification module compares the received return data bit by bit with the reference data generated by its own second data frame generator to obtain the first test result. If the return data is completely consistent with the reference data, the first test result indicates that the return data is correct and the target under test has no problem; if the return data differs from the reference data, the first test result indicates that the return data is incorrect and the target under test has a problem. The error information, including the error location and error type, is recorded in detail for subsequent fault analysis and location.
[0059] Through the above steps S201 to S205, combined with the transmit / receive loopback function (MACTX loop RX function) of the media access control layer, test data is generated and the return data fed back by the target under test according to the test data is verified, so that the test data is looped back inside the data link layer without involving the external physical link, so as to eliminate the interference of external physical link factors, and to detect whether the function of the data link layer itself is normal, and obtain the first test result.
[0060] Optionally, the remote loopback function (MAC RX loopback TX function) of the media access control layer can be combined to loop the data from the RX (receiver) end directly back to the TX (transmitter) end at the entry side of the self-test module (which is the execution body used to execute steps S201 to S205), so as to quickly detect the connectivity and correctness of the internal transmission and reception paths of the data link layer and verify whether the data transmission in the link layer is normal.
[0061] The chip testing method provided in this embodiment configures the frame header of the test data according to the protocol type, generates the payload field of the test data according to the data generation mode and message length, and finally generates test data based on the frame header and payload field. The configurable frame header mechanism supports dynamic adaptation to any Layer 2 protocol, adapting to heterogeneous network environments without hardware refactoring, offering high flexibility. By selecting the data generation mode and message length, different test data can be generated specifically, increasing the diversity of test data for more comprehensive testing of the data link layer. This chip testing method can quickly detect the connectivity and correctness of the internal transmission and reception paths of the data link layer, verifying whether data transmission at the link layer is normal. Near-end loopback testing can eliminate interference from external physical link factors and detect whether the data link layer itself functions normally.
[0062] This embodiment provides a chip testing system applied to the data link layer. Figure 4 This is a schematic diagram of the structure of a chip testing system according to an embodiment of the present invention, such as... Figure 4 As shown, the system includes a data frame generation module, a scheduling module, a receiving module, a data distribution module, and a verification module.
[0063] The data frame generation module is used to generate test data corresponding to multiple ports of the target under test through a first data frame generator corresponding to multiple ports of the target under test. The test data is generated according to the protocol type and data generation parameters.
[0064] The scheduling module is used to schedule the test data to the multiple ports according to their bandwidth, so as to send the test data to the corresponding ports.
[0065] This receiving module is used to receive the return data from the multiple ports based on the corresponding test data.
[0066] This data distribution module is used to distribute the returned data from multiple ports to multiple verification modules according to the corresponding protocol type.
[0067] The verification module is used to generate reference data corresponding to the distributed return data through the second data frame generator. The protocol type and data generation parameters of the reference data are the same as those of the corresponding return data.
[0068] The verification module is also used to compare the returned data with the reference data to obtain the first test result.
[0069] For example, Figure 5 This is a data scheduling diagram according to an embodiment of the present invention. Figure 6 This is a schematic diagram of data distribution according to an embodiment of the present invention. The data frame generation module includes a first data frame generator (e.g., ...) corresponding to multiple ports. Figure 5 The data frame generators shown are 0 to N. Each first data frame generator generates test data for the corresponding port according to the protocol type and data generation parameters, and schedules the test data to various ports through the scheduling module. The media access control layer includes multiple media access control modules, each of which includes a sending end (such as...). Figure 5 (as shown in MAC_TX0 to MAC_TXN) and the receiving end (e.g. Figure 6 As shown in MAC_RX0 to MAC_RXN, the scheduling module distributes the test data of these ports to the target under test according to their priority and bandwidth. Specifically, the data is distributed to the sending end corresponding to each of the media access control modules in the media access control layer. Each sending end of one media access control module corresponds to a corresponding receiving end of the same module.
[0070] The data distribution module will distribute the returned data to multiple verification modules (such as...) according to the corresponding protocol type. Figure 6 As shown in the verification modules 0 to N), each verification module instantiates a corresponding second data frame generator (e.g., ...). Figure 6 The verification modules 0 to N (shown as data frame generators 0 to N) each generate reference data with the same protocol type and data generation parameters as the returned data they receive. Each verification module then compares the returned data it receives with its own generated reference data to obtain the first test result. Through the collaborative work of the data distribution module and the verification module, the returned data can be verified quickly and accurately, errors in the testing process can be detected in a timely manner, and the real-time performance of chip testing can be improved.
[0071] This scheduling module distributes test data to multiple media access control modules in the media access control layer (such as port number, bandwidth, and priority) based on the port number. Figure 4 As shown in MAC_0 to MAC_N). These multiple media access control modules are respectively connected to the various physical coding modules in the Physical Coding Sublayer (PCS) (such as...). Figure 4 As shown, PCS_0 to PCS_N are connected one-to-one. Each physical encoding module is also connected to the serializer / deserializer of the Physical Medium Sublayer (PMA). Figure 4 The SerDes (Serializer / Deserializer) connection is shown. Both the physical encoding sublayer and the physical media sublayer belong to the physical layer. The physical encoding sublayer implements data encoding / decoding functions, while the physical media sublayer implements data serialization / deserialization functions. The serializer / deserializer can merge multiple parallel data channels into a single serial data stream, and then restore the serial data stream back into multiple parallel data channels, achieving timing control between different signals, ensuring data integrity and accuracy, and ultimately transmitting the data to subsequent devices.
[0072] Optionally, when distributing test data, the scheduling module also employs a Weighted Differential Round Robin (WDRR) scheduling algorithm. Based on the priority and bandwidth requirements of each port at the data link layer, it assigns a corresponding packet sending weight to each port and determines the distribution order of the test data for each port according to these weights. By configuring the scheduling module and using the weighted differential round-robin scheduling algorithm, maximum line-rate packet transmission across multiple ports can be achieved, improving testing efficiency.
[0073] Optionally, the system also includes a control and management module for controlling and managing the working status of the data frame generation module, scheduling module, data distribution module, and verification module. For example, this control and management module is used to execute... Figure 1 Examples and Figure 2 The chip testing method shown in the embodiment.
[0074] Optionally, the system also includes a configuration register group for storing various configuration parameters of the chip, including frame header configuration information (corresponding to the protocol type), PAYLOAD generation mode selection (corresponding to the data generation mode), weight settings for each port by the scheduling module, maximum line-rate packet transmission mode settings (corresponding to the number of packets sent and the packet transmission method), and enabling or disabling the self-test mode (used to indicate whether to start the chip test system for verification). By storing various configuration parameters in the configuration register group, the chip's operating mode and performance can be flexibly adjusted through simple read and write operations, allowing users to customize settings according to actual needs, reducing the barrier to entry and management costs. In multi-protocol chips, users can easily switch protocol types and adjust protocol parameters for adaptation through the configuration register group, achieving convenient management of multi-protocol data link layer self-tests.
[0075] Optionally, the system also includes a status monitoring module for real-time monitoring of the chip's operating status, including the number of test data sent, the number of test data received, and error messages from the verification module. This status monitoring module includes monitoring circuitry and software monitoring algorithms, continuously tracking various preset key indicators of the chip during its self-test process. It then feeds back the corresponding status information to external devices or systems via a specific communication interface, enabling these devices or systems to promptly obtain the chip's operating status for fault diagnosis and maintenance. By providing real-time feedback on the chip's operating status through the status monitoring module, combined with various loopback test modes, the system can comprehensively detect the functions of the data link layer and related physical layers, accurately diagnose and locate faults, and provide strong support for equipment maintenance and repair. In multi-protocol environments, it can also perform fault diagnosis for different protocol links separately, quickly locating protocol compatibility issues and link failure points. Figure 7 This is a schematic diagram of a loopback test according to an embodiment of the present invention. It should be noted that this chip testing system is... Figure 7 The self-testing module (also known as the maximum line speed and self-testing module) includes a data frame generation module group, a scheduling module, a data distribution module, a data verification module group, a control and management module, etc. Figure 7 The serial number 1 corresponds to the remote loopback function of the MAC, which is used to connect to an external tester for testing. It quickly detects the connectivity and correctness of the internal sending and receiving paths of the data link layer and verifies whether the data transmission at the link layer is normal. Figure 7 The sequence number 2 corresponds to the MAC send / receive loopback function. Combined with the above self-testing module, it generates and verifies test data to check whether there are any functional problems in the data link layer implementation. Figure 7Number 3 in the code corresponds to the PCS near-end loopback test function, which uses a self-testing module to perform functional tests on the data link layer and the PCS, comprehensively testing the collaborative work between the data link layer and the PCS layer, as well as the completeness of their respective functions. Figure 7 Numbers 4 and 5 correspond to two loopback functions. Number 4 corresponds to the MDI (Medium Dependent Interface, the interface between the PMD layer and the physical medium) interface loopback function, which uses a self-testing module to perform physical link connectivity testing. Data loops back at the MDI interface to check if the physical link connection is normal. Number 5 corresponds to the remote loopback function combined with the peer chip. By cooperating with the peer device, data is sent to the peer and then looped back, further verifying the connectivity and stability of the entire physical link. The PMD layer is the Physical Medium Dependent sublayer.
[0076] This embodiment also provides a chip testing apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0077] This embodiment provides a chip testing device applied to the data link layer, such as... Figure 8 As shown, the device includes: The first data acquisition module 801 is used to generate test data corresponding to multiple ports of the target under test; the test data is generated by the first data frame generator corresponding to the port according to the protocol type and data generation parameters. The scheduling module 802 is used to schedule the test data to the multiple ports according to the bandwidth of the multiple ports, so as to send the test data to the corresponding port; The distribution module 803 is used to receive the return data from the multiple ports based on the corresponding test data, and distribute the return data from the multiple ports to multiple verification modules according to the corresponding protocol type. The second data acquisition module 804 is used to generate reference data corresponding to the distributed return data through the second data frame generator of the verification module; the protocol type and data generation parameters of the reference data are the same as those of the corresponding return data. The comparison module 805 is used to compare the returned data with the reference data to obtain the first test result.
[0078] In one optional implementation, the data generation parameters include a data generation mode and a message length; the first data acquisition module is further configured to: acquire the protocol type, the data generation mode, and the message length; configure the frame header of the test data according to the protocol type; generate the payload field of the test data according to the data generation mode and the message length; and generate the test data based on the frame header and the payload field.
[0079] In one optional implementation, the data generation mode includes an incrementing mode, a decrementing mode, and a pseudo-random mode; the first data acquisition module is further configured to: when the data generation mode is an incrementing mode, generate single-byte payload data corresponding to each test data in increments of 1, and fill the payload field of the corresponding test data with the single-byte payload data; when the data generation mode is a decrementing mode, generate single-byte payload data corresponding to each test data in increments of 255, and fill the payload field of the corresponding test data with the single-byte payload data; when the data generation mode is a pseudo-random mode, generate single-byte payload data corresponding to each test data using a pseudo-random algorithm, and fill the payload field of the corresponding test data with the single-byte payload data.
[0080] In one optional implementation, the message length includes a random length; the first data acquisition module is further configured to: acquire a preset maximum message length and a preset minimum message length; subtract the preset maximum message length and the preset minimum message length to obtain a message length difference; generate a random number using a pseudo-random algorithm; calculate the number of significant bits in the binary representation of the message length difference; truncate the random number based on the number of significant bits in the binary representation of the message length difference to obtain a truncated random number value; when the truncated random number value is greater than the message length difference, add the preset minimum message length to the random number and subtract the message length difference to obtain the message length; when the truncated random number value is less than the message length difference, add the preset minimum message length to the random number to obtain the message length.
[0081] In an optional implementation, the scheduling module is further configured to: distribute the test data of the multiple ports to the sending ends corresponding to the multiple media access control modules of the media access control layer according to the priority and bandwidth of the multiple ports; classify the test data of the sending ends corresponding to the multiple media access control modules according to the port number and distribute it to the multiple media access control modules of the media access control layer so that the multiple media access control modules can perform data loopback and loop the test data back to the receiving ends corresponding to the multiple media access control modules to obtain return data; This distribution module is also used for: Receive the return data sent by the receiving end corresponding to the multiple media access control modules.
[0082] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0083] In this embodiment, the chip testing device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0084] This invention also provides a computer device having the above-described features. Figure 8 The chip testing device shown.
[0085] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 9 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 9 Take a processor 10 as an example.
[0086] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0087] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0088] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0089] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0090] The computer device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30, and output device 40 can be connected via a bus or other means. Figure 9 Taking the example of a connection between China and Israel via a bus.
[0091] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the computer device, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touchscreen.
[0092] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0093] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0094] Although embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and all such modifications and variations fall within the protection scope of the present invention.
Claims
1. A chip testing method, characterized in that, Applied to the data link layer, the method includes: Test data is generated corresponding to multiple ports of the target under test; the test data is generated by the first data frame generator corresponding to the port according to the protocol type and data generation parameters; wherein, the target under test is the target chip to be tested; each port corresponds to one first data frame generator; Based on the bandwidth of the multiple ports, the test data is scheduled to the multiple ports to send the test data to the corresponding ports; Receive the return data from the multiple ports based on the corresponding test data, and distribute the return data from the multiple ports to multiple verification modules according to the corresponding protocol type; The second data frame generator of the verification module generates reference data corresponding to the distributed return data; the protocol type and data generation parameters of the reference data are the same as those of the corresponding return data. The returned data is compared with the reference data to obtain the first test result; The step of scheduling the test data to the multiple ports based on their bandwidth, so as to send the test data to the corresponding ports, includes: Based on the priority and bandwidth of the multiple ports, the test data of the multiple ports are scheduled to the sending end corresponding to the multiple media access control modules of the media access control layer; The test data from the sending end corresponding to the multiple media access control modules is classified according to the port number and scheduled to multiple media access control modules in the media access control layer, so that the multiple media access control modules can perform data loopback and loop back the test data to the receiving end corresponding to the multiple media access control modules to obtain the returned data. The receiving of return data from the multiple ports based on corresponding test data includes: Receive return data sent by the receiving end corresponding to the multiple media access control modules.
2. The method according to claim 1, characterized in that, The data generation parameters include the data generation mode and the message length; the method further includes: Get the protocol type, data generation mode, and message length; Configure the frame header of the test data according to the protocol type; Generate the payload field of the test data based on the data generation mode and message length; Test data is generated based on the frame header and the payload field.
3. The method according to claim 2, characterized in that, The data generation patterns include an increasing pattern, a decreasing pattern, and a pseudo-random pattern; the method further includes: When the data generation mode is incremental mode, the effective payload single-byte data corresponding to each test data is generated in increments of 1, and the effective payload single-byte data is used to fill the effective payload field of the corresponding test data. When the data generation mode is decreasing mode, the effective payload single-byte data corresponding to each test data is generated in increments of 255, and the effective payload single-byte data is used to fill the effective payload field of the corresponding test data. When the data generation mode is pseudo-random mode, the payload single-byte data corresponding to each test data is generated by the pseudo-random algorithm, and the payload field of the corresponding test data is filled by the payload single-byte data.
4. The method according to claim 2, characterized in that, The message length includes a random length; the method further includes: Get the preset maximum message length and preset minimum message length; Subtract the preset maximum message length from the preset minimum message length to obtain the message length difference; Random numbers are generated using a pseudo-random algorithm; Calculate the number of significant binary bits in the message length difference; Based on the number of significant binary bits of the message length difference, the random number is truncated to obtain the truncated random number value; When the truncated value of the random number is greater than the message length difference, the preset minimum message length is added to the random number and then the message length difference is subtracted to obtain the message length. When the truncated value of the random number is less than the difference in message length, the preset minimum message length is added to the random number to obtain the message length.
5. A chip testing system, characterized in that, The system, applied at the data link layer, includes: The data frame generation module includes a first data frame generator corresponding to multiple ports of the target under test, used to generate test data for the corresponding port through each first data frame generator; the test data is generated according to the protocol type and data generation parameters; wherein, the target under test is the target chip to be tested; each port corresponds to one first data frame generator; The scheduling module is used to schedule the test data to the multiple ports according to their bandwidth, so as to send the test data to the corresponding ports; wherein, according to the priority and bandwidth of the multiple ports, the test data of the multiple ports are scheduled to the sending end corresponding to the multiple media access control modules of the media access control layer; the test data of the sending end corresponding to the multiple media access control modules are classified according to the port number and scheduled to the multiple media access control modules of the media access control layer, so that the multiple media access control modules can perform data loopback, and loop back the test data to the receiving end corresponding to the multiple media access control modules to obtain return data; The data distribution module is used to receive the return data from the multiple ports based on the corresponding test data, and distribute the return data from the multiple ports to multiple verification modules according to the corresponding protocol type; wherein, the return data is the return data sent by the receiving end corresponding to the multiple media access control modules; Multiple verification modules are provided, each of which instantiates a corresponding second data frame generator to generate reference data corresponding to the distributed return data; the protocol type and data generation parameters of the reference data are the same as those of the corresponding return data. The verification module is also used to compare the returned data with the reference data to obtain a first test result.
6. A computer device, characterized in that, include: A memory and a processor are interconnected, the memory stores computer instructions, and the processor executes the computer instructions to perform the chip testing method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the chip testing method according to any one of claims 1 to 4.
8. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the chip testing method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Testing method and device for physical layer chip of switch and electronic equipment
CN115766526A
Method and system for realizing testability of high-speed network switching chip
CN120281691A
