Equipment testing method and device, terminal equipment and storage medium
The method enhances PCIE device testing by using the bridge control register to reset and test PCIE devices quickly, improving efficiency and accuracy through rapid resets and multiple tests.
Patent Information
- Application Number
- CN202311280118.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2024-12-27
Smart Images

Figure CN119201558A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of testing technology, and in particular, relates to a device testing method, apparatus, terminal device, and computer-readable storage medium. Background Art
[0002] A high-speed serial computer expansion bus (Peripheral Component Interconnect Express, PCIE) device is a device used to expand the data throughput of a computer system bus and improve the communication speed of devices. Due to factors such as the signal driving capability of the PCIE device's own controller, the packaging process, the signal routing on the printed circuit board, and even the difference in the printed circuit board dielectric material, the compatibility, stability and other performance of the final PCIE device may be affected, thereby affecting the actual application effect of the PCIE device.
[0003] Currently, performance tests are usually performed on PCIE devices by manufacturers, but during the test process, manual control of the power on / off or restart of the PCIE is usually required, which takes a long time and requires high labor costs. Summary of the invention
[0004] The embodiments of the present application provide a device testing method, apparatus, terminal device and storage medium, which can improve the efficiency and accuracy of device testing.
[0005] In a first aspect, an embodiment of the present application provides a device testing method, comprising:
[0006] Trigger a reset operation through the bridge control register of the device under test , and starting to test the device under test after the reset operation is triggered;
[0007] Determining whether the device under test completes the test;
[0008] When it is determined that the device under test has completed the test, the device under test is allowed to enter the next round of the test until the number of times the device under test completes the test meets a preset requirement, thereby obtaining a test result of the device under test.
[0009] In a possible implementation manner of the first aspect, triggering a reset operation through a bridge control register of the device under test includes:
[0010] The control parameters in the bridge control register of the device under test are modified, and the modified control parameters are used to indicate triggering the reset operation to trigger the reset operation.
[0011] In another possible implementation manner of the first aspect, before triggering the reset operation through the bridge control register of the device under test, the method further includes:
[0012] Determine whether the device identifier corresponding to the device to be tested is the same as a preset identifier in the currently selected test parameter, wherein the preset identifier is a preset device identifier of the device to be tested;
[0013] Correspondingly, triggering a reset operation through a bridge control register of the device under test includes:
[0014] When it is determined that the device identification of the device under test is the same as the preset identification, the reset operation is triggered by the bridge control register of the device under test.
[0015] In another possible implementation manner of the first aspect, the preset identifier includes one or more identifiers of a device serial number, a bus number, a device number, and a function number, and the determining whether the device identifier corresponding to the device under test is the same as the preset identifier in the currently selected test parameter includes:
[0016] Determine whether the identifier included in the device identifier corresponding to the device under test is the same as the identifier corresponding to the preset identifier;
[0017] In the case that the identifier included in the device identifier is identical to the identifier corresponding to the preset identifier, it is determined that the device identifier is identical to the preset identifier.
[0018] In another possible implementation manner of the first aspect, before triggering the reset operation through the bridge control register of the device under test, the method further includes:
[0019] In the case where it is determined that the device identifier is not the same as the preset identifier in the currently selected test parameter, querying whether there is a target identifier, the target identifier being a preset device identifier that is the same as the device identifier;
[0020] When the target identifier is found, the currently selected test parameter is switched to a test parameter corresponding to the target identifier.
[0021] In another possible implementation manner of the first aspect, the test includes link retraining, and the determining whether the device under test completes the test includes:
[0022] Whether the device under test has completed the link retraining is determined according to the value of the link status register of the device under test, and the flag bit in the link status register is used to indicate the training status of the link retraining of the device under test.
[0023] In another possible implementation manner of the first aspect, the reset operation is used to reset a link control register of the device under test, the link control register is used to indicate whether to perform the link retraining on the device under test, and the determining, according to a value of a link status register of the device under test, whether the device under test completes the link retraining includes:
[0024] Performing status monitoring on the device under test based on the value of the link status register of the device under test;
[0025] In the case where it is monitored that the device under test has started the link retraining, a link control register of the device under test is set, wherein the set link control register indicates that the link retraining is not performed on the device under test.
[0026] In a second aspect, an embodiment of the present application provides a device testing apparatus, comprising:
[0027] Reset test module, used to trigger the reset operation through the bridge control register of the device under test , and starting to test the device under test after the reset operation is triggered, wherein the reset operation is used to reset the device under test;
[0028] A judging module, used to judge whether the device under test has completed the test;
[0029] The cyclic testing module is used to make the device under test enter the next round of the test when it is determined that the device under test has completed the test, until the number of times the device under test completes the test meets the preset requirement, thereby obtaining the test result of the device under test.
[0030] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the device testing method described in the first aspect when executing the computer program.
[0031] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the device testing method described in the first aspect are implemented.
[0032] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the device testing method described in any one of the above-mentioned first aspects.
[0033] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0034] In the embodiment of the present application, a reset operation is triggered by a bridge control register of the device to reset the device under test, and after the reset operation is triggered, the test of the device under test begins. When the bridge control register triggers the reset operation, it can trigger the reset of the device under test within milliseconds, that is, trigger the reset operation of the device under test in a very short time, so that the device under test can be tested once in a short time. Furthermore, in the process of repeatedly performing a large number of tests on the device under test, the device under test can be controlled to be tested quickly, so that multiple tests of the device under test can be completed in a short time, thereby improving the accuracy of the final test results while improving the equipment testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0036] Figure 1 It is a flowchart of a device testing method provided by an embodiment of the present application;
[0037] Figure 2 is a schematic diagram of the structure of the equipment testing device provided in an embodiment of the present application;
[0038] Figure 3 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0040] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0041] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0042] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
[0043] Embodiment 1:
[0044] Figure 1 A schematic diagram of a device testing method provided by an embodiment of the present invention is shown, and is described in detail as follows:
[0045] Step S101, triggering a reset operation through the bridge control register of the device under test , And after the reset operation is triggered, the test of the device under test begins.
[0046] The above reset operation is used to reset the above device under test.
[0047] The device under test is a device currently waiting to be tested. The device under test may be a bus device, such as a high-speed serial computer expansion bus (peripheral component interconnect express, PCIE) device.
[0048] Specifically, when the device under test needs to be tested, the reset operation of the device under test is triggered through the bridge control register of the device under test, and the device under test is reset through the reset operation. Since the bridge control register can trigger the reset operation of the device under test within milliseconds, it can be considered that the reset of the device under test is achieved after the reset operation is triggered. Therefore, the device under test can be tested after the reset operation is triggered, so as to improve the test efficiency of the device.
[0049] Optionally, when the device to be tested begins to be tested, the device to be tested is tested according to preset test parameters. The above test may be a functional test or a performance test of the device, such as a stability test, a robustness test, and the like.
[0050] In the embodiment of the present application, since the bridge control register can trigger the reset operation of the device under test within milliseconds, that is, the reset of the device under test can be achieved in a very short time through the bridge control register, therefore, by triggering the reset operation of the device under test through the bridge control register of the device under test, the device under test can be tested after the reset operation is triggered, so as to improve the efficiency of device testing.
[0051] Step S102, determining whether the device under test has completed the test.
[0052] Optionally, when judging whether the device under test has completed the test, the real-time status of the device under test can be obtained after a preset time interval (such as 5 seconds), and whether the device under test has completed the test can be judged according to the real-time status of the device under test. Among them, the above-mentioned preset time interval can be determined according to the test items of the device under test (such as power on and off test, link retraining test and network speed test, etc.). For example, assuming that it is necessary to perform a power on and off test on the device under test, 30 seconds after the device under test starts the test, the current status of the device under test is obtained. If the device under test is currently in the power on state, it can be considered that the device under test has completed the test. For another example, assuming that it is necessary to perform a link retraining test on the device under test, and the time required for a link retraining is usually tens of milliseconds, at this time, the preset time interval corresponding to the link retraining test can be set to 10 milliseconds, so as to timely understand the test completion status of the device under test.
[0053] Optionally, in order to more accurately determine whether the device under test has been tested and completed, after the device under test starts testing, a first state corresponding to the device under test can be obtained after a first preset time interval (such as 0.5 seconds), and a second state corresponding to the device under test can be obtained after a second preset time interval (such as 5 seconds). Whether the device under test has completed the test can be comprehensively determined based on the first state and the second state, thereby improving the accuracy of the determination. It is understandable that the first time interval is less than the above-mentioned preset time interval, and the second time interval is equivalent to the above-mentioned preset time interval.
[0054] In the embodiment of the present application, it is determined whether the device under test has completed the test, so that when it is detected that the device under test has completed the test, the next round of testing is performed on the device under test or the test is ended in time, thereby improving the equipment testing efficiency.
[0055] Step S103, when it is determined that the device under test has completed the test, the device under test is allowed to enter the next round of the test until the number of times the device under test completes the test meets a preset requirement, thereby obtaining a test result of the device under test.
[0056] Specifically, in order to improve the accuracy of the test results, the device under test can be repeatedly tested multiple times, and the final test results of the device under test can be determined based on the results of the multiple tests. That is, when it is determined that the device under test has completed the current round of testing, the device is allowed to enter the next round of testing until the number of times the device under test completes the test meets the preset requirements (such as 100 times), then the test of the device under test can be stopped to obtain the corresponding test results. It can be understood that in multiple rounds of testing of the device under test, the same test is performed on the device under test (such as stability tests), and the impact of randomness is reduced by repeating multiple tests. In addition, for performance tests such as stability, the results of a single or a small number of tests cannot accurately represent the stability of the device. Therefore, the number of times the device under test completes the test meets the preset requirements to improve the accuracy of the final test results.
[0057] In an embodiment of the present application, a reset operation of the device under test is triggered through a bridge control register of the device, the device under test is reset, and after the reset operation is triggered, the device under test is started to be tested, and the bridge control register can trigger the reset operation of the device under test within milliseconds, that is, the device under test can be reset in a very short time through the bridge control register, so that the device under test can be tested once in a very short time, and further, in the process of repeatedly performing a large number of tests on the device under test, the device under test can be controlled to be tested quickly, and in the test of the device under test, the device under test is repeatedly tested for multiple times until the number of completed tests reaches a preset requirement, thereby reducing the impact of randomness through multiple tests, and improving the accuracy of the final test results while improving the efficiency of device testing.
[0058] In some embodiments, before the above step S101, the method further includes:
[0059] It is determined whether the device identification corresponding to the device to be tested is the same as the preset identification in the currently selected test parameter, where the preset identification is the preset device identification of the device to be tested.
[0060] Correspondingly, the above step S101 includes:
[0061] When it is determined that the device identification of the device under test is the same as the preset identification, the reset operation is triggered by the bridge control register of the device under test.
[0062] Specifically, before the device is tested, one or more test parameters can be pre-set, and one of the test parameters can be selected as the test parameter of the device, so as to test the device according to the currently selected test parameter. The test parameters include the device identification of the device, the test items (such as link retraining test, power on / off test) and the parameter configuration corresponding to the test items (such as when the test item is a link retraining test, its parameter configuration can include the number of training times), etc., that is, the test parameters can indicate the corresponding device to be tested and the test items to be performed by the device to be tested, the parameter configuration of the test items, etc.
[0063] For ease of distinction, in the embodiment of the present application, the device identifier of the pre-set test parameter is referred to as a preset identifier. In this case, the above-mentioned test parameter includes the preset identifier.
[0064] Before testing the device under test, first determine whether the device identification of the device under test is the same as the preset identification in the currently selected test parameters. If it is determined that the device identification of the device under test is the same as the preset identification in the currently selected test parameters, it means that the device under test currently prepared for testing is the same as the preset device under test, and the currently selected device under test can be tested according to the test parameters, that is, when it is determined that the device identification of the device under test is the same as the preset identification, the reset operation of the device under test is triggered through the bridge control register of the device under test, so that after the reset operation is triggered, the device under test is started to be tested.
[0065] In some embodiments, when it is determined that the device identification of the device under test is different from the preset identification in the currently selected test parameters, the device under test currently being prepared for testing can be replaced, that is, a new device is obtained as the device under test, and it is determined whether the device identification of the new device under test is the same as the preset identification in the test parameters. Of course, it is also possible to search from other pre-stored test parameters to see whether there is a preset identification that is the same as the device identification of the current device under test. If there is a preset identification (i.e., a target identification) that is the same as the device identification in other pre-stored test parameters, it means that there are test parameters corresponding to the device under test in the pre-stored test parameters, and the currently selected test parameters can be replaced with test parameters corresponding to the target identification, and the device under test can be tested according to the replaced test parameters.
[0066] It can be understood that there can be multiple pre-set test parameters. Before testing a device, a test parameter can be selected from the pre-set test parameters based on the device type of the device to be tested. During the testing of devices of this device type, a device is obtained as the device to be tested, and then the device to be tested is tested based on the currently selected test parameters.
[0067] For example, assuming that three test parameters are pre-set: test parameter A, test parameter B, and test parameter C, and assuming that the PCIE device produced by the production line needs to be tested, before starting to test the PCIE device, the test parameter B corresponding to the PCIE device is selected as the test parameter used in the test process according to the PCIE device to be tested. During the test process, a device is obtained from the production line and used as a device to be tested. Before testing the device to be tested, it is determined whether the device identification of the device to be tested is the same as the preset identification in the currently selected test parameter B, that is, whether the device to be tested is a PCIE device is determined based on the device identification of the device to be tested and the preset identification in the test parameter B.
[0068] In an embodiment of the present application, before triggering the reset operation of the device under test and testing the device under test, it is first determined whether the device under test is the correct device to be tested based on the device identification of the device under test and the preset identification in the corresponding test parameters, so as to ensure that the correct device under test can be tested according to the test parameters, thereby improving the reliability of the test.
[0069] In some embodiments, the preset identifier includes one or more identifiers of a device serial number, a bus number, a device number, and a function number. Before the above step S101, the following is further included:
[0070] Determine whether the identifier included in the device identifier corresponding to the device under test is the same as the identifier corresponding to the preset identifier.
[0071] In the case that the identifier included in the device identifier is identical to the identifier corresponding to the preset identifier, it is determined that the device identifier is identical to the preset identifier.
[0072] Specifically, the above-mentioned device to be tested may be a PCIE device, and the above-mentioned preset identifier may include one or more identifiers such as a device serial number, a bus number, a device number and a function number of the PCIE device. When judging the device identifier of the device to be tested, it is judged whether the identifier contained in the device identifier and the corresponding identifier in the preset identifier are the same identifier. When it is determined that the various identifiers contained in the device identifier of the device to be tested are the same as the various identifiers corresponding to the preset identifier, it is determined that the device identifier is the same as the preset identifier, that is, only when the identifier contained in the device identifier is the same as the corresponding identifier in the preset identifier, it is determined that the device to be tested is a correct device and can be tested, thereby further ensuring that the correct device to be tested can be tested based on the correct test parameters, thereby ensuring the reliability of the test.
[0073] In some embodiments, in order to further ensure the reliability of the test, the device identification and the preset identification of the device under test include at least one identification that can uniquely indicate the corresponding device (such as a device serial number).
[0074] For example, assuming that the device identification of the device under test includes a bus number (assuming it is 2901) and a device number (assuming it is A003), and assuming that the preset identification in the test parameter includes a device serial number (assuming it is 202102), a bus number (assuming it is 2900), a device number (assuming it is A003) and a function number (assuming it is PC), then when judging based on the device identification and the preset identification, the bus number in the device identification is different from the bus number in the preset identification, and the device number in the device identification is the same as the device number in the preset identification, that is, the device identification and the preset identification are not exactly the same. At this time, it is judged that the device identification of the device under test is different from the preset identification, and the device under test is not the device corresponding to the preset test parameter, that is, the device under test is not the correct device to be tested.
[0075] In the embodiment of the present application, the device identification of the device to be tested is determined to be the same as the preset identification only when all the identifications contained in the device identification of the device to be tested are the same as the corresponding identifications in the preset identification, so as to ensure that the device under test is the correct device corresponding to the preset identification, so that when testing, the corresponding test parameters can be used to test the device to be tested based on the correct device to be tested, thereby improving the reliability of the device testing.
[0076] In some embodiments, before the above step S101, the method further includes:
[0077] When it is determined that the device identifier is different from the preset identifier in the currently selected test parameter, it is queried whether there is a target identifier based on the pre-stored test parameters, and the target identifier is a preset device identifier that is the same as the device identifier.
[0078] When the target identifier is found, the currently selected test parameter is switched to a test parameter corresponding to the target identifier.
[0079] Specifically, in order to improve the testing efficiency of the equipment, when it is determined that the above-mentioned device identifier is different from the above-mentioned preset identifier in the currently selected test parameters, it can be queried whether there is a device identifier identical to the device identifier in the stored test parameters based on other pre-stored test parameters. If there is a device identifier identical to the device identifier in other pre-stored test parameters, it is determined that there is a target identifier, and the device identifier identical to the device identifier of the device to be tested is used as the target identifier, and the test parameter corresponding to the target identifier (that is, the target test parameter) is selected as the test parameter for the device test, that is, the currently selected test parameter is switched to the target test parameter, and the device to be tested is tested according to the target test parameter.
[0080] In an embodiment of the present application, when it is determined that the above-mentioned device identifier is different from the above-mentioned preset identifier in the above-mentioned test parameters currently selected, it is queried based on the pre-stored test parameters whether there is a device identifier that is the same as the above-mentioned device identifier, so as to determine whether there is a correct test parameter corresponding to the device under test, that is, the target test parameter. When the target test parameter exists, the current test parameter is switched to the target test parameter to test the device under test without replacing the device under test. At the same time, the test of the device under test can be realized, thereby improving the equipment testing efficiency.
[0081] In some embodiments, the above step S101 includes:
[0082] The control parameters in the bridge control register of the device under test are modified, and the modified control parameters are used to indicate triggering the reset operation.
[0083] Specifically, when the reset operation of the device under test is triggered by the bridge control register of the device under test, the control parameter in the bridge control register of the device under test can be modified, that is, the control parameter in the bridge control register is modified to a target value, and the control parameter after being modified to the target value is used to indicate triggering the reset operation of the device under test. It can be understood that when the value of the control parameter in the bridge control register is not the target value, the control parameter indicates that the reset operation of the device under test does not need to be triggered.
[0084] In some embodiments, the device under test may be a PCIE device, and the control parameter of the bridge control register may be a second bus reset flag bit Secondary Bus Reset in the bridge control register. When a reset operation needs to be triggered, the second bus reset flag bit in the bridge control register is modified to a target value (such as 1), thereby triggering a reset operation of the device under test. The reset operation of the device under test will initialize the device under test to a default state, thereby enabling the device under test to be tested based on the default state after the device under test is initialized.
[0085] For example, assuming that the default value of the second bus reset flag bit of the bridge control register is 0, when the value of the second bus reset flag bit is 1, it indicates that the reset operation of the device under test is triggered (that is, the target value of the control parameter is 1). When the reset operation of the device under test needs to be triggered, the value of the second bus reset flag bit of the bridge control register is modified from the default value 0 to the target value 1, thereby instructing the device under test to trigger its reset operation.
[0086] Optionally, since it is necessary to perform repeated tests on the device under test, in order to improve the test efficiency of the device under test, the above-mentioned reset operation can be a hot reset operation. The hot reset operation refers to resetting the device under test when the device under test is already powered on. That is, after the device completes a test, it does not need to be powered off and restarted. The hot reset operation of the device under test can be triggered to initialize it to the default state when it is powered on, without the need to power off and restart the device under test, thereby reducing unnecessary processes and testing time.
[0087] In the embodiment of the present application, since the time required for modifying the second bus reset flag in the bridge control register and triggering the reset operation of the device under test through the modification is in the millimeter level, that is, the reset operation of the device under test can be triggered in a very short time, and the test of the device under test can be started, thereby improving the test efficiency of the device under test, and further, can greatly improve the test efficiency of the test scenario that requires repeated multiple tests on the device under test.
[0088] In some embodiments, the test includes link retraining, and step S102 includes:
[0089] Whether the device under test has completed the link retraining is determined according to the value of the link status register of the device under test, wherein the link status register is used to indicate the training status of the link retraining of the device under test.
[0090] Specifically, since bus devices such as PCIE and CXL (Compute Express Link) require that the devices at both ends of the link need to understand the topology of the other end in order to better communicate data, and the stability of the link will have a greater impact on its data communication, therefore, in an embodiment of the present application, a link retraining test can be performed on the device under test, and the link stability of the device under test can be tested by performing a link retraining test on the device under test.
[0091] Since the value in the link status register of the device under test can indicate the training status of the link retraining of the device under test, when the training status of the link retraining of the device under test (such as in training or a specific training step currently in progress, etc.) changes, the value of the link status register will be updated in real time according to the current training status. Therefore, during the link retraining test of the device under test, the training status of the device under test can be monitored in real time according to the value in the link status register of the device under test to determine whether the link retraining of the device under test has been completed. In this way, when the device under test has completed the link retraining, it can be determined in time whether it is necessary to make the device under test enter the next round of link retraining, so as to improve the testing efficiency of the device under test.
[0092] Optionally, the value of the link status register may be a value indicating a specific state of link training of the device under test, such as training step A, training step B, etc., or may be a value such as 0, 1, and 2 representing states such as untrained, training, and training completed, respectively.
[0093] In an embodiment of the present application, during the link retraining process of the device under test, the training status of the device under test is monitored based on the value in its link status register, so that when the device under test completes the test, it is promptly determined whether it is necessary for the device under test to enter the next round of link retraining, thereby reducing unnecessary waiting time and improving the test efficiency of the device under test.
[0094] In some embodiments, the reset operation is used to reset the link control register of the device under test, the link control register is used to indicate whether to perform the link retraining on the device under test, and the step of judging whether the device under test has completed the link retraining according to the value in the link status register of the device under test includes:
[0095] The status of the device under test is monitored based on the value of the link status register of the device under test.
[0096] In the case where it is monitored that the device under test has started the link retraining, a link control register of the device under test is set, wherein the set link control register indicates not to perform the link retraining on the device under test.
[0097] Specifically, since the link control register of the device under test can indicate whether link retraining is required for the device under test, before the link retraining test is performed on the device under test, a reset operation can be triggered through the bridge control register of the device under test. The reset operation can reset the link control register of the device under test, that is, by triggering the reset operation, the value in the link control register of the device under test is restored to a specified value (such as a value of 1), and the specified value is used to indicate that link retraining is required for the device under test, so that the link retraining test of the device under test can be started after the reset operation is triggered.
[0098] After starting link retraining for the device under test, the status of the device under test can be monitored based on the value in the link status register of the device under test. When it is detected that the device under test has started link retraining, the link control register of the device under test can be set so that the set link control register indicates that link retraining should not be performed for the device under test.
[0099] It can be understood that after the reset operation is triggered, the value of the link status register of the device under test is the specified value, indicating that the link retraining of the device under test is required. When it is monitored that the device under test has started link retraining, the value of the link control register is still the specified value. Therefore, it is necessary to set the value of the link control register to indicate that link retraining is not to be performed on the device under test, so as to avoid directly repeating the link retraining and affecting the test results.
[0100] In an embodiment of the present application, when it is monitored that the device under test has started link retraining, the value of the link control register is set to change the information indicated by the link control register from requiring link retraining for the device under test to not requiring link retraining for the device under test, so as to avoid directly starting the next round of link retraining according to the indication of the link control register after the current round of link retraining test ends, thereby ensuring the reliability of the test of the device under test.
[0101] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0102] Embodiment 2:
[0103] Corresponding to the device testing method described in the above embodiment, Figure 2 A structural block diagram of a device testing apparatus provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0104] Reference Figure 2 The device includes: a reset test module 21, a judgment module 22 and a cycle test module 23.
[0105] Reset test module 21, used to trigger the reset operation through the bridge control register of the device under test , And after the reset operation is triggered, the test of the device under test begins.
[0106] The judging module 22 is used to judge whether the device under test has completed the test.
[0107] The cyclic testing module 23 is used to make the device under test enter the next round of the test when it is determined that the device under test has completed the test, until the number of times the device under test completes the test meets a preset requirement, thereby obtaining the test result of the device under test.
[0108] In an embodiment of the present application, a reset operation of the device under test is triggered through a bridge control register of the device, the device under test is reset, and after the reset operation is triggered, the device under test is started to be tested, and the bridge control register can trigger the reset operation of the device under test within milliseconds, that is, the device under test can be reset in a very short time through the bridge control register, so that the device under test can be tested once in a very short time, and further, in the process of repeatedly performing a large number of tests on the device under test, the device under test can be controlled to be tested quickly, and in the test of the device under test, the device under test is repeatedly tested for multiple times until the number of completed tests reaches a preset requirement, thereby reducing the impact of randomness through multiple tests, and improving the accuracy of the final test results while improving the efficiency of device testing.
[0109] In some embodiments, the reset test module 21 includes:
[0110] The parameter modification unit is used to modify the control parameters in the bridge control register of the device under test, and the modified control parameters are used to indicate triggering the reset operation.
[0111] In some embodiments, the device testing apparatus further comprises:
[0112] The identification judgment module is used to judge whether the device identification corresponding to the device to be tested is the same as the preset identification in the currently selected test parameters, and the preset identification is the preset device identification of the device to be tested.
[0113] The reset module is used to trigger the reset operation through the bridge control register of the device under test when it is determined that the device identification of the device under test is the same as the preset identification.
[0114] In some embodiments, the device testing apparatus further comprises:
[0115] The preset identification judgment module is used to determine whether the identification included in the device identification corresponding to the device to be tested is the same as the identification corresponding to the preset identification.
[0116] The judgment result determination module is used to determine that the device identification is the same as the preset identification when the identification included in the device identification is the same as the identification corresponding to the preset identification.
[0117] In some embodiments, the device testing apparatus further comprises:
[0118] The target identifier query module is used to query whether there is a target identifier when it is determined that the above-mentioned device identifier is different from the above-mentioned preset identifier in the currently selected test parameter, and the above-mentioned target identifier is a preset device identifier that is the same as the above-mentioned device identifier.
[0119] The parameter switching module is used to switch the currently selected test parameters to the test parameters corresponding to the target identifier when the target identifier is queried.
[0120] In some embodiments, the determination module 22 includes:
[0121] The training status judgment unit is used to judge whether the device under test has completed the link retraining according to the value of the link status register of the device under test, and the value of the link status register is used to indicate the training status of the link retraining of the device under test.
[0122] In some embodiments, the determination module 22 includes:
[0123] The training monitoring unit is used to perform status monitoring on the device under test based on the value of the link status register of the device under test.
[0124] The setting unit is used to set the link control register of the device under test when it is detected that the device under test has started the link retraining, wherein the link control register after being set indicates that the link retraining of the device under test is not to be performed.
[0125] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0126] Embodiment three:
[0127] Figure 3 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Figure 3 As shown, the terminal device 3 of this embodiment includes: at least one processor 30 ( Figure 3 Only one processor is shown in the figure), a memory 31, and a computer program 32 stored in the memory 31 and executable on the at least one processor 30, wherein the processor 30 implements the steps in any of the above-mentioned method embodiments when executing the computer program 32.
[0128] The terminal device 3 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 30 and a memory 31. Those skilled in the art will appreciate that Figure 3 It is only an example of the terminal device 3 and does not constitute a limitation on the terminal device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0129] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0130] In some embodiments, the memory 31 may be an internal storage unit of the terminal device 3, such as a hard disk or memory of the terminal device 3. In other embodiments, the memory 31 may also be an external storage device of the terminal device 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 3. Further, the memory 31 may also include both an internal storage unit and an external storage device of the terminal device 3. The memory 31 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 31 may also be used to temporarily store data that has been output or is to be output.
[0131] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0132] An embodiment of the present application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor implements the steps in any of the above-mentioned method embodiments when executing the computer program.
[0133] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0134] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0135] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0136] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0137] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0138] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0139] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0140] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A device testing method, characterized in that: include: Trigger a reset operation through the bridge control register of the device under test , and starting to test the device under test after the reset operation is triggered; Determining whether the device under test completes the test; When it is determined that the device under test has completed the test, the device under test is allowed to enter the next round of the test until the number of times the device under test completes the test meets a preset requirement, thereby obtaining a test result of the device under test.
2. The device testing method according to claim 1, characterized in that: The triggering of the reset operation through the bridge control register of the device under test includes: The control parameters in the bridge control register of the device under test are modified, and the modified control parameters are used to indicate triggering the reset operation.
3. The device testing method according to claim 1, characterized in that: Before triggering the reset operation through the bridge control register of the device under test, the method further includes: Determine whether the device identifier corresponding to the device to be tested is the same as a preset identifier in the currently selected test parameter, wherein the preset identifier is a preset device identifier of the device to be tested; Correspondingly, triggering a reset operation through a bridge control register of the device under test includes: When it is determined that the device identification of the device under test is the same as the preset identification, the reset operation is triggered by the bridge control register of the device under test.
4. The device testing method according to claim 3, characterized in that: The preset identifier includes one or more identifiers of a device serial number, a bus number, a device number, and a function number, and the determining whether the device identifier corresponding to the device under test is the same as the preset identifier in the currently selected test parameter includes: Determine whether the identifier included in the device identifier corresponding to the device under test is the same as the identifier corresponding to the preset identifier; In the case that the identifier included in the device identifier is identical to the identifier corresponding to the preset identifier, it is determined that the device identifier is identical to the preset identifier.
5. The device testing method according to claim 3, characterized in that: Before triggering the reset operation through the bridge control register of the device under test, the method further includes: In the case where it is determined that the device identifier is not the same as the preset identifier in the currently selected test parameter, querying whether there is a target identifier, the target identifier being a preset device identifier that is the same as the device identifier; When the target identifier is found, the currently selected test parameter is switched to a test parameter corresponding to the target identifier.
6. The device testing method according to any one of claims 1 to 5, characterized in that: The test includes link retraining, and the determining whether the device under test completes the test includes: Whether the device under test has completed the link retraining is determined according to the value of the link status register of the device under test, wherein the value of the link status register is used to indicate the training status of the link retraining of the device under test.
7. The device testing method according to claim 6, characterized in that: The step of judging whether the device under test has completed the link retraining according to the value of the link status register of the device under test includes: Performing status monitoring on the device under test based on the value of the link status register of the device under test; In the case where it is monitored that the device under test has started the link retraining, a link control register of the device under test is set, wherein the set link control register indicates that the link retraining is not performed on the device under test.
8. A device testing apparatus, characterized in that: include: Reset test module, used to trigger the reset operation through the bridge control register of the device under test , and starting to test the device under test after the reset operation is triggered; A judging module, used to judge whether the device under test has completed the test; The cyclic testing module is used to make the device under test enter the next round of the test when it is determined that the device under test has completed the test, until the number of times the device under test completes the test meets the preset requirement, thereby obtaining the test result of the device under test.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
