Function test method and device
By introducing coverage acquisition and random stimulus generation components into the functional test platform, the problem of low efficiency in FPGA functional testing is solved, and efficient functional coverage and accuracy are achieved through automated identification and stimulus generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-06
- Publication Date
- 2026-03-24
AI Technical Summary
Existing FPGA functional testing methods are inefficient and ineffective, especially in nuclear power plant safety-grade digital instrumentation and control systems where it is difficult to achieve 100% functional coverage.
A functional testing platform is adopted, which combines directed and random stimulus automated testing methods. Through coverage acquisition components and random stimulus generation components, untested functions are automatically identified and random stimuli are automatically generated to achieve closed-loop testing.
It improves the automation and efficiency of functional testing, ensures complete coverage of FPGA functions, reduces the subjectivity of human intervention, and improves the accuracy and efficiency of testing.
Smart Images

Figure CN121722677A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a functional testing method and apparatus. Background Technology
[0002] Currently, there may be a need for functional testing of objects such as field-programmable gate arrays (FPGAs). For example, as FPGA technology is increasingly used in safety-grade digital instrumentation and control systems in nuclear power plants, it may be necessary to fully test the functions implemented by the FPGA to achieve 100% coverage of FPGA functional testing, that is, to test as many of the FPGA's functions as possible.
[0003] Currently, the Universal Verification Methodology (UVW) functional test platform is typically used to perform functional tests on objects under test such as FPGAs in order to achieve 100% functional coverage.
[0004] However, in real-world applications, using this method to test an object's functionality is not only inefficient but also produces poor results. Summary of the Invention
[0005] This application provides a functional testing method to effectively improve the automation level of the functional testing process, thereby increasing the efficiency of functional testing. Furthermore, this application also provides a corresponding functional testing apparatus.
[0006] In a first aspect, this application provides a functional testing method, which is executed by a functional testing platform. The method includes: performing functional testing on a test object using directed stimuli, wherein the directed stimuli are used to test the function of the test object; collecting a first functional coverage rate, wherein the first functional coverage rate is used to indicate the ratio of the function of the test object to be covered during the functional testing of the test object using the directed stimuli; determining whether the first functional coverage rate is less than a target coverage rate; generating a first random stimuli if the first functional coverage rate is less than the target coverage rate; and performing functional testing on the test object using the first random stimuli.
[0007] In one possible implementation, the method further includes: acquiring a second functional coverage rate, the second functional coverage rate being used to indicate the ratio of the functionality of the test object to be covered after functional testing of the test object using the first random stimulus; determining whether the second functional coverage rate is less than a target coverage rate; generating a second random stimulus if the second functional coverage rate is less than the target coverage rate; and performing functional testing on the test object using the second random stimulus.
[0008] In one possible implementation, the functional testing platform includes an incentive scheduling component, a targeted incentive generation component, and a driving component; the method further includes: detecting whether the targeted incentive generation component sends an input request to the incentive scheduling component, and detecting whether the driving component sends an output request to the incentive scheduling component; when the targeted incentive generation component sends an input request and the driving component sends an output request, providing the first random incentive to the driving component using the incentive scheduling component; and providing the first random incentive to the object under test using the driving component for functional testing.
[0009] In one possible implementation, the step of providing the first random stimulus to the object under test for functional testing using the driving component includes: performing timing conversion on the first random stimulus using the driving component; and providing the timing-converted first random stimulus to the object under test for functional testing using the driving component.
[0010] In one possible implementation, the stimulus scheduling component and the driving component are encapsulated as an input proxy unit, and the interface of the driving component is associated with the interface of the input proxy unit; the step of providing the first random stimulus to the object under test for functional testing using the driving component includes: providing the first random stimulus to the object under test through the interface of the proxy unit using the driving component for functional testing.
[0011] In one possible implementation, the functional testing platform includes a reference model component and a scoreboard component; the method further includes: backing up the first random stimulus using the driving component; providing the backed-up first random stimulus to the reference model component using the driving component, the reference model component being used to output an expected result, the expected result being the result obtained by the reference model component through inference based on the first random stimulus; and providing the first random stimulus to the scoreboard component using the reference model component.
[0012] In one possible implementation, the functional testing platform includes a monitoring component; the method further includes: using the monitoring component to collect actual results, the actual results being the output results obtained by the tested object through reasoning on the first random stimulus; using the monitoring component to provide the actual results to the scoreboard component; using the scoreboard component to verify whether the actual results and the expected results are consistent, wherein, if the actual results are consistent with the expected results, the function of the tested object associated with the first random stimulus is the expected function.
[0013] Secondly, this application provides a functional testing apparatus, the apparatus comprising: a directional testing module for performing functional testing on a test object using directional stimuli, the directional stimuli being used to test the function of the test object; a data acquisition module for acquiring a first functional coverage rate, the first functional coverage rate being used to indicate the ratio of the function of the test object being covered during the functional testing of the test object using the directional stimuli; a judgment module for judging whether the first functional coverage rate is less than a target coverage rate; a generation module for generating a first random stimuli when the first functional coverage rate is less than the target coverage rate; and a testing module for performing functional testing on the test object using the first random stimuli.
[0014] In one possible implementation, the acquisition module is specifically used to acquire a second functional coverage rate, which indicates the percentage of functional coverage of the test object after functional testing using the first random stimulus; the judgment module is specifically used to determine whether the second functional coverage rate is less than a target coverage rate; the generation module is specifically used to generate a second random stimulus when the second functional coverage rate is less than the target coverage rate; and the testing module is specifically used to perform functional testing on the test object using the second random stimulus.
[0015] In one possible implementation, the functional testing platform includes an incentive scheduling component, a directed incentive generation component, and a driving component; the device further includes: a detection module, used to detect whether the directed incentive generation component sends an input request to the incentive scheduling component, and to detect whether the driving component sends an output request to the incentive scheduling component; a sending module, used to, when the directed incentive generation component sends an input request and the driving component sends an output request, use the incentive scheduling component to provide the first random incentive to the driving component; and use the driving component to provide the first random incentive to the object under test for functional testing.
[0016] In one possible implementation, the sending module is specifically used to provide the first random stimulus, after timing conversion using the driving component, to the object under test for functional testing.
[0017] In one possible implementation, the stimulus scheduling component and the driving component are encapsulated as an input proxy unit, and the interface of the driving component is associated with the interface of the input proxy unit; the sending module is specifically used to provide the first random stimulus to the object under test through the interface of the proxy unit using the driving component for functional testing.
[0018] In one possible implementation, the functional testing platform includes a reference model component and a scoreboard component; the device further includes: a backup module for backing up the first random stimulus using the driving component; the sending module is specifically used to provide the backed-up first random stimulus to the reference model component using the driving component, the reference model component being used to output an expected result, the expected result being the result obtained by the reference model component through inference based on the first random stimulus; and to provide the second random stimulus to the scoreboard component using the reference model component.
[0019] In one possible implementation, the functional testing platform includes a monitoring component; the device further includes: a collection module for collecting actual results using the monitoring component, the actual results being the output results obtained by the tested object through reasoning on the first random stimulus; a sending module specifically used to provide the actual results to the scoreboard component using the monitoring component; and a verification module used to verify whether the actual results and the expected results are consistent using the scoreboard component, wherein, if the actual results are consistent with the expected results, the function of the tested object associated with the first random stimulus is the expected function.
[0020] Thirdly, this application provides a processor for executing any of the described functional test methods.
[0021] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any of the aforementioned functional testing methods.
[0022] As can be seen from the above technical solutions, this application has the following beneficial effects:
[0023] This application provides a functional testing method that automatically collects the output of the test object (DUT) to generate functional coverage by adding a coverage acquisition component, a coverage analysis component, and a random stimulus generation component to a traditional functional testing platform. The method then analyzes the DUT's output and functional coverage. When the functional coverage is less than the target coverage, untested functions of the DUT are identified based on the output analysis results. Random stimuli are automatically generated for these untested functions, and the functional testing platform uses these random stimuli to continue functional testing on the DUT. This improves functional testing coverage, enhances the intelligence level of the functional testing process, and ultimately increases the efficiency of functional testing. Attached Figure Description
[0024] Figure 1 A block diagram of a functional testing platform provided in an embodiment of this application;
[0025] Figure 2A schematic diagram of a functional testing method flow provided in an embodiment of this application;
[0026] Figure 3 A schematic diagram of another functional testing method flow provided in an embodiment of this application;
[0027] Figure 4 This is a schematic diagram of the structure of a functional testing device provided in an embodiment of this application. Detailed Implementation
[0028] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate; this is merely a method of distinction used in describing objects with the same attributes in the embodiments of this application.
[0029] To make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the embodiments of this application will be further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0030] To facilitate understanding of the methods provided in the embodiments of this application, the following is combined with... Figure 1 The functional testing platform example is used for illustration. Figure 1 As shown, the functional testing platform 10 may include four layers: a scenario layer 110, a functional layer 120, a command layer 130, and a signal layer 140. The scenario layer 110 is used to generate test stimuli for testing the functionality of the object under test (DUT) 141. The functional layer 120 is used to verify whether the functionality of the DUT 141 meets expectations. The command layer 130 is used to perform timing conversion on the test stimuli to match the timing of the test stimuli's interface with that of the DUT 141. The signal layer 140 enables interaction between the interface of the driver component 131 and the interface of the DUT 141. The DUT 141 can be either hardware or software; there is no limitation on this.
[0031] Furthermore, the scene layer 110 may include a startup component 111, a directional stimulus generation component 112, a stimulus mobilization component 113, a coverage acquisition component 114, a coverage analysis component 115, and a random stimulus generation component 116; the function layer 120 may include a reference model component 121 and a scoreboard component 122; the command layer 130 may include a drive component 131 and a monitoring component 132; and the signal layer 140 may include the object under test 141.
[0032] Among them, the startup component 111 can be used to start the directional stimulus generation component 112.
[0033] The targeted stimulus generation component 112 can be used to generate targeted stimuli and provide them to the stimulus scheduling component 103. The targeted stimuli may include targeted stimulus data, used to test the functionality of the object under test 141.
[0034] The incentive mobilization component 113 can be used to provide the directional incentive generated by the directional incentive component or the random incentive generated by the random incentive generation component to the driving component 131.
[0035] The driver component 131 can be used to perform timing conversion on directional or random stimuli and provide the timing-converted directional or random stimuli to the object under test 141. In addition, the driver component 131 can also be used to back up the timing-converted directional or random stimuli and provide the backed-up directional or random stimuli to the reference model component 121.
[0036] The reference model component 121 can be used to output the correct results of directional or random excitation and provide the results to the scoreboard component 122.
[0037] The monitoring component 132 can be used to collect the output results of the object under test 141 and provide the results to the scoreboard component 122.
[0038] The scoreboard component 122 can be used to verify whether the results output by the reference model component 121 are consistent with the results collected by the monitoring component 132.
[0039] The coverage acquisition component 114 can be used to acquire the output results of the object under test 141, analyze the output results, determine the functions of the object under test 141 that have not been tested, generate the function coverage of directional or random stimuli, and provide the function coverage to the coverage analysis module.
[0040] The coverage analysis component 115 can be used to verify whether the functional coverage is less than the target coverage.
[0041] The random stimulus generation component 116 can be used to generate random stimuli for untested functions of the object under test 141 when the collected coverage is less than the target coverage.
[0042] In practical applications, traditional functional testing platforms provide the directed stimuli generated by the directed stimulus generation component 112 to the object under test 141 for functional testing. Then, the output results of the object under test 141 are manually analyzed. When the functions of the object under test 141 cannot be fully covered, test stimuli are manually designed for the functions that were not tested on the object under test 141, and the test stimuli are then provided to the object under test 141 again for functional testing.
[0043] However, this traditional functional testing platform requires manual analysis of the output results of the tested object 141 and the functional coverage of the stimuli. Furthermore, when the functional coverage is less than the target coverage, test stimuli need to be manually designed for the untested functions of the tested object. Therefore, the excessive manual intervention in traditional functional testing platforms leads to low automation and consequently low efficiency in functional testing of the tested object 141. Moreover, manual analysis of functional coverage is not only time-consuming, resulting in low efficiency, but the subjectivity of the testers can also lead to low accuracy in the manually analyzed functional coverage. If the accuracy of the manually analyzed functional coverage is too high, it will affect the overall effectiveness of the functional testing; for example, low functional coverage may result in many untested functions of the tested object.
[0044] Based on this, the embodiments of this application are as follows: Figure 1 The functional test platform 10 shown includes a coverage acquisition component 114, a coverage analysis component 115, a random stimulus generation component 116, a stimulus scheduling component 103, and a drive component 131. The functional test platform 10 automatically generates random stimuli for the untested functions of the test object 141 by feeding back the analysis results from the coverage analysis module 105 to the random stimulus generation component 116, forming a simulation closed-loop circuit. Since the coverage acquisition component 114 can objectively analyze the functional coverage of the test object 141 using predefined rules, this not only improves the accuracy of determining functional coverage, thus ensuring the overall effectiveness of functional testing of the test object 141, but also, compared to manual analysis, the efficiency of automatically determining functional coverage using the coverage acquisition component 114 is generally higher, thereby improving the efficiency of determining functional coverage and ultimately improving the overall efficiency of functional testing. Meanwhile, when the functional coverage of the test object 141 is low, the random stimulus generation component 116 can automatically generate random stimuli for the untested functions of the test object 141. Furthermore, the functional test platform 10 can use these random stimuli to continue functional testing of the test object, which effectively improves the functional coverage of the test object 141. In addition, the functional test platform 10 adds a stimulus scheduling component 103 and a driver component 131 to schedule and drive random and directed stimuli. Compared to traditional functional test platforms, the functional test platform 10 can more easily maintain random or directed stimuli.
[0045] Those skilled in the art will understand that Figure 1 The schematic diagram of the functional testing platform shown is merely one example in which the embodiments of this application can be implemented. The scope of application of the embodiments of this application is not limited by any aspect of this functional testing platform.
[0046] To facilitate understanding of the embodiments of this application, a functional testing method provided by the embodiments of this application will be described below with reference to the accompanying drawings.
[0047] See Figure 2 , Figure 2 This is a flowchart illustrating a functional testing method provided in an embodiment of this application. This method can be applied to... Figure 1 The functional test platform 10 shown can be used, or it can be applied to other applicable functional test platforms. For ease of understanding, the following uses an application to... Figure 1 The functional testing platform shown is used as an example for illustration.
[0048] in, Figure 2 The functional testing method shown may include the following steps.
[0049] S201: The functional test platform 10 uses directional stimulus to perform functional testing on the test object 141. The directional stimulus is used to test the function of the test object 141.
[0050] In specific implementation, the functional testing platform 10 can use the startup component 111 in the scenario layer to start the targeted stimulus generation component 112. After the targeted stimulus generation component 112 is started, the functional testing platform 10 can use the targeted stimulus generation component 112 to generate targeted stimuli. These targeted stimuli are specific test stimuli written by engineers for testing one or more specific functions of the object under test 141, used to test whether a specific function of the object under test 141 is the expected function. Targeted stimuli can include targeted stimulus data. For example, if the targeted stimulus data is 0~255, the functional testing platform 10 can use the targeted stimulus data 0~255 to test the function of the object under test 141.
[0051] In one possible implementation, the functional test platform 10 can use the `default_sequence` task to start the targeted stimulus generation component 112 via the `config_db` mechanism. Furthermore, the functional test platform 10 can use the `raise_objection` task in the objection mechanism to enable the targeted stimulus generation component 112 to generate targeted stimuli, use the `drop_objection` task in the objection mechanism to enable the targeted stimulus generation component 112 to stop generating targeted stimuli, and use tasks such as `uvm_do`, `uvm_do_with`, and `uvm_send` to provide targeted stimuli to the stimulus scheduling component 103.
[0052] Furthermore, the functional test platform 10 can provide the directional stimulus generated by the directional stimulus generation component 112 to the test object 141 to perform functional testing on the test object 141.
[0053] In one possible implementation, before the functional test platform 10 provides the directed stimulus to the test object 141 using the directed stimulus generation component 112, the directed stimulus can be scheduled using the stimulus scheduling component 103.
[0054] Specifically, the functional test platform 10 can use the stimulus scheduling component 103 to detect whether there are input requests in the arbitration queue and whether the driver component 131 sends an output request to the stimulus scheduling component 103. The arbitration queue is used to store input requests sent by the functional test platform 10 to the stimulus scheduling component 103 using the directed stimulus component 102.
[0055] When the functional test platform 10 detects an input request in the arbitration queue using the incentive scheduling component 103, but detects that the driver component 131 has not sent an output request to the incentive dispatching component 113, the incentive scheduling component 103 enters a first waiting state. The first waiting state is the state where the incentive dispatching component 113 waits for the driver component 131 to send an output request. While the incentive scheduling component 103 is in the first waiting state, the functional test platform 10 can use the driver component 131 to send an output request to the incentive scheduling component 103. Upon receiving this request, the incentive scheduling component 103 immediately exits the first waiting state and sends an input consent request to the directed incentive generation component 112. After receiving this input consent request, the directed incentive generation component 112 can use the directed incentive component 102 to provide directed incentives to the incentive scheduling component 103.
[0056] When the functional test platform 10 detects that there is no input request in the arbitration queue using the incentive scheduling component 103, but detects that the driver component 131 sends an output request to the incentive dispatch component 113, the incentive scheduling component 103 enters a second waiting state. This second waiting state is the state where the incentive dispatch component 113 waits for the directed incentive generation component 112 to send an input request. While the incentive scheduling component 103 is in the second waiting state, the functional test platform 10 can use the directed incentive generation component 112 to send an input request to the incentive scheduling component 103. Upon receiving the input request, the incentive scheduling component 103 immediately exits the second waiting state and sends an acceptance input request to the directed incentive generation component 112. After receiving the acceptance input request, the directed incentive generation component 112 can use the directed incentive component 102 to provide directed incentives to the incentive scheduling component 103.
[0057] When the functional test platform 10 detects an input request in the arbitration queue using the incentive scheduling component 103, and simultaneously detects that the driver component 131 sends an output request to the incentive dispatch component 113, the incentive scheduling component 103 can immediately send an input consent request to the directed incentive generation component 112. After receiving the input consent request, the directed incentive generation component 112 can provide directed incentives to the incentive scheduling component 103 using the directed incentive component 102.
[0058] Furthermore, after the functional test platform 10 provides the directional stimulus to the stimulus scheduling component 103 using the directional stimulus generation component 112, it can then use the stimulus scheduling component 103 to provide the directional stimulus to the driver component 131. Finally, the driver component 131 provides the directional stimulus to the test object 141 for functional testing.
[0059] S202: The functional test platform 10 uses the coverage acquisition component 114 to acquire the first functional coverage, which is used to indicate the percentage of the function of the test object 141 that is covered during the functional test of the test object 141 using directional excitation.
[0060] The functional testing platform 10 uses the coverage acquisition component 114 to collect the actual output results of the tested object 141 and analyzes them. Further, the functional testing platform 10 can automatically identify functions of the tested object 141 that were not tested by the directed stimulus based on the analysis results, and generate a coverage quantification index for the actual output results, referred to in this embodiment as the first functional coverage rate. The first functional coverage rate indicates the percentage of functionality covered by the tested object 141 during the functional testing process using directed stimulus. For example, the functional testing platform 10 analyzes the characteristics of the actual output results of the tested object 141 and matches the characteristics of the output results with the characteristics of each function of the tested object 141. When the characteristics of the output results match the characteristics of a certain function in the tested object 141, it proves that the function has been tested, that is, the function has been covered. The characteristics of the output results can be the features of the output data corresponding to the function, and can be data types such as numbers, strings, booleans, etc. When the test object 141 has 10 functions, and the features of the output result of the test object 141 match the features of 4 functions in the test object 141, the first function coverage rate is 40%.
[0061] S203: The functional test platform 10 uses the coverage analysis component 115 to determine whether the coverage of the first function is less than the target coverage.
[0062] After the functional test platform 10 generates a first functional coverage using the coverage acquisition component 114, the first functional coverage can be provided to the coverage analysis component 115. The coverage analysis component 115 can compare the first functional coverage with the target coverage to determine whether the first functional coverage is less than the target coverage.
[0063] The target coverage can be pre-configured by the tester in the coverage analysis component 115, or it can be automatically generated by the coverage analysis component 115; there is no limitation on this.
[0064] S204: If the first functional coverage is less than the target coverage, the functional test platform 10 generates a first random stimulus using the random stimulus generation component 116.
[0065] When the first functional coverage is less than the target coverage, the functional test platform 10 can generate a first random stimulus for the untested functions of the test object 141 based on the analysis of the actual output results using the random stimulus generation component 116, and provide this first random stimulus to the test object 141 for continued functional testing. The first random stimulus may include first random stimulus data and constraints. The constraints can be used to limit the range of the first random stimulus data. For example, if the first random stimulus data is 0~255, the constraints can limit the first random stimulus data to 100~200. When the first functional coverage is not less than the target coverage, the random stimulus generation component 116 does not generate any random stimulus.
[0066] S205: The functional test platform 10 uses the first random stimulus to perform functional tests on the test object 141.
[0067] The functional testing platform 10 can provide the first random stimulus generated by the random stimulus generation component 116 to the test object 141 for functional testing, and continue to use the coverage acquisition component 114 to collect the actual output results of the test object 141 to generate a second functional coverage. The second functional coverage refers to the percentage of functionality covered by the test object 141 after functional testing using the first random stimulus. For example, if the functional testing platform 10 tests four functions of the test object 141 using directed stimuli and two functions using the first random stimulus, then the second functional coverage is 60%.
[0068] Furthermore, when the coverage analysis component 115 determines that the second functional coverage is still less than the target coverage, the functional test platform 10 can continue to use the random stimulus generation component 116 to generate a second random stimulus and provide the second random stimulus to the test object 141 for functional testing.
[0069] After the functional testing platform 10 performs functional testing on the test object 141 using directed stimuli, the platform automatically collects the actual output results of the test object 141 using the coverage acquisition component 114, and automatically analyzes these results to generate a first functional coverage for the directed stimuli. Then, the platform automatically judges the first functional coverage using the coverage analysis component 115. When the first functional coverage is less than the target coverage, the platform automatically identifies the untested functions of the test object 141 based on the analysis of the actual output results, and uses the random stimulus generation component 116 to generate random stimuli for these untested functions. The platform then continues to perform functional testing on the test object 141 using these random stimuli. Referring to the above method, the functional coverage of the stimulus can be automatically collected multiple times. If the collected functional coverage is less than the target coverage, new random stimuli are automatically generated for the untested functions of the test object 141 to perform functional testing on the test object 141 until the functional coverage is not less than the target coverage. This effectively improves the functional coverage of the functional test. Furthermore, the above process uses the coverage acquisition component 104 to automatically determine the functional coverage, thereby improving the efficiency of determining the functional coverage.
[0070] In one possible implementation, the functional test platform 10 can encapsulate the stimulus scheduling component 103 and the driver component 131 as an input agent. Furthermore, the functional test platform 10 can establish a connection between member variables in the stimulus scheduling component 103 and member variables in the driver component 131 using the `connect` function, thereby establishing a transmission channel for directed stimuli from the stimulus scheduling component 103 to the driver component 131. For example, the functional test platform 10 can utilize the member variable `seq_tem_export` in the stimulus scheduling component 103 and the member variable `seq_tem_port` in the driver component 131 to establish the transmission channel for directed stimuli from the stimulus scheduling component 103 to the driver component 131. After the transmission channel is established, directed stimuli and output requests can be transmitted through this channel. Moreover, the data type of the transmitted stimulus defined in the transmission channel is the same as the data type of the stimulus defined by the stimulus scheduling component 103 and the driver component 131. Therefore, when the functional test platform 10 provides directed stimuli from the stimulus scheduling component 103 to the driver component 131, it does not need to perform data type conversion on the directed stimulus data.
[0071] Furthermore, in one example, the functional test platform 10 can establish a transmission channel between the driver component 131 and the test object 141 through the member variable io_phy1_if in the driver component 131 and the member variable io_phy1_if in the test object 141. Before providing the directional stimulus to the test object 141 through the established transmission channel, the functional test platform 10 can use the driver component 131 to perform timing conversion on the directional stimulus data. This allows the functional test platform 10 to provide the directional stimulus data to the test object 141 according to the timing of the test object 141's input interface, preventing timing mismatches between the directional stimulus data and the timing of the test object 141's interface, thus avoiding errors in the functional testing process.
[0072] For example, the functional test platform 10 can use the driver component 131 to back up the directed stimuli and provide the backed-up directed stimuli to the reference model component 121 through a transaction-level modeling (TLM) mechanism. The reference model component 121 can output the expected correct results of the directed stimuli, and the functional test platform 10 can provide the expected correct results to the scoreboard component 122. Furthermore, the functional test platform 10 can use the monitoring component 132 to collect the actual output results of the test object 141 and provide the actual output results to the scoreboard component 122. The scoreboard component 122 verifies the expected correct results output by the reference model component 121 and the actual results of the test object 141. If the expected results and the actual results are consistent, it means that the function of the test object 141 is the expected function; if the expected results and the actual results are inconsistent, it means that the function of the test object 141 is an unexpected function. Further, the functional test platform 10 can also use the scoreboard component 122 to print and record the verification results for display.
[0073] Specifically, the functional testing platform 10 can associate the uvm_analysis_port interface in the driver component 131 with the same interface as the agent. Then, the reference model component 121 can connect to the agent through the uvm_blocking_get_port interface, thereby establishing a transmission channel between the driver component 131 and the reference model component 121. The driver component 131 can then provide the backup stimulus to the reference model component 121 through this transmission channel.
[0074] See Figure 3 This illustrates a flowchart of another functional testing method. For example... Figure 3 As shown, the method may specifically include the following steps.
[0075] S301: The functional test platform 10 uses directional stimulus to perform functional testing on the test object 141. The directional stimulus is used to test the function of the test object 141.
[0076] Specifically, targeted incentives may include targeted incentive data. For example, the targeted incentive data is 0~255, where 0~99 is used to test the first function of the test object 141, 10~199 is used to test the second function of the test object 141, and 200~255 is used to test the third function of the test object 141.
[0077] S302: Before the functional test platform 10 provides the directional stimulus to the test object 141, the functional test platform 10 uses the coverage acquisition component 114 to acquire the functional coverage of the directional stimulus, wherein the functional coverage is used to indicate the ratio of the directional stimulus to the functionality of the test object 141.
[0078] The functional test platform 10 uses the coverage acquisition component 114 to acquire coverage of the directional stimulus. If the test object 141 has 10 functions, and the directional stimulus acquired by the functional test platform 10 in step S301 only covers 3 functions of the test object, then the functional coverage rate is 30%.
[0079] S303: The functional test platform 10 uses the coverage analysis component 115 to determine whether the coverage of the first function is less than the target coverage.
[0080] S304: If the first functional coverage is less than the target coverage, the functional test platform 10 generates a first random stimulus using the random stimulus generation component 116.
[0081] S305: The functional test platform 10 uses the first random stimulus to perform functional tests on the test object 141.
[0082] Referring to the above method, the functional coverage of the stimuli can be automatically collected multiple times between the functional test platform 10 providing stimuli to the test object 141. If the collected functional coverage is less than the target coverage, new random stimuli are automatically generated for the functions not covered by the stimuli to perform functional testing on the test object 141 until the functional coverage is not less than the target coverage. This effectively improves the functional coverage of the functional test. Furthermore, the above process uses the coverage collection component 104 to automatically determine the functional coverage, thereby improving the efficiency of determining the functional coverage.
[0083] It should be noted that the specific implementation of step S301 in this embodiment is the same as that described above. Figure 2 The implementation of step S201 in the illustrated embodiment is similar, and the specific implementations of steps S303 to S305 are the same as described above. Figure 2The specific implementation methods of steps S203 to S205 in the illustrated embodiment are similar, and can be found in the relevant descriptions above, which will not be repeated here.
[0084] It is worth noting that other reasonable combinations of steps that can be conceived by those skilled in the art based on the above description also fall within the scope of protection of this application. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to this application.
[0085] Based on the functional testing method provided in the above embodiments, this application also provides a functional testing device, which will be described below with reference to the accompanying drawings. Since the principle by which the device in this disclosure solves the problem is similar to the functional testing method described above in this application, the implementation of the device can refer to the implementation of the method, and repeated details will not be elaborated further.
[0086] See Figure 4 As shown, this figure is a structural schematic diagram of a functional testing device provided in an embodiment of this application. Figure 4 As shown, the functional testing device 400 includes:
[0087] The directional testing module 401 is used to perform functional testing on the object under test using directional stimuli, and the directional stimuli are used to test the functionality of the object under test.
[0088] The acquisition module 402 is used to acquire the first functional coverage rate, which is used to indicate the ratio of the function of the test object to be covered during the functional testing of the test object using directional stimulation.
[0089] The judgment module 403 is used to determine whether the first functional coverage is less than the target coverage.
[0090] The generation module 404 is used to generate a first random stimulus when the first functional coverage is less than the target coverage.
[0091] The testing module is used to perform functional testing on the object under test using a first random stimulus.
[0092] In one possible implementation, the acquisition module 402 is specifically used to acquire a second functional coverage rate, which indicates the ratio of the function of the test object to be covered after the test object is functionally tested using a first random stimulus.
[0093] The judgment module is specifically used to determine whether the coverage of the second function is less than the target coverage.
[0094] The generation module is specifically used to generate a second random stimulus when the second functional coverage is less than the target coverage.
[0095] The testing module is specifically used to perform functional testing on the object under test using a second random stimulus.
[0096] In one possible implementation, the functional testing apparatus 400 further includes:
[0097] The detection module is used to detect whether the directional stimulus generation component sends an input request to the stimulus scheduling component, and to detect whether the driving component sends an output request to the stimulus scheduling component.
[0098] The sending module is used to provide the first random stimulus to the driving component by utilizing the stimulus scheduling component when the directional stimulus generation component sends an input request and the driving component sends an output request.
[0099] The first random stimulus is provided to the object under test using the driving component to perform functional testing.
[0100] In one possible implementation, the sending module is specifically used to provide the test object with a first random stimulus after timing conversion using the driving component for functional testing.
[0101] In one possible implementation, the sending module is specifically used to provide a first random stimulus to the object under test through the interface of the proxy unit for functional testing using the driving component.
[0102] In one possible implementation, the functional testing apparatus 400 further includes:
[0103] The backup module is used to back up the first random stimulus using the driver component;
[0104] The sending module is specifically used to provide the backup first random stimulus to the reference model component using the driving component. The reference model component is used to output the expected result, which is the result obtained by the reference model component through inference based on the first random stimulus.
[0105] The first random stimulus is provided to the scoreboard component using the reference model component.
[0106] In one possible implementation, the functional testing apparatus 400 further includes:
[0107] The collection module is used to collect actual results using the monitoring component. The actual results are the output results obtained by the tested object inferring the first random stimulus.
[0108] The sending module is specifically used to provide the actual results to the scoreboard component using the monitoring component; the verification module is used to verify whether the actual results and the expected results are consistent using the scoreboard component. Wherein, if the actual results are consistent with the expected results, the function associated with the first random stimulus in the tested object is the expected function.
[0109] It should be noted that the specific implementation of each module in this embodiment can be found in the relevant descriptions in the above method embodiments. The module division in this application embodiment is illustrative and only represents a logical functional division; in actual implementation, there may be other division methods. In this application embodiment, each functional module can be concentrated in one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. For example, in the above embodiment, the first acquisition module and the holding module can be the same module or different modules.
[0110] In addition, this application embodiment also provides a processor, which, when executing a computer program, implements the above-mentioned... Figures 2 to 3 The method in any of the embodiments shown.
[0111] This application also provides a computer-readable storage medium storing a computer program thereon, wherein the program, when executed by a processor, implements any of the functional testing methods described above.
[0112] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems or apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and relevant parts can be referred to the method section.
[0113] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0114] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0115] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0116] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A functional testing method, characterized in that, This method is executed by a functional testing platform, and the method includes: Functional testing of the test object is performed using targeted stimuli, wherein the targeted stimuli are used to test the function of the test object. A first functional coverage rate is collected, which is used to indicate the ratio of the function of the test object to be covered during the functional testing of the test object using the directional stimulus; Determine whether the coverage rate of the first function is less than the target coverage rate; If the first functional coverage is less than the target coverage, a first random stimulus is generated; The first random stimulus is used to perform functional testing on the object under test.
2. The method according to claim 1, characterized in that, The method further includes: A second functional coverage rate is collected, which indicates the percentage of the functionality of the test object that is covered after the test object is functionally tested using the first random stimulus. Determine whether the coverage of the second function is less than the target coverage; If the second functional coverage is less than the target coverage, a second random stimulus is generated; The second random stimulus is used to perform functional testing on the object under test.
3. The method according to claim 1, characterized in that, The functional testing platform includes an incentive scheduling component, a targeted incentive generation component, and a driving component; The method further includes: Detect whether the directional stimulus generation component sends an input request to the stimulus scheduling component, and detect whether the driving component sends an output request to the stimulus scheduling component; When the directional stimulus generation component sends an input request and the driving component sends an output request, the stimulus scheduling component provides the first random stimulus to the driving component. The first random stimulus is provided to the object under test using the driving component for functional testing.
4. The method according to claim 3, characterized in that, The step of providing the first random stimulus to the object under test using the driving component for functional testing includes: The first random stimulus, after timing conversion using the driving component, is provided to the object under test for functional testing.
5. The method according to claim 3, characterized in that, The incentive scheduling component and the driving component are encapsulated as an input proxy unit, and the interface of the driving component is associated with the interface of the input proxy unit. The step of providing the first random stimulus to the object under test using the driving component for functional testing includes: The first random stimulus is provided to the object under test through the interface of the proxy unit using the driving component for functional testing.
6. The method according to claim 3, characterized in that, The functional testing platform includes a reference model component and a scoreboard component; The method further includes: The first random stimulus is backed up using the driving component; The driving component is used to provide the backed-up first random stimulus to the reference model component, and the reference model component is used to output the expected result, which is the result obtained by the reference model component through inference based on the first random stimulus. The first random stimulus is provided to the scoreboard component using the reference model component.
7. The method according to claim 6, characterized in that, The functional testing platform includes a monitoring component; The method further includes: The monitoring component is used to collect actual results, which are the output results obtained by the tested object inferring the first random stimulus. The monitoring component provides the actual results to the scoreboard component. The scoreboard component is used to verify whether the actual result and the expected result are consistent. If the actual result is consistent with the expected result, the function of the tested object associated with the first random stimulus is the expected function.
8. A functional testing device, characterized in that, The device includes: The targeted testing module is used to perform functional testing on the object under test using targeted stimuli, wherein the targeted stimuli are used to test the functionality of the object under test. The acquisition module is used to acquire a first functional coverage rate, which indicates the ratio of the function of the test object to be covered during the functional testing of the test object using the directional stimulus. The judgment module is used to determine whether the first functional coverage is less than the target coverage. A generation module is configured to generate a first random stimulus when the first functional coverage is less than the target coverage. The testing module is used to perform functional testing on the object under test using the first random stimulus.
9. A processor, characterized in that, The processor is used to execute the functional test method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It stores a computer program, wherein the computer program, when executed by a processor, implements the functional testing method as described in any one of claims 1-7.