Automatic testing method, device, digital chip and system for digital chip PWM module

By automatically controlling the generation and measurement results of PWM waveform, the time-consuming problem of traditional testing methods is solved, and fully automated PWM module testing is realized, which improves the testing efficiency.

CN114859217BActive Publication Date: 2025-08-19XIAMEN UNISOC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210561541.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-23
Publication Date
2025-08-19
Estimated Expiration
2042-05-23

AI Technical Summary

Technical Problem

The traditional PWM module testing method takes a long time and cannot meet the needs of industrialization. It requires an automated testing method to improve testing efficiency.

Method used

It provides an automated testing method for digital chip PWM module, which automatically controls the generation and measurement results of PWM waveform, and covers various combinations of clock source, frequency and duty cycle to realize fully automatic testing.

Benefits of technology

Fully automated PWM module testing is realized, which improves testing efficiency, covers hundreds of millions of possible waveform combinations, and reduces manual intervention time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114859217B_ABST
    Figure CN114859217B_ABST
Patent Text Reader

Abstract

The present invention provides an automated testing method, device, digital chip, and system for a digital chip PWM module. The testing method specifically comprises: setting a clock source, an output PWM waveform frequency, and a duty cycle of a PWM module to be tested, so that the PWM module to be tested generates a corresponding PWM waveform; sending a command to a waveform testing device so that a waveform measuring device automatically measures the frequency and duty cycle of the current PWM waveform; reading the frequency and duty cycle of the PWM waveform measured by the waveform measuring device, and comparing them with the set frequency and duty cycle; if they are consistent, the test passes; otherwise, the test fails and the test is directly terminated; and the above method is used to test various combinations of clock source, frequency, and duty cycle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip testing technology, and in particular to an automated testing method, device, digital chip and system for a digital chip PWM module. Background Art

[0002] The PWM (Pulse Width Modulation) module is a fundamental functional module of a digital chip. To ensure its functionality, comprehensive testing and verification are required. Due to the influence of various parameters, the PWM module can theoretically generate hundreds of millions of waveforms. Each of the following combinations will produce a waveform.

[0003] Different clock sources. A PWM module can have 3 to 5 clock sources.

[0004] Each clock source can generate different frequencies. Taking 8-bit frequency division and 16-bit mode as an example, 256*25536=6537216 waveforms can be generated.

[0005] Each frequency can generate waveforms with a duty cycle of 0 to 100%.

[0006] A chip generally integrates about 4 PWM modules.

[0007] With hundreds of millions of possible waveforms, even using typical parameters, it's typically necessary to measure around 800 waveforms. Traditional measurement methods involve first programming PWM parameters to generate the PWM waveform, then measuring the frequency and duty cycle using an oscilloscope, and finally manually verifying the results. This entire process is time-consuming and unsuitable for industrial testing. Summary of the Invention

[0008] To solve the above problems, the present invention provides an automated testing method, device, digital chip and system for a digital chip PWM module, which can automatically control the generation of PWM waveforms and compare them with measurement results to complete fully automatic testing.

[0009] In one aspect, the present invention provides an automated testing method for a digital chip PWM module, comprising:

[0010] 1) Set the clock source of the PWM module to be tested;

[0011] 2) Under the current clock source, set the frequency of the PWM waveform output by the PWM module;

[0012] 3) At the current frequency, setting the duty cycle of the PWM waveform output by the PWM module so that the PWM module to be tested generates a corresponding PWM waveform according to the set clock source, frequency and duty cycle;

[0013] 4) Sending a command to the waveform test device so that the waveform measurement device automatically measures the frequency and duty cycle of the current PWM waveform;

[0014] 5) Read the frequency and duty cycle of the PWM waveform measured by the waveform measurement device and compare them with the set frequency and duty cycle. If they are consistent, the test passes and proceeds to step 6). Otherwise, the test fails and ends directly;

[0015] 6) Determine whether the last duty cycle has been tested. If so, proceed to step 7), otherwise return to step 3);

[0016] 7) Determine whether the last frequency has been tested. If so, proceed to step 8), otherwise return to step 2);

