SoC test case generation method and device, host and program

By decomposing and storing test requirements data, the system-on-chip test cases are generated, which solves the problems of low manual production efficiency and poor accuracy, and achieves efficient and accurate test cases generation, reducing verification risks.

CN119026534AInactive Publication Date: 2024-11-26SHENZHEN AOWEI LINGXIN TECH CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202411101716.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-11-26
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, manual production of test cases is inefficient and error-prone, resulting in increased resource waste and vulnerability risks during system-on-chip verification.

Method used

By obtaining test requirements data, decompose it into multiple alternative test data and store it in a preset database, selecting the target digital IP and test items, generating corresponding test cases based on the verification template, and reducing manual processing.

Benefits of technology

It improves the efficiency and accuracy of test cases generation, reduces the risk of verification convergence and invalid text processing, and enhances the reliability of test cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119026534A_ABST
    Figure CN119026534A_ABST
Patent Text Reader

Abstract

The invention provides a SoC test case generation method and device, a host and a program.The SoC comprises at least one digital IP, and the SoC test case generation method comprises the steps that test requirement data are obtained, and the test requirement data comprise at least one digital IP and at least one test item corresponding to the digital IP; decomposing the test demand data to form a plurality of alternative test data, and storing the alternative test data in a preset database; selecting a digital IP and a test item corresponding to the target digital IP from the preset database, and storing the digital IP and the test item in a verification template; and generating a test case corresponding to the target digital IP by calling the verification template based on a test case script. By adopting the technical scheme, the generation efficiency and accuracy of the test case can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification relate to the field of computer technology, and in particular to a method, device, host and program for generating test cases for a SoC. Background Art

[0002] With the rapid development of computer technology, System on Chip (SoC) requires a large number of reliable digital IPs to expand its functions. Among these digital IPs, the functions of the digital IPs required are mostly different due to different usage requirements and different usage scenarios required by customers.

[0003] With the advancement of high integration and miniaturization of modern chips, the number of digital IPs required by the system-on-chip is also increasing. In order to ensure the reliability of the system-on-chip, more and more manpower and resources are needed to verify these digital IPs. For example, a system-on-chip requires multiple scenarios with the same or different digital IPs, and more and more test cases are needed.

[0004] However, the manual preparation of test cases increases the probability of errors and is inefficient. Summary of the invention

[0005] In order to solve the above technical problems, the embodiments of this specification provide a method, device, host and program for generating test cases for SoC, which can improve the generation efficiency and accuracy of test cases.

[0006] The embodiment of the present specification provides a test case generation method for a SoC, wherein the SoC includes at least one digital IP, and the test case generation method for the SoC includes:

[0007] Acquire test requirement data, wherein the test requirement data includes at least one digital IP and at least one test item corresponding to the digital IP;

[0008] Decomposing the test requirement data to form a plurality of candidate test data, and storing the data in a preset database;

[0009] Selecting a digital IP and a test item corresponding to the target digital IP from the preset database, and storing them in a verification template;

[0010] Based on the test case script, a test case corresponding to the target digital IP is generated by calling the verification template.

[0011] Optionally, the step of decomposing the test requirement data to form a plurality of candidate test data and storing the plurality of candidate test data in a preset database includes:

[0012] Decomposing the test requirement data by using preset test dimensions to obtain candidate test data of each test dimension, wherein the test dimension includes: at least one of a clock dimension, a reset dimension, an interface dimension, a function dimension, and a performance dimension;

[0013] The candidate test data of each test dimension is converted according to the data format set by the preset database and stored in the preset database.

[0014] Optionally, when the test dimension includes a clock dimension, at least one candidate clock test data is generated by calling a user manual and a description document of the digital IP, and the frequency of at least one of the candidate clock test data corresponds to the digital IP;

[0015] When the test dimension includes a reset dimension, the test requirement data is reset decomposed multiple times to generate multiple candidate reset test data, wherein the reset time of each candidate reset test data is different, and there are candidate reset test signals with different reset types in the multiple candidate reset test data, and in each reset decomposition operation, the reset order of the multiple candidate reset test data is different;

[0016] When the test dimension includes an interface dimension, a plurality of candidate transaction-level test data are generated by initiating a transmission request to the interface of the digital IP, and each candidate transaction-level test data has a delay;

[0017] When the test dimension includes a performance dimension, generating candidate evaluation data based on a data transmission speed requirement within a unit length of the digital IP;

[0018] When the test dimension includes a functional dimension, candidate constraint data for registers of the digital IP is generated based on a test item type of the digital IP.

[0019] Optionally, the verification template includes multiple sub-verification templates, and one sub-verification template corresponds to one test dimension;

[0020] The step of selecting a digital IP and a test item corresponding to the target digital IP from the preset database and storing them in a verification template includes:

[0021] Based on the number of times the target digital IP is used, the test dimensions to be performed for each use, and the number of tests required for each test dimension, target test data is selected from multiple alternative test data and stored in a preset position of the sub-verification template corresponding to the test dimension.

[0022] Optionally, obtaining test requirement data includes:

[0023] During the test of the SoC, obtaining the test requirement data;

[0024] According to the test requirements of the SoC, regularly obtain the test requirement data;

[0025] The test requirement data is manually obtained by a verification engineer.

[0026] Optionally, the step of generating a test case corresponding to the target digital IP by calling the verification template based on the test case script further includes:

[0027] Check the information configured in the test case script, and / or detect whether a verification template exists in the calling path of the test case script.

[0028] Optionally, the test case generation method for the SoC further includes: using the test case to test the SoC.

[0029] The embodiment of this specification also provides a test case generation device for SoC, including:

[0030] The SoC includes at least one digital IP, and the test case generating device of the SoC includes:

[0031] A data acquisition unit, adapted to acquire test requirement data, wherein the test requirement data includes at least one digital IP and at least one test item corresponding to the digital IP;

[0032] A decomposition unit, adapted to decompose the test requirement data to form a plurality of candidate test data, and store the data in a preset database;

[0033] A storage unit, adapted to select a digital IP and a test item corresponding to a target digital IP from the plurality of candidate test data, and store the selected digital IP and the test item in a verification template;

[0034] The processing unit is adapted to generate a test case corresponding to the target digital IP by calling the verification template based on a test case script.

[0035] An embodiment of the present specification also provides a host, comprising: at least one processor and at least one memory, wherein the memory stores one or more computer executable instructions, and the processor calls the one or more computer executable instructions to execute the test case generation method for the SoC as described in any of the above items.

[0036] The embodiments of the present specification also provide a computer program product, including computer instructions, which, when executed by a processor, implement any of the aforementioned methods for generating test cases for a SoC.

[0037] The test case generation method for SoC provided in the embodiment of this specification can, on the one hand, form multiple alternative test data by decomposing the test requirement data to meet the test requirements of the digital IP, and by storing the multiple alternative test data in a preset database, it is convenient for subsequent selection operations; on the other hand, by selecting the digital IP and test items corresponding to the target digital IP from the multiple alternative test data, the current test requirements of the digital IP can be met, and by executing the operations stored in the verification template, the current test requirements of the digital IP can be determined, and then based on the test case script, by calling the verification template, a test case corresponding to the target digital IP is generated without manual processing, thereby improving the efficiency and accuracy of test case generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0039] Figure 1 A flow chart of a method for generating test cases for a SoC in an embodiment of this specification is shown;

[0040] Figure 2 A flowchart showing a process of processing alternative test data in an embodiment of this specification;

[0041] Figure 3 A schematic diagram of the structure of a test case generating device for a SoC in an embodiment of this specification is shown. DETAILED DESCRIPTION

[0042] As described in the background technology, in order to formulate a complete test plan to achieve complete verification convergence, more and more test cases are needed. The same system on a chip requires multiple scenarios with the same or different digital IPs, which generates a lot of text processing work. However, manually completing the production of test cases increases the probability of errors and increases the generation and risk of verification vulnerabilities.

[0043] To solve the above technical problems, a method can be introduced to generate corresponding test cases for the specified number of digital IPs and test cases based on the common digital IP characteristics that verification engineers are concerned about and the requirements and work objectives when completing verification convergence, so as to reduce the corresponding verification convergence risks and invalid text processing work.

[0044] More specifically, the embodiments of the present specification provide a test case generation method for a SoC. On the one hand, by decomposing the test requirement data, a plurality of alternative test data can be formed to meet the test requirements of the digital IP, and by storing the plurality of alternative test data in a preset database, subsequent selection operations are facilitated; on the other hand, by selecting a digital IP and test items corresponding to the target digital IP from the plurality of alternative test data, the current test requirements of the digital IP can be met, and by executing the operations stored in the verification template, the current test requirements of the digital IP can be determined, and then based on the test case script, by calling the verification template, a test case corresponding to the target digital IP is generated without manual processing, thereby improving the efficiency and accuracy of test case generation.

[0045] In order to enable those skilled in the art to better understand the inventive concept, working principle and advantages of the embodiments of this specification, the test case generation scheme of the SoC in the embodiments of this specification is described in detail below.

[0046] Reference Figure 1 The flowchart of a test case generation method for a SoC in an embodiment of the present specification is shown. In some embodiments of the present specification, the SoC includes at least one digital IP.

[0047] Among them, digital IP can refer to a pre-designed and verified digital circuit module used in SoC design.

[0048] In this embodiment, the SoC may include one digital IP, or include multiple digital IPs. The embodiments of this specification do not limit the number of digital IPs, as long as the SoC has digital IPs.

[0049] In this case, if Figure 1 As shown, the test cases can be generated according to the following steps:

[0050] S11, obtaining test requirement data.

[0051] In a specific implementation, the test requirement data may refer to data that meets the SoC test requirements, which can meet the requirements of performing various tests on the SoC to detect whether the SoC can meet the design requirements. By obtaining the test requirement data, the overall performance requirements of the SoC and the performance requirements for a specific processing process can be verified.

[0052] For example, the test requirement data can test the input function, data processing function, etc. of the SoC.

[0053] In a specific implementation, the test requirement data may include at least one digital IP and at least one test item corresponding to the digital IP.

[0054] In some optional examples, the test items of the digital IP may include the number of test instances and the test cases required for each test instance (ie, the operating scenarios required for the digital IP).

[0055] In some embodiments, the test requirement data may exist in the form of key-value pairs.

[0056] S12, decomposing the test requirement data to form a plurality of candidate test data, and storing the data in a preset database.

[0057] In a specific implementation, the test requirement data includes different dimensions and test requirements of different digital IPs, and different digital IPs have their own characteristics, and the test requirements they require are not exactly the same, so the test requirement data can be decomposed to form multiple candidate test data. Since multiple candidate test data can cover the test requirements of all digital IPs, multiple candidate test data can meet the test requirements of any digital IP in the SoC.

[0058] Furthermore, by storing multiple candidate test data in a preset database, subsequent selection operations are facilitated, so that for any specific digital IP, there is no need to perform decomposition operations, thereby reducing the test case generation time.

[0059] In a specific implementation, the preset database may be located in a local server or in a cloud server. The embodiments of this specification do not impose any restrictions on the location of the preset database, as long as it can store the alternative test data.

[0060] As an optional example, the preset database may be one or more of a distributed database, a data warehouse, a JavaScript Object Notation (JSON) database, and the like.

[0061] S13, selecting a digital IP and a test item corresponding to the target digital IP from the preset database, and storing them in a verification template.

[0062] In a specific implementation, a preset database stores multiple alternative test data, and the alternative test data reflects all test data of the SoC. Different digital IPs have different characteristics, and naturally require different test items. Therefore, a digital IP corresponding to the target digital IP (which can be understood as the digital IP to be performance tested this time) and the decomposed test items of the digital IP can be selected from multiple alternative test data to be stored in the verification template.

[0063] In some embodiments, the verification template may serve as candidate test data and a running environment for test cases generated based on the candidate test data.

[0064] S14, based on the test case script, by calling the verification template, a test case corresponding to the target digital IP is generated.

[0065] The test case script refers to a set of automated scripts used to generate test cases and can be applied to SoC testing.

[0066] In a specific implementation, the test case script can automatically call the verification template, and based on the data stored in the verification template and according to its own logic, generate a test case corresponding to the target digital IP, which can improve the efficiency of test case generation.

[0067] Therefore, by adopting the above embodiment, on the one hand, by decomposing the test requirement data, multiple alternative test data can be formed to meet the test requirements of the digital IP, and by storing the multiple alternative test data in a preset database, it is convenient for subsequent selection operations; on the other hand, by selecting the digital IP and test items corresponding to the target digital IP from the multiple alternative test data, the current test requirements of the digital IP can be met, and by executing the operations stored in the verification template, the current test requirements of the digital IP can be determined, and then based on the test case script, by calling the verification template, a test case corresponding to the target digital IP is generated, without manual processing, thereby improving the generation efficiency and accuracy of the test case. In order to enable those skilled in the art to better understand and implement the embodiments of this specification, the following is described in detail with reference to the accompanying drawings and through specific examples.

[0068] First, in specific implementation, multiple methods can be used to obtain test requirement data.

[0069] For example, the test requirement data is obtained during the test of the SoC, that is, the tester obtains the test requirement data while testing the SoC, thereby improving the real-time performance of the test requirement data, and further improving the real-time performance and accuracy of the test case generation process.

[0070] For another example, test requirement data may be acquired regularly according to the test requirements of the SoC.

[0071] For another example, the test requirement data may be manually acquired by a verification engineer. In a specific implementation, if due to network reasons or to avoid missed transmission, the test requirement data may be manually acquired by a verification engineer.

[0072] As can be seen from the above, at least one of the above three methods can be used to obtain test requirement data, which can improve the flexibility of obtaining test requirement data and thus can be applied to different application scenarios as needed.

[0073] It is understandable that the method of obtaining test requirement data provided in the above embodiment is only an example, which is only used to illustrate that the test case generation of the SoC in the embodiment of this specification can obtain test requirement data in a timely manner, and is not to be understood as a limitation of the present invention.

[0074] For example, in some other embodiments, the tester may also obtain the test requirement data according to the test result after completing the test process of one of the digital IPs of the SoC.

[0075] In specific applications, multiple digital IP test case generation processes may be performed simultaneously, and the formats of the test requirement data used by these test cases may be different. In order to improve the consistency and reliability of the acquired test requirement data, it is convenient to decompose the test requirement data. The test requirement data that meets the interface requirements can be obtained through the preset communication interface.

[0076] Specifically, by presetting the communication interface, the test requirement data will be obtained only when it is determined that the test requirement data meets the interface requirements. Otherwise, the type of the test requirement data will be directly discarded or converted. This can avoid illegal access and can also obtain test cases more efficiently according to user needs.

[0077] In a specific implementation, the definition and protocol of the communication interface used can be set according to the requirements and application scenarios to facilitate testing of the required data.

[0078] In some optional examples, the preset communication interface may be a Representational State Transfer API (Restful API).

[0079] In some other embodiments of this specification, the preset communication interface may also be a Simple Object Access Protocol (SOAP) API. The embodiments of this specification do not limit the type of communication interface, as long as the test demand data that meets the interface requirements can be obtained through the preset communication interface.

[0080] In some other embodiments, the test requirement data may be directly acquired without considering information such as the type and data format of the test requirement data.

[0081] In some embodiments of the present specification, when the test requirement data is acquired, the test requirement data may be decomposed according to different dimensions and stored.

[0082] See also Figure 2 A flowchart of a process for processing alternative test data in an embodiment of this specification is shown in FIG. Figure 2 As shown, including:

[0083] S21, using preset test dimensions to decompose the test requirement data to obtain candidate test data for each test dimension.

[0084] In specific implementations, for different digital IPs, the focus is not exactly the same when testing the digital IPs, that is, different digital IPs have different test dimensions, so the test requirement data can be decomposed according to the set test dimensions so that the alternative test data can cover all test dimensions to meet the test requirements of different digital IPs.

[0085] In this embodiment, the test dimensions may include: at least one of: clock dimension, reset dimension, interface dimension, function dimension and performance dimension, so that alternative test data under these five test dimensions can be obtained to meet the test requirements of different digital IPs.

[0086] In an optional embodiment, the test dimension may include both the clock dimension and the reset dimension, as well as the clock dimension, the reset dimension and the interface dimension, etc. The embodiments of this specification do not impose any restrictions on the types and type combinations of test dimensions, as long as the test requirement data can be decomposed.

[0087] It should be noted that, in the step of obtaining the test requirement data, an enable signal may also be obtained at the same time, and the test dimension to be executed may be determined based on the state of the enable signal.

[0088] More specifically, the enable signal may include: clk_en, rst_en, interface_en, perf_en, and function_en. When clk_en is triggered, the test requirement data is decomposed in the clock dimension; when rst_en is triggered, the test requirement data is decomposed in the reset dimension; when interface_en is triggered, the test requirement data is decomposed in the interface dimension; when perf_en is triggered, the test requirement data is decomposed in the performance dimension; when function_en is triggered, the test requirement data is decomposed in the function dimension.

[0089] In a specific implementation, different types of test dimensions have different decomposition processes when performing decomposition operations.

[0090] For example, when the test dimension includes a clock dimension, at least one alternative clock test data is generated by calling the user manual and description document (ie, spec / databook file) of the digital IP, and the frequency of the at least one alternative clock test data corresponds to the digital IP.

[0091] Among them, the spec file is used to describe the functions of the digital IP, and the databook file is generally used for a detailed introduction to the digital IP.

[0092] In a specific example, the clock is essentially a periodic signal in the simulation platform, which is a signal of "1" for a period of time and "0" for a period of time, and the two periods of time are usually equal or unequal. Multiple clocks means multiple signals, and different frequencies will make the corresponding times different. When the test requirement data is obtained, the clock can be decomposed according to the clock in the test requirement data through a pre-packaged program.

[0093] For example, always#(clk_period)clk=~clk is used to generate a corresponding clock, wherein clk_period is the corresponding clock period, so that it can be encapsulated as the underlying code logic.

[0094] Furthermore, the gen_ip_clk(input int clk_num, iuput real clk_freq[]) method is used to call gen_clk according to the number of input clocks, so that different clocks matching the test dimensions can be generated according to different digital IPs, for example, the number and frequency of clocks.

[0095] For example, when the test dimension includes a reset dimension, the test requirement data is reset decomposed multiple times to generate multiple alternative reset test data, wherein the reset time of each alternative reset test data is different, and there are alternative reset test signals of different reset types in the multiple alternative reset test data, and in each reset decomposition operation, the reset order of the multiple alternative reset test data is different.

[0096] In a specific example, the reset parameters come from a databook file, including synchronous reset and asynchronous reset. Synchronous reset means that the reset is triggered at the edge of the clock (such as the rising edge), and asynchronous reset means that the reset is independent of the clock edge. The relationship between the reset and the clock can be determined based on whether it is a synchronous reset or an asynchronous reset.

[0097] In the scenario of multiple resets, since the reset order may have different effects on the SoC, when performing multiple reset decompositions, the reset decomposition method should support different reset orders and types for each call.

[0098] For example, if a reset decomposition operation is performed and three reset signals are generated, the first reset signal is a synchronous reset signal, the second reset signal and the third reset signal are asynchronous reset signals, and the reset generation time is any clock between 0 and x, x is a random value and the random values ​​of different reset signals are different. In the repeated running of the test case, the repeatedly called reset method can cover the reset order.

[0099] It should be noted that, first, the reason for performing multiple reset decompositions is that a normally operating digital IP should be able to restore normal perception after multiple resets, so as to verify the reset performance of the digital IP; second, the reset method can produce different reset results in each call of the test case due to the compiler and random methods.

[0100] For another example, when the test dimension includes the interface dimension, a transmission request is initiated to the interface of the digital IP to generate a plurality of candidate transaction-level test data, and there is a delay between each candidate transaction-level test data.

[0101] In a specific example, in the verification methodology, the transmission of interface data is initiated by transaction level, and the data is converted into data stream on the interface to complete the transmission. The transaction level is the abstract level of the interface. In the commonality of SoC testing, there is a need to stimulate the interface, usually to implement several transactions, and the intervals between each transaction are different.

[0102] In some embodiments, the generation operation of multiple candidate transaction-level test data may be implemented through gen_transaction(input int tr_num, input int tr_delay).

[0103] Where tr_num is the number of transactions, tr_delay is the delay of the transaction, and gen_transaction is the decomposition parameter.

[0104] For another example, when the test dimension includes a performance dimension, alternative evaluation data is generated based on the data transmission speed requirement within a digital IP unit length.

[0105] In a specific example, during the data sampling process, the bandwidth of data within a certain time length can be obtained. From the perspective of the test case, a test case has different evaluation criteria for the performance of the SoC. For example, a test case needs to send all short packets, and its pps (packet per second) or bbs (byte per second) may be very large. A test case needs to send all long packets, so the pps or bbs may be very small. Different test cases require different evaluation criteria.

[0106] In an optional example, alternative evaluation data may be generated by perf_analysis(input int type, input int max, input int min) to define upper and lower limits of performance.

[0107] For another example, when the test dimension includes a functional dimension, candidate constraint data for registers of the digital IP is generated based on the test item type of the digital IP.

[0108] In a specific example, the register configuration of SoC is usually stored in a class or data structure in ral (register abstraction layer). Different test cases have different constraints on registers. For example, if an IP has only three registers (Int a, Int b and Int c) that need to be configured, gen_cfg (input ral, output ral) can be used. Each time gen_cfg is called, the register configuration that meets the test case requirements can be generated randomly with constraints.

[0109] It should be noted that when performing constraint configuration, for randomized registers, a randomization function in the class will be called each time a register configuration is generated. If a specific value is required, a specific value can be generated, and if a specific value is not required, a randomized value exists.

[0110] S22, converting the candidate test data of each test dimension according to the data format set in the preset database, and storing the converted data in the preset database.

[0111] In a specific implementation, the candidate test data of each test dimension can be converted according to the data format set by the preset database and stored in the preset database. By converting the format of the candidate test data, the consistency of the alternative test data format can be improved, which is convenient for management and generation operations, and can also avoid downtime caused by abnormal alternative test data format, thereby improving the reliability and stability of the test case generation process.

[0112] In some optional examples, during the data format conversion process, an exception error handling process can be added to process some alternative test data with abnormal formats (for example, the alternative test data is a null pointer) to further improve the stability of the test case generation method.

[0113] In some embodiments, the structure of the database may be predefined to facilitate conversion of the data format of the candidate test data so that the database may store the candidate test data in a structured manner, that is, candidate test data of corresponding attributes may be stored in a plurality of different fields.

[0114] In some embodiments of the present specification, when the test requirement data is decomposed through preset test dimensions, the verification template may include multiple sub-verification templates, and one sub-verification template corresponds to one test dimension, that is, different sub-verification templates are used to store alternative test data under the corresponding test dimension. In this way, data stored in different sub-verification templates can be obtained in parallel, thereby improving the efficiency of test case generation.

[0115] In this case, the steps of selecting the digital IP and test items corresponding to the target digital IP from the preset database and storing them in the verification template include: based on the number of times the target digital IP is used, the test dimensions to be performed for each use, and the number of tests required for each test dimension, selecting target test data from multiple alternative test data, and storing them in the preset position of the sub-verification template corresponding to the test dimension.

[0116] Specifically, after the test requirement data is decomposed according to the preset test dimensions, the verification engineer can determine the type of digital IP to be processed and the number of times each digital IP is used based on the current test requirements, and determine the test dimensions required for each digital IP based on the use case instances, as well as the number of test cases that need to be generated under each test dimension, and determine the functions implemented by the test case script in turn.

[0117] In some optional embodiments, the target test data may be stored at a preset location of the sub-verification template through keyword indexing to implement an output filling operation.

[0118] For example, one of the functions in one of the sub-verification templates is named gen_transaction(), and the general code is aaa, and the code to be replaced is ***. At this time, the function cannot test the characteristics of the current digital IP. At this time, through keyword indexing, write the verification code for the current digital IP to replace the code to be replaced and complete the test of the current digital IP characteristics.

[0119] In some embodiments, there may be no data in the sub-verification template, or the data stored in the sub-verification template is the data of other sub-verification templates, so that when the sub-verification template is called, the test case of the required test dimension cannot be generated or is not fully generated.

[0120] Based on this, before calling the verification template, it is also possible to verify whether the sub-verification template has data and whether the data matches the sub-verification template.

[0121] By adopting the test case generation method of SoC in the above example, the test requirement data can be decomposed according to at least one dimension of the clock dimension, reset dimension, interface dimension, function dimension and performance dimension, and the target test data of the target digital IP can be stored based on the verification template, and then by calling the verification template, a test case corresponding to the target digital IP can be generated.

[0122] In some embodiments of the present specification, in the step of generating a test case corresponding to the target digital IP by calling a verification template based on a test case script, the test case generation method of the SoC may further include: checking the information configured in the test case script, and / or detecting whether a verification template exists in the calling path of the test case script to improve the accuracy of the test case generation.

[0123] For example, check the clock information, reset information, etc. configured in the test case script. If it is determined that the test case script lacks the corresponding configuration information, stop executing the current test case generation process or modify the test case script.

[0124] For another example, if the calling path of the test case script does not contain a verification template, the required test case information of the target IP cannot be obtained, and thus the test case cannot be generated.

[0125] It should be noted that when executing the above steps, when an anomaly is detected in the test case script, a corresponding alarm message is generated to improve the security of the test case generation solution and the user interaction experience.

[0126] In some embodiments of the present specification, when it is determined that the configuration information of the test case script is normal, the generated test case may include: the number of test instances of the target digital IP, the number of test cases of each test instance and the verification environment.

[0127] That is, the test case script is used to provide the verification environment used by the test case.

[0128] For example, if a target digital IP has three test instances, the first test instance requires seven test cases, the second test instance requires nine test cases, and the third test instance requires eleven test cases. After running the test case script, 7+9+11=27 test cases and the verification environments corresponding to the three instances can be generated.

[0129] The verification environment specifies when and where the clock is generated, when and where the configuration is completed, when and where the stimulus is generated and injected, and when and where the performance is compared and evaluated.

[0130] More specifically, the framework of the verification environment is fixed. For example, clock reset is generated at the top level of the verification environment, data required for use cases is generated in build_phase, configuration is issued in configure_phase, stimulus is issued in main_phase, and performance evaluation is completed in report.

[0131] In the embodiments of the present specification, after a test case is generated by calling a verification template based on a test case script, the test case can also be used to test the SoC.

[0132] In short, the solution in the embodiment of the present disclosure first decomposes the test requirement data based on the five dimensions of clock, reset, interface, function and performance, and stores it in a database; then, based on the test requirements input by the verification engineer, data that meets the current digital IP test is selected from the database and filled into the blank spaces of the verification template; finally, the script calls the verification template to generate test cases and a verification environment, wherein the verification environment body can be regarded as a folder, which contains hierarchical code components and is encapsulated in a software package (such as a verification template). After the script is called, a software package will be automatically generated, and then a verification environment will be generated.

[0133] This specification also provides a test case generation device for SoC corresponding to the test case generation method for SoC described above, which is described in detail below through specific embodiments with reference to the accompanying drawings.

[0134] Reference Figure 3 The structure diagram of a test case generating device of a SoC in an embodiment of the present specification is shown. In some embodiments of the present specification, the SoC includes at least one digital IP.

[0135] Among them, digital IP can refer to a pre-designed and verified digital circuit module used in SoC design.

[0136] In this embodiment, the SoC may include one digital IP, or include multiple digital IPs. The embodiments of this specification do not limit the number of digital IPs, as long as the SoC has digital IPs.

[0137] In this case, if Figure 3 As shown, the test case generating device 100 for SoC may include:

[0138] The data acquisition unit 110 is adapted to acquire test requirement data, wherein the test requirement data includes at least one digital IP and at least one test item corresponding to the digital IP;

[0139] A decomposition unit 120, adapted to decompose the test requirement data to form a plurality of candidate test data, and store the plurality of candidate test data in a preset database;

[0140] The storage unit 130 is adapted to select a digital IP and a test item corresponding to the target digital IP from the plurality of candidate test data, and store them in the verification template;

[0141] The processing unit 140 is adapted to generate a test case corresponding to the target digital IP by calling the verification template based on the test case script.

[0142] It is understandable that the division of the above units is only a division of logical functions, and in actual implementation, they can be fully or partially integrated into one physical entity, or physically separated. In addition, the above units can be implemented in the form of a processor calling software.

[0143] The test case generation device 100 using the above-mentioned SoC, on the one hand, can form multiple alternative test data to meet the test requirements of the digital IP by decomposing the test requirement data through the decomposition unit 120, and facilitate subsequent selection operations by storing the multiple alternative test data in a preset database; on the other hand, the digital IP and test items corresponding to the target digital IP are selected from the multiple alternative test data by the processing unit 140, so as to meet the current test requirements of the digital IP, and the current test requirements of the digital IP can be determined by executing the operations stored in the verification template, and then the processing unit 140 can generate a test case corresponding to the target digital IP based on the test case script by calling the verification template, without manual processing, thereby improving the generation efficiency and accuracy of the test case.

[0144] In order to enable those skilled in the art to better understand and implement, specific implementation examples of the data acquisition unit, the decomposition unit, the storage unit and the processing unit are described below.

[0145] In some embodiments of the present specification, the data acquisition unit may acquire the test requirement data in a variety of ways.

[0146] For example, the data acquisition unit can acquire the test requirement data during the test process of the SoC. That is, the tester acquires the test requirement data while testing the SoC, thereby improving the real-time performance of the test requirement data, and further improving the real-time performance and accuracy of the test case generation process. For another example, the data acquisition unit can acquire the test requirement data regularly according to the test requirements of the SoC. Thus, the flexibility of acquiring the test requirement data can be improved, and different application scenarios can be applied as needed.

[0147] In specific applications, multiple digital IP test case generation processes may be performed simultaneously, and the formats of the test requirement data used in these test cases may be different. In order to improve the consistency and reliability of the acquired test requirement data, it is convenient to decompose the test requirement data. The data acquisition unit can acquire the test requirement data that meets the interface requirements through a preset communication interface.

[0148] Specifically, by presetting the communication interface, the test requirement data will be obtained only when it is determined that the test requirement data meets the interface requirements. Otherwise, the type of the test requirement data will be directly discarded or converted. This can avoid illegal access and can also obtain test cases more efficiently according to user needs.

[0149] In some optional examples, the preset communication interface may be a RESTful API or a SOAP API. The embodiments of this specification do not limit the type of the communication interface, as long as the test demand data that meets the interface requirements can be obtained through the preset communication interface.

[0150] In some other embodiments, the test requirement data may be directly acquired without considering information such as the type and data format of the test requirement data.

[0151] In some embodiments of the present specification, when the test requirement data is acquired, the decomposition unit may decompose the test requirement data according to different dimensions and store the decomposition unit.

[0152] In some embodiments, the test dimensions may include: at least one of: clock dimension, reset dimension, interface dimension, function dimension and performance dimension, so that alternative test data under these five test dimensions can be obtained to meet the test requirements of different digital IPs.

[0153] The operation of decomposing the test requirement data using the preset test dimensions can be seen in the example.

[0154] Furthermore, the decomposition unit can convert the candidate test data of each test dimension according to the data format set by the preset database and store it in the preset database. By converting the format of the candidate test data, the consistency of the alternative test data format can be improved, which is convenient for management and generation operations, and can also avoid downtime caused by abnormal alternative test data format, thereby improving the reliability and stability of the test case generation process.

[0155] In some optional examples, during the data format conversion process, an exception error handling process can be added to process some alternative test data with abnormal formats (for example, the alternative test data is a null pointer) to further improve the stability of the test case generation method.

[0156] In some embodiments, the structure of the database may be predefined to facilitate conversion of the data format of the candidate test data so that the database may store the candidate test data in a structured manner, that is, candidate test data of corresponding attributes may be stored in a plurality of different fields.

[0157] In a specific implementation, the storage unit may include any suitable type of memory unit, memory device, memory article, memory medium, storage device, storage article, storage medium and / or storage unit, such as memory, removable or non-removable medium, erasable or non-erasable medium, writable or rewritable medium, digital or analog medium, hard disk, floppy disk, compact disk read only memory (CDROM), compact disk recordable (CD-R), compact disk rewritable (CD-RW), optical disk, magnetic medium, magneto-optical medium, removable memory card or disk, various types of digital versatile disks (DVD), magnetic tape, cassette, etc.

[0158] In some embodiments, data storage may be performed using MySQL.

[0159] In some embodiments of the present specification, in the step of generating a test case corresponding to the target digital IP by calling a verification template based on the test case script, the processing unit may also: check the information configured in the test case script, and / or detect whether a verification template exists in the calling path of the test case script to improve the accuracy of test case generation.

[0160] For example, the clock information, reset information, etc. in the information configured in the test case script are checked. If it is determined that the test case script lacks the corresponding configuration information, the processing unit stops executing the current test case generation process or modifies the test case script.

[0161] For another example, if the calling path of the test case script does not contain a verification template, the required test case information of the target IP cannot be obtained, and thus the test case cannot be generated.

[0162] It should be noted that when executing the above steps, when an anomaly is detected in the test case script, a corresponding alarm message is generated to improve the security of the test case generation solution and the user interaction experience.

[0163] In some embodiments of the present specification, when it is determined that the configuration information of the test case script is normal, the generated test case may include: the number of test instances of the target digital IP, the number of test cases of each test instance and the verification environment.

[0164] That is, the test case script is used to provide the verification environment used by the test case.

[0165] For example, if a target digital IP has three test instances, the first test instance requires seven test cases, the second test instance requires nine test cases, and the third test instance requires eleven test cases. After running the test case script, 7+9+11=27 test cases and the verification environments corresponding to the three instances can be generated.

[0166] In some optional examples, after generating a test case by calling a verification template based on a test case script, the processing unit may also use the test case to test the SoC.

[0167] The embodiment of this specification also provides a host suitable for implementing a test case generation method for SoC, wherein the host includes a central processing unit (CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage portion to a random access memory (RAM), such as executing the method described in the above embodiment. In RAM, various programs and data required for system operation are also stored. CPU, ROM and RAM are connected to each other via a bus. The input / output (I / O) interface is also connected to the bus.

[0168] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication part performs communication processing via a network such as the Internet. The drive 310 is also connected to the I / O interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.

[0169] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), various functions defined in the system of the present application are executed.

[0170] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0171] In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0172] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0173] The units involved in the embodiments of the present invention may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, limit the units themselves.

[0174] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above-mentioned various optional implementations.

[0175] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.

[0176] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0177] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0178] Although the embodiments of this specification are disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, so the protection scope of the present invention shall be subject to the scope defined by the claims.

Claims

1. A method for generating test cases for a SoC, characterized in that: The SoC includes at least one digital IP, and the test case method of the SoC includes: Acquire test requirement data, wherein the test requirement data includes at least one digital IP and at least one test item corresponding to the digital IP; Decomposing the test requirement data to form a plurality of candidate test data, and storing the data in a preset database; Selecting a digital IP and a test item corresponding to the target digital IP from the preset database, and storing them in a verification template; Based on the test case script, a test case corresponding to the target digital IP is generated by calling the verification template.

2. The test case generation method for SoC according to claim 1, characterized in that: The step of decomposing the test requirement data to form a plurality of candidate test data and storing the data in a preset database includes: Decomposing the test requirement data by using preset test dimensions to obtain candidate test data of each test dimension, wherein the test dimension includes: at least one of a clock dimension, a reset dimension, an interface dimension, a function dimension, and a performance dimension; The candidate test data of each test dimension is converted according to the data format set by the preset database and stored in the preset database.

3. The test case generation method for SoC according to claim 2, characterized in that: When the test dimension includes a clock dimension, at least one candidate clock test data is generated by calling a user manual and a description document of the digital IP, and the frequency of at least one of the candidate clock test data corresponds to the digital IP; When the test dimension includes a reset dimension, the test requirement data is reset decomposed multiple times to generate multiple candidate reset test data, wherein the reset time of each candidate reset test data is different, and there are candidate reset test signals with different reset types in the multiple candidate reset test data, and in each reset decomposition operation, the reset order of the multiple candidate reset test data is different; When the test dimension includes an interface dimension, a plurality of candidate transaction-level test data are generated by initiating a transmission request to the interface of the digital IP, and each candidate transaction-level test data has a delay; When the test dimension includes a performance dimension, generating candidate evaluation data based on a data transmission speed requirement within a unit length of the digital IP; When the test dimension includes a functional dimension, candidate constraint data for registers of the digital IP is generated based on a test item type of the digital IP.

4. The test case generation method for SoC according to claim 2, characterized in that: The verification template includes multiple sub-verification templates, and one sub-verification template corresponds to one test dimension; The step of selecting a digital IP and a test item corresponding to the target digital IP from the preset database and storing them in a verification template includes: Based on the number of times the target digital IP is used, the test dimensions to be performed for each use, and the number of tests required for each test dimension, target test data is selected from multiple alternative test data and stored in a preset position of the sub-verification template corresponding to the test dimension.

5. The test case generation method for SoC according to claim 1, characterized in that: The obtaining of test requirement data includes: During the test of the SoC, obtaining the test requirement data; According to the test requirements of the SoC, regularly obtain the test requirement data; The test requirement data is manually obtained by a verification engineer.

6. The test case generation method for SoC according to claim 1, characterized in that: The step of generating a test case corresponding to the target digital IP by calling the verification template based on the test case script also includes: Check the information configured in the test case script, and / or detect whether a verification template exists in the calling path of the test case script.

7. The test case generation method for SoC according to claim 1, characterized in that: Also includes: The SoC is tested using the test case.

8. A test case generation device for SoC, characterized in that: The SoC includes at least one digital IP, and the test case generating device of the SoC includes: A data acquisition unit, adapted to acquire test requirement data, wherein the test requirement data includes at least one digital IP and at least one test item corresponding to the digital IP; A decomposition unit, adapted to decompose the test requirement data to form a plurality of candidate test data, and store the data in a preset database; A storage unit, adapted to select a digital IP and a test item corresponding to a target digital IP from the plurality of candidate test data, and store the selected digital IP and the test item in a verification template; The processing unit is adapted to generate a test case corresponding to the target digital IP by calling the verification template based on a test case script.

9. A host, characterized in that: include: At least one processor and at least one memory, the memory storing one or more computer executable instructions, the processor calling the one or more computer executable instructions to execute the test case generation method for SoC as described in any one of claims 1 to 7.

10. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the test case generation method for the SoC according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for generating test case

    CN104572031A

  • Semiconductor automatic test equipment and test method for improving test flow efficiency

    CN111381142A

  • Chip verification method and device and storage medium

    CN116245074A

  • Query method and device of semiconductor test data, electronic equipment and storage medium

    CN116303627A

  • Test data processing method and device, computer equipment and storage medium

    CN117435651A