[0017] 8) Determine whether the last clock source has been tested. If so, end the test of the PWM module to be tested; otherwise, return to step 1).

[0018] Optionally, if the digital chip includes multiple PWM modules, the method further includes:

[0019] Before step 1), a PWM module is selected from a plurality of PWM modules as the PWM module to be tested, and a signal path between the PWM module to be tested and the waveform measurement device is enabled.

[0020] Optionally, at each frequency, the duty cycle is sequentially set from 0 to 100% in steps of 1%.

[0021] In another aspect, the present invention provides an automated testing device for a digital chip PWM module, comprising:

[0022] The first setting module is used to set the clock source of the PWM module to be tested;

[0023] The second setting module is used to set the frequency of the PWM waveform output by the PWM module;

[0024] The third setting module is used to set the duty cycle of the PWM waveform output by the PWM module;

[0025] a sending module, configured to send a command to the waveform testing device so that the waveform measuring device measures the frequency and duty cycle of the PWM waveform corresponding to the current clock source, the current frequency, and the current duty cycle;

[0026] The comparison module is used to read the frequency and duty cycle of the PWM waveform measured by the waveform measurement device and compare them with the set frequency and duty cycle. If they are consistent, the test passes, otherwise the test fails;

[0027] The first judgment module is used to judge whether the last duty cycle has been tested;

[0028] The second judgment module is used to judge whether the last frequency has been tested;

[0029] The third judgment module is used to judge whether the last clock source has been tested.

[0030] On the other hand, the present invention provides a digital chip comprising at least one PWM module, a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the above-mentioned automated testing method for the PWM module of the digital chip is implemented.

[0031] In another aspect, the present invention provides an automated testing system for a digital chip PWM module, the system comprising:

[0032] A digital chip comprising at least one PWM module, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned automated testing method for the PWM module of the digital chip when executing the program;

[0033] The waveform measuring device is connected to the digital chip and is used to receive commands from the digital chip and automatically measure the frequency and duty cycle of the PWM waveform corresponding to the current clock source, current frequency and current duty cycle.

[0034] Optionally, the digital chip is connected to the waveform measuring device via a serial bus.

[0035] Optionally, if the digital chip includes multiple PWM modules, the system further includes:

[0036] The path selection circuit is used to input the PWM waveform output by the PWM module to be tested into the waveform measurement device.

[0037] Optionally, the waveform measuring device is a digital oscilloscope.

[0038] The present invention provides an automated testing method, device, digital chip, and system for a digital chip PWM module, which automatically controls the generation of PWM waveforms and compares them with measurement results. These methods cover PWM waveforms with various combinations of clock sources, frequencies, and duty cycles, enabling fully automated testing and improving test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A schematic flow chart of an automated testing method for a digital chip PWM module provided by one embodiment of the present invention;

[0040] Figure 2 Schematic diagram of different combinations of clock source, frequency and duty cycle;

[0041] Figure 3 A schematic structural diagram of an automated testing device for a digital chip PWM module provided by one embodiment of the present invention;

[0042] Figure 4 This is a structural block diagram of an automated testing system for a digital chip PWM module provided by one embodiment of the present invention. DETAILED DESCRIPTION

[0043] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0044] The following embodiments of the present invention are described in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.

[0045] Figure 1 The present invention provides a flowchart of an automated testing method for a digital chip PWM module according to an embodiment of the present invention.

[0046] refer to Figure 1 , the method is applicable to digital chips and may include the following steps:

[0047] Step 101: Set the clock source of the PWM module to be tested.

[0048] Step 102: Under the current clock source, set the frequency of the PWM waveform output by the PWM module.

[0049] Step 103 : at the current frequency, setting the duty cycle of the PWM waveform output by the PWM module so that the PWM module to be tested generates a corresponding PWM waveform according to the set clock source, frequency and duty cycle.

[0050] Step 104: Send a command to the waveform testing device so that the waveform measuring device automatically measures the frequency and duty cycle of the current PWM waveform.

[0051] Step 105, read the frequency and duty cycle of the PWM waveform measured by the waveform measurement device, and compare them with the set frequency and duty cycle. If they are consistent, the test passes and continues to step 106. Otherwise, the test fails and ends directly.

[0052] Step 106 , determining whether the last duty cycle has been tested, if so, executing step 107 , otherwise returning to step 103 .

[0053] Each time step 103 is executed, the duty cycle increases in steps of a predetermined value. In this embodiment, the duty cycle ranges from 0 to 100%, and the duty cycle is set in steps of 1%, i.e., 0, 1%, 2%, ..., 100%. At each frequency, the PWM waveform corresponding to different duty cycles is tested.

[0054] Step 107 , determining whether the last frequency has been tested, if so, executing step 108 , otherwise returning to step 102 .

[0055] Each time step 102 is executed, the frequency changes according to the number of bits. How the frequency is determined depends on the specific parameters. Taking 8-bit frequency division and 16-bit mode as an example, 256*25536=6537216 waveforms can be generated.

[0056] Step 108 , determining whether the last clock source has been tested. If so, the test of the PWM module to be tested is terminated. Otherwise, the process returns to step 101 .

[0057] Each time step 101 is executed, a clock source is switched.

[0058] Furthermore, if the digital chip includes multiple PWM modules, before executing step 101, step 100 is executed: a PWM module is first selected from the multiple PWM modules as the PWM module to be tested, and the signal path between the PWM module to be tested and the waveform measurement device is enabled. Automated testing is then performed according to steps 101-108 described above. Subsequently, step 109 is executed: determining whether the last PWM module has been tested. Each PWM module is sequentially selected as the PWM module to be tested, and the corresponding signal path is enabled, and each PWM module is tested until the last PWM module is tested.

[0059] Figure 2 The figure shows different combinations of clock source, frequency, and duty cycle for testing PWM module 1. As you can see, each PWM module must be tested using a different clock source, with different frequencies tested under each clock source, and different duty cycles tested under each frequency.

[0060] An embodiment of the present invention provides an automated testing method for a digital chip PWM module, which automatically controls the generation of PWM waveforms and compares them with measurement results. It covers PWM waveforms with various combinations of clock sources, frequencies, and duty cycles, completes fully automatic testing, and improves test efficiency.

[0061] Figure 3 FIG. 1 is a schematic diagram of the structure of an automated testing device for a digital chip PWM module provided by an embodiment of the present invention. Figure 3As shown, the device includes: a first setting module 301, a second setting module 302, a third setting module 303, a sending module 304, a comparison module 305, a first judgment module 306, a second judgment module 307 and a third judgment module 308, wherein,

[0062] A first setting module 301 is used to set the clock source of the PWM module to be tested;

[0063] A second setting module 302 is used to set the frequency of the PWM waveform output by the PWM module;

[0064] The third setting module 303 is used to set the duty cycle of the PWM waveform output by the PWM module;

[0065] a sending module 304 for sending a command to the waveform testing device so that the waveform measuring device measures the frequency and duty cycle of the PWM waveform corresponding to the current clock source, current frequency, and current duty cycle;

[0066] The comparison module 305 is used to read the frequency and duty cycle of the PWM waveform measured by the waveform measurement device and compare them with the set frequency and duty cycle. If they are consistent, the test passes, otherwise the test fails;

[0067] The first judgment module 306 is used to judge whether the last duty cycle has been tested;

[0068] The second judgment module 307 is used to judge whether the last frequency has been tested;

[0069] The third judgment module 308 is used to judge whether the last clock source has been tested.

[0070] An automated testing device for a digital chip PWM module provided in an embodiment of the present invention is used to execute the above method embodiment. Its specific process and detailed content can refer to the above method embodiment and will not be repeated here.

[0071] On the other hand, an embodiment of the present invention provides a digital chip, which includes at least one PWM module, and also includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the automated testing method for the digital chip PWM module provided in the above method embodiment is implemented.

[0072] On the other hand, an embodiment of the present invention further provides an automated testing system for a digital chip PWM module. Figure 4 The structural block diagram of the system is shown in Figure 4 As shown, the system includes:

[0073] The digital chip 401 includes at least one PWM module, a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the automated testing method for the digital chip PWM module provided in the above method embodiment is implemented.

[0074] The waveform measuring device 402 is connected to the digital chip 401 and is used to receive commands from the digital chip 401 and automatically measure the frequency and duty cycle of the PWM waveform corresponding to the current clock source, current frequency and current duty cycle.

[0075] The waveform measurement device 402 can be a digital oscilloscope with automatic measurement capabilities. The digital chip 401 is connected to the waveform measurement device 402 via a serial bus. The digital chip reads the frequency and duty cycle of the PWM waveform via serial communication and then compares them with the set frequency and duty cycle.

[0076] Further, refer to Figure 4 , the digital chip 401 includes 4 PWM modules, and the system also includes:

[0077] The path selection circuit 403 is used to input the PWM waveform output by the PWM module to be tested into the waveform measurement device 402 .

[0078] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0079] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

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

Claims

1. An automated testing method for a digital chip PWM module, characterized in that: The method is implemented by a processor in the digital chip, and includes: 1) Set the clock source of the PWM module to be tested; 2) Under the current clock source, set the frequency of the PWM waveform output by the PWM module; 3) At the current frequency, setting the duty cycle of the PWM waveform output by the PWM module so that the PWM module to be tested generates a corresponding PWM waveform according to the set clock source, frequency and duty cycle; 4) Send a command to the waveform measurement device so that the waveform measurement device automatically measures the frequency and duty cycle of the current PWM waveform; 5) Read the frequency and duty cycle of the PWM waveform measured by the waveform measurement device and compare them with the set frequency and duty cycle. If they are consistent, the test passes and proceeds to step 6). Otherwise, the test fails and ends directly; 6) Determine whether the last duty cycle has been tested. If so, proceed to step 7). Otherwise, return to step 3); 7) Determine whether the last frequency has been tested. If so, proceed to step 8). Otherwise, return to step 2); 8) Determine whether the last clock source has been tested. If so, end the test of the PWM module to be tested. Otherwise, return to step 1).

2. The method according to claim 1, characterized in that If the digital chip includes multiple PWM modules, the method further includes: Before step 1), a PWM module is selected from a plurality of PWM modules as the PWM module to be tested, and a signal path between the PWM module to be tested and the waveform measurement device is enabled.

3. The method according to claim 1, characterized in that At each frequency, the duty cycle is set sequentially from 0 to 100% in steps of 1%.

4. An automated testing device for a digital chip PWM module, characterized in that: The device is implemented by a processor in the digital chip, and the device includes: The first setting module is used to set the clock source of the PWM module to be tested; The second setting module is used to set the frequency of the PWM waveform output by the PWM module; The third setting module is used to set the duty cycle of the PWM waveform output by the PWM module; a sending module, configured to send a command to the waveform measuring device so that the waveform measuring device measures the frequency and duty cycle of the PWM waveform corresponding to the current clock source, the current frequency, and the current duty cycle; The comparison module is used to read the frequency and duty cycle of the PWM waveform measured by the waveform measurement device and compare them with the set frequency and duty cycle. If they are consistent, the test passes, otherwise the test fails; The first judgment module is used to judge whether the last duty cycle has been tested; The second judgment module is used to judge whether the last frequency has been tested; The third judgment module is used to judge whether the last clock source has been tested.

5. A digital chip comprising at least one PWM module, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the automated testing method for the digital chip PWM module according to any one of claims 1 to 3 is implemented.

6. An automated testing system for a digital chip PWM module, characterized in that: The system comprises: A digital chip, comprising at least one PWM module, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the automated testing method for the digital chip PWM module according to any one of claims 1 to 3; The waveform measuring device is connected to the digital chip and is used to receive commands from the digital chip and automatically measure the frequency and duty cycle of the PWM waveform corresponding to the current clock source, current frequency and current duty cycle.

7. The system according to claim 6, characterized in that The digital chip is connected to the waveform measuring device via a serial bus.

8. The system according to claim 6, wherein: If the digital chip includes multiple PWM modules, the system further includes: The path selection circuit is used to input the PWM waveform output by the PWM module to be tested into the waveform measurement device.

9. The system according to claim 6, wherein: The waveform measuring device is a digital oscilloscope.

Citation Information

Patent Citations

  • FPGA-based SOC chip automatic test tool and test method

    CN111025129A