CN114385132A - Assertion code generation method, device, equipment and medium - Google Patents

Assertion code generation method, device, equipment and medium Download PDF

Info

Publication number
CN114385132A
CN114385132A CN202111594357.3A CN202111594357A CN114385132A CN 114385132 A CN114385132 A CN 114385132A CN 202111594357 A CN202111594357 A CN 202111594357A CN 114385132 A CN114385132 A CN 114385132A
Authority
CN
China
Prior art keywords
natural language
assertion
target
scene
language description
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111594357.3A
Other languages
Chinese (zh)
Inventor
朱雷
杨静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Original Assignee
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd filed Critical Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority to CN202111594357.3A priority Critical patent/CN114385132A/en
Publication of CN114385132A publication Critical patent/CN114385132A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Library & Information Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a method, a device, equipment and a medium for generating an assertion code, wherein the method comprises the following steps: acquiring natural language description, analyzing the natural language description, and determining a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters; determining a target assertion scene corresponding to a predefined natural language scene based on the predefined natural language scene and a preset mapping table; inquiring a target configuration template corresponding to a target assertion scene and used for constructing an assertion code from a preset configuration template library; and filling the user configuration parameters into the target configuration template to generate target assertion codes corresponding to the natural language description. Therefore, the method for converting the natural language description into the assertion code can obtain the required assertion code without learning the assertion description, so that the complicated assertion description does not need to be learned in assertion verification, the learning cost is reduced, and the verification efficiency is improved.

Description

Assertion code generation method, device, equipment and medium
Technical Field
The present invention relates to the field of chip verification, and in particular, to a method, an apparatus, a device, and a medium for generating an assertion code.
Background
At present, the integrated circuit industry develops rapidly for the chip scale is huge gradually, and the complexity improves gradually, need guarantee chip quality at this in-process, and this has brought the examination for the chip verification process, has improved the verification degree of difficulty.
In chip verification, assertion verification is an extremely important component. The assertion description based on SystemVerilog language (SV language for short) is most commonly used in the industry at present. The assertion in the chip verification actually describes the relationship between signals in the form of a boolean expression, and defaults that the value of the boolean expression is true at a specific time; an Electronic Design Automation (EDA) tool automatically calculates whether the relationship between signals violates the assertion in simulation, and if so, the method can isolate design errors in an early design stage, thereby saving debug time. However, although this method is powerful, it requires a priori knowledge of SV assertion language, which increases the learning cost of engineers and limits their further popularization in industry.
In summary, how to reduce the learning cost and improve the verification efficiency becomes an urgent problem to be solved.
Disclosure of Invention
In view of this, the present invention provides an assertion code generating method, apparatus, device, and medium, so that the assertion verification does not need to learn complicated assertion language knowledge, the learning cost can be reduced, and the verification efficiency can be improved. The specific scheme is as follows:
in a first aspect, the present application discloses a method for generating an assertion code, including:
acquiring natural language description input by a user terminal, and analyzing the natural language description to determine a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters;
determining a target assertion scene corresponding to the predefined natural language scene based on the predefined natural language scene and a preset mapping table;
inquiring a target configuration template which corresponds to the target assertion scene and is used for constructing an assertion code from a preset configuration template library;
and filling the user configuration parameters into the target configuration template to generate target assertion codes corresponding to the natural language description.
Optionally, the parsing the natural language description to determine a predefined natural language scene corresponding to the natural language description and a corresponding user configuration parameter includes:
analyzing the natural language description, and judging whether the analyzed natural language meets the preset format requirement or not;
if the analyzed natural language meets the preset format requirement, determining a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters;
and if the analyzed natural language does not meet the preset format requirement, sending an error report and sending an instruction for modifying the natural language description.
Optionally, the populating the user configuration parameter into the target configuration template to generate a target assertion code corresponding to the natural language description includes:
determining whether the user configuration parameters have missing parameters by comparing the user configuration parameters with the parameters to be configured in the target configuration template;
if the user configuration parameters do not have missing parameters, filling the user configuration parameters into the target configuration template to generate target assertion codes corresponding to the natural language description;
and if the user configuration parameters have missing parameters, filling the user configuration parameters into the target configuration template, and then configuring the parameters which are not configured in the current target configuration template by using default parameters in the target configuration template so as to generate a target assertion code corresponding to the natural language description.
Optionally, the method for generating an assertion code further includes:
determining different predefined natural language scenes respectively corresponding to the different assertion scenes;
and constructing a corresponding mapping table based on the corresponding relation between the assertion scene and the predefined natural language scene to obtain the preset mapping table.
Optionally, the parsing the natural language description to determine a predefined natural language scene corresponding to the natural language description and a corresponding user configuration parameter includes:
analyzing the natural language description input line by using an analyzer constructed based on a regular expression in advance to determine a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters.
Optionally, after the populating the target configuration template with the user configuration parameters to generate a target assertion code corresponding to the natural language description, the method further includes:
and the target assertion code is contained in a chip verification environment corresponding to a chip to be verified, and a signal corresponding to the target assertion code is connected with the chip to be verified so as to perform assertion verification on the chip to be verified.
Optionally, after parsing the natural language description, the method further includes:
and if no user configuration parameter exists in the analyzed natural language, configuring the parameter to be configured in the target configuration template by using the default parameter in the target configuration template so as to generate a target assertion code corresponding to the natural language description.
In a second aspect, the present application discloses an assertion code generating apparatus, including:
the analysis module is used for acquiring natural language description input by a user terminal and analyzing the natural language description to determine a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters;
the assertion scene determining module is used for determining a target assertion scene corresponding to the predefined natural language scene based on the predefined natural language scene and a preset mapping table;
the configuration template query module is used for querying a target configuration template which corresponds to the target assertion scene and is used for constructing an assertion code from a preset configuration template library;
and the assertion code generation module is used for filling the user configuration parameters into the target configuration template so as to generate target assertion codes corresponding to the natural language description.
In a third aspect, the present application discloses an electronic device comprising a processor and a memory; wherein the processor implements the assertion code generating method disclosed above when executing the computer program stored in the memory.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the assertion code generation method disclosed above.
Therefore, the method and the device for the natural language description analysis acquire the natural language description input by the user terminal, and analyze the natural language description to determine a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters; determining a target assertion scene corresponding to the predefined natural language scene based on the predefined natural language scene and a preset mapping table; inquiring a target configuration template which corresponds to the target assertion scene and is used for constructing an assertion code from a preset configuration template library; and filling the user configuration parameters into the target configuration template to generate target assertion codes corresponding to the natural language description. Therefore, the method for converting the natural language description into the assertion code can obtain the required assertion code without learning the assertion description, so that the complicated assertion description does not need to be learned in the assertion verification, the learning cost is reduced, the verification efficiency is improved, and the popularization of the assertion verification in the chip verification industry is facilitated.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 provides a flowchart of a method for generating assertion code;
FIG. 2 provides a flowchart of a specific assertion code generation method;
FIG. 3 provides a diagram of a specific assertion code generation method;
FIG. 4 is a diagram illustrating a specific assertion code generation method according to the present application;
FIG. 5 is a schematic diagram of an assertion code generating apparatus according to the present application;
fig. 6 provides a block diagram of an electronic device according to the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Currently, assertion verification can be performed on a chip to be verified only by virtue of preposed SV assertion language knowledge, so that the learning cost of engineers is increased, and further popularization in the industry is limited. In order to overcome the problems, the application provides an assertion code generation scheme, which can reduce the learning cost and improve the verification efficiency.
Referring to fig. 1, an embodiment of the present application discloses an assertion code generating method, including:
step S11: the method comprises the steps of obtaining natural language description input by a user terminal, analyzing the natural language description, and determining a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters.
In the embodiment of the application, a user-oriented interface is provided for filling in the natural language description, so that the natural language description input by a user terminal is obtained; wherein the natural language description is input by a user line by line; analyzing the natural language description input line by using an analyzer constructed based on a regular expression in advance to obtain an analyzed natural language, judging whether the analyzed natural language meets the requirement of a preset format, and if the analyzed natural language meets the requirement of the preset format, determining a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters so as to perform the subsequent step of generating an assertion code; and if the analyzed natural language does not meet the preset format requirement, sending an error report and sending an instruction for modifying the natural language description, and not carrying out the subsequent step of generating an assertion code. It should be noted that the user configuration parameters include a signal name and scene parameter configuration information.
It should be noted that, when the user fills in the natural language description, the user needs to refer to a preset description table, and when the preset description table is created, the following two aspects can be specifically adopted, in the first aspect, the natural language description is close to the living habits of the user, and has certainty without ambiguity; in a second aspect, the natural language description includes all information needed in a scene to be described, and redundant information is reduced as much as possible, so that the form of the natural language description is very concise; therefore, the existence of the preset description table can well solve the problem that the difficulty of tool implementation is uncontrollable due to overlarge input space and non-standard input of a user, well balances the two aspects of user input standardization and code generation automation, and the preset description table is as shown in table one:
watch 1
Figure BDA0003430120090000051
Figure BDA0003430120090000061
Figure BDA0003430120090000071
It should be noted that the assertion scenario in the preset description table may be an assertion description based on the SystemVerilog language, or may be an assertion description in another assertion language, and is not specifically limited herein.
Step S12: and determining a target assertion scene corresponding to the predefined natural language scene based on the predefined natural language scene and a preset mapping table.
In the embodiment of the application, the preset mapping table embodies the mapping relationship between the predefined natural language scene and the assertion scene; before the preset mapping table is used, the preset mapping table needs to be created, wherein the creating step comprises the steps of firstly determining different assertion scenes, determining different predefined natural language scenes corresponding to the different assertion scenes respectively, and then constructing the corresponding mapping table based on the corresponding relation between the assertion scenes and the predefined natural language scenes so as to obtain the preset mapping table. It should be noted that the preset description table and the preset mapping table have a corresponding relationship, but the difference is that the preset description surface faces a user, and the preset mapping table faces a machine.
In the embodiment of the application, when the analyzed natural language meets the preset format requirement, and a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters are determined, a target assertion scene corresponding to the predefined natural language scene is determined based on the preset mapping table.
Step S13: and inquiring a target configuration template which corresponds to the target assertion scene and is used for constructing an assertion code from a preset configuration template library.
In the embodiment of the application, different configuration templates corresponding to different assertion scenes and corresponding relations between the different assertion scenes and the different configuration templates are stored in the preset configuration template library; in the process of generating the assertion code, a target configuration template corresponding to a target assertion scenario must be obtained, so that a target configuration template for constructing the assertion code corresponding to the target assertion scenario needs to be queried from a preset configuration template library.
In the embodiment of the present application, the configuration template in the preset configuration template library is a pre-developed template described by using an SV assertion language, and the purpose of using the configuration template is to reuse the configuration template in order to facilitate different parameter configurations.
Step S14: and filling the user configuration parameters into the target configuration template to generate target assertion codes corresponding to the natural language description.
In the embodiment of the present application, after the target configuration template is determined, the obtained user configuration parameters need to be filled into the target configuration template, if it is detected that the user configuration parameters do not exist in the natural language after the natural language description is analyzed, the default parameters in the target configuration template are used to configure the parameters to be configured in the target configuration template, and then the configured template is rendered to generate the target assertion code corresponding to the natural language description.
In the embodiment of the application, if the target assertion code is applied to the field of chip verification, the target assertion code needs to be included in a chip verification environment corresponding to a chip to be verified, and a signal corresponding to the target assertion code is connected with the chip to be verified, so that assertion verification is performed on the chip to be verified.
Therefore, the method and the device for the natural language description analysis acquire the natural language description input by the user terminal, and analyze the natural language description to determine a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters; determining a target assertion scene corresponding to the predefined natural language scene based on the predefined natural language scene and a preset mapping table; inquiring a target configuration template which corresponds to the target assertion scene and is used for constructing an assertion code from a preset configuration template library; and filling the user configuration parameters into the target configuration template to generate target assertion codes corresponding to the natural language description. Therefore, the method for converting the natural language description into the assertion code can obtain the required assertion code without learning the assertion description, so that the complicated assertion description does not need to be learned in the assertion verification, the learning cost is reduced, the verification efficiency is improved, and the popularization of the assertion verification in the chip verification industry is facilitated.
Referring to fig. 2, an embodiment of the present application discloses a specific assertion code generation method, where the method includes:
step S21: the method comprises the steps of obtaining natural language description input by a user terminal, analyzing the natural language description, and determining a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters.
For a more specific processing procedure of step S21, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Step S22: and determining a target assertion scene corresponding to the predefined natural language scene based on the predefined natural language scene and a preset mapping table.
For a more specific processing procedure of step S22, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Step S23: and inquiring a target configuration template which corresponds to the target assertion scene and is used for constructing an assertion code from a preset configuration template library.
For a more specific processing procedure of step S23, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Step S24: and determining whether the user configuration parameters have missing parameters or not by comparing the user configuration parameters with the parameters to be configured in the target configuration template.
In the embodiment of the present application, a situation that a user configuration parameter obtained by analyzing the natural language description may not correspond to a parameter to be configured in the target configuration template exists, so that whether a missing parameter exists in the user configuration parameter is determined by comparing the user configuration parameter with the parameter to be configured in the target configuration template.
Step S25: and if the user configuration parameters do not have missing parameters, filling the user configuration parameters into the target configuration template to generate a target assertion code corresponding to the natural language description.
In the embodiment of the application, a result that no missing parameter exists in the user configuration parameters is obtained by comparing the user configuration parameters with the parameters to be configured in the target configuration template, the user configuration parameters are filled into the target configuration template to generate target assertion codes corresponding to the natural language description, then the target assertion codes are included in a chip verification environment corresponding to a chip to be verified, and signals corresponding to the target assertion codes are connected with the chip to be verified so as to verify the assertion of the chip to be verified.
Step S26: and if the user configuration parameters have missing parameters, filling the user configuration parameters into the target configuration template, and then configuring the parameters which are not configured in the current target configuration template by using default parameters in the target configuration template so as to generate a target assertion code corresponding to the natural language description.
In the embodiment of the application, a result that missing parameters exist in the user configuration parameters is obtained through comparison between the user configuration parameters and parameters to be configured in the target configuration template, the user configuration parameters are filled into the target configuration template, then, parameters which are not configured yet in the target configuration template are configured by using default parameters in the target configuration template to generate target assertion codes corresponding to the natural language description, finally, the target assertion codes are included in a chip verification environment corresponding to a chip to be verified, and signals corresponding to the target assertion codes are connected with the chip to be verified so as to perform assertion verification on the chip to be verified.
Therefore, the method and the device for the natural language description analysis acquire the natural language description input by the user terminal, and analyze the natural language description to determine a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters; determining a target assertion scene corresponding to the predefined natural language scene based on the predefined natural language scene and a preset mapping table; inquiring a target configuration template which corresponds to the target assertion scene and is used for constructing an assertion code from a preset configuration template library; determining whether the user configuration parameters have missing parameters by comparing the user configuration parameters with the parameters to be configured in the target configuration template; if the user configuration parameters do not have missing parameters, filling the user configuration parameters into the target configuration template to generate target assertion codes corresponding to the natural language description; and if the user configuration parameters have missing parameters, filling the user configuration parameters into the target configuration template, and then configuring the parameters which are not configured in the current target configuration template by using default parameters in the target configuration template so as to generate a target assertion code corresponding to the natural language description. Therefore, the method for converting the natural language description into the assertion code can obtain the required assertion code without learning the assertion description, so that the complicated assertion description does not need to be learned in the assertion verification, the learning cost is reduced, the verification efficiency is improved, and the popularization of the assertion verification in the chip verification industry is facilitated.
Referring to FIG. 3, a process for generating assertion code is disclosed; firstly, analyzing natural language description through an analysis script corresponding to an analyzer to obtain a predefined natural language scene and corresponding user configuration parameters, determining an assertion scene corresponding to the predefined natural language scene through the preset mapping table, then finding a target preset template corresponding to the assertion scene based on the preset template library, and filling the user configuration parameters into the target preset template to obtain a target assertion code.
Referring to FIG. 4, a specific natural language description process for generating assertion code is disclosed; firstly, judging whether the format of the natural language meets the preset format requirement or not through an analysis script corresponding to an analyzer, and if not, sending an error report and sending an instruction for modifying the description of the natural language; if the requirement of a preset format is met, determining an assertion scene through a preset natural language scene corresponding to the natural language description, detecting whether the natural language description has corresponding user configuration parameters, and if the natural language description does not have the corresponding user configuration parameters, configuring the parameters to be configured in the current configuration template through default parameters in the configuration template determined by the assertion scene and a preset template library so as to generate an assertion code corresponding to the natural language description; if the natural language description has corresponding user configuration parameters, further comparing the corresponding user configuration parameters with the parameters to be configured in the configuration template to determine whether the user configuration parameters have missing parameters, and if the user configuration parameters do not have missing parameters, filling the user configuration parameters into the configuration template to generate assertion codes corresponding to the natural language description; if the user configuration parameters have missing parameters, filling the user configuration parameters into the configuration template, and then configuring the parameters which are not configured in the current configuration template by using default parameters in the configuration template so as to generate assertion codes corresponding to the natural language description. According to the method, the assertion code can be automatically generated by using the natural language description under the condition that an engineer does not learn the SV assertion language, so that the assertion verification does not need to learn the complex assertion description any more, the learning cost is reduced, the verification efficiency is improved, the popularization of the assertion verification in the chip verification is facilitated, and the technical communication among the engineers is facilitated. It should be noted that, in the present application, the parser has functions of parsing the natural language description and determining the format, and also has functions of determining a single-signal scene and a multi-signal scene; and if the natural language description meets the preset format requirement, determining whether the natural language description contains a multi-signal expression, and analyzing the natural language description based on a regular expression to determine a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters. After the target assertion code is obtained, post-processing is carried out on the output assertion code in a next-stage module, if the natural language description is a multi-signal expression, a driving logic is generated, current information is created into a preset sequence (sequence) for an engineer to test, a corresponding function coverage rate library can be generated according to a scene, if the existing sequence is not completely covered to a function point after a randomization test, the function coverage rate score condition can be obtained in real time, the value of the function coverage rate score condition is fed back to excitation and is adjusted to generate, and finally, the covering of the function coverage rate library is automatically completed.
Referring to fig. 5, an embodiment of the present application discloses an assertion code generating apparatus, including:
the analysis module 11 is configured to obtain a natural language description input by a user terminal, and analyze the natural language description to determine a predefined natural language scene corresponding to the natural language description and a corresponding user configuration parameter;
an assertion scene determining module 12, configured to determine, based on the predefined natural language scene and a preset mapping table, a target assertion scene corresponding to the predefined natural language scene;
a configuration template query module 13, configured to query, from a preset configuration template library, a target configuration template corresponding to the target assertion scenario and used for constructing an assertion code;
and an assertion code generating module 14, configured to populate the target configuration template with the user configuration parameters to generate a target assertion code corresponding to the natural language description.
For more specific working processes of the modules, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Therefore, the method and the device for the natural language description analysis acquire the natural language description input by the user terminal, and analyze the natural language description to determine a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters; determining a target assertion scene corresponding to the predefined natural language scene based on the predefined natural language scene and a preset mapping table; inquiring a target configuration template which corresponds to the target assertion scene and is used for constructing an assertion code from a preset configuration template library; and filling the user configuration parameters into the target configuration template to generate target assertion codes corresponding to the natural language description. Therefore, the method for converting the natural language description into the assertion code can obtain the required assertion code without learning the assertion description, so that the complicated assertion description does not need to be learned in the assertion verification, the learning cost is reduced, the verification efficiency is improved, and the popularization of the assertion verification in the chip verification industry is facilitated.
Further, the embodiment of the application also provides electronic equipment. FIG. 6 is a block diagram illustrating an electronic device 20 according to an exemplary embodiment, and the contents of the diagram should not be construed as limiting the scope of use of the present application in any way.
Fig. 6 is a schematic structural diagram of an electronic device 20 provided in an embodiment of the present application, where the electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, an input output interface 24, a communication interface 25, and a communication bus 26. Wherein the memory 22 is used for storing a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the assertion code generating method disclosed in any of the foregoing embodiments.
In this embodiment, the power supply 23 is configured to provide a working voltage for each hardware device on the electronic device 20; the communication interface 25 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol followed by the communication interface is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited herein.
In addition, the storage 22 is a non-volatile storage that may include a random access memory as a running memory and a storage purpose for an external memory, and the storage resources thereon include an operating system 221, a computer program 222, and the like, and the storage may be a transient storage or a permanent storage.
The operating system 221 is used for managing and controlling each hardware device and the computer program 222 on the electronic device 20 on the source host, and the operating system 221 may be Windows, Unix, Linux, or the like. The computer programs 222 may further include computer programs that can be used to perform other specific tasks in addition to the computer programs that can be used to perform the assertion code generation method disclosed by any of the foregoing embodiments and executed by the electronic device 20.
In this embodiment, the input/output interface 24 may specifically include, but is not limited to, a USB interface, a hard disk reading interface, a serial interface, a voice input interface, a fingerprint input interface, and the like.
Further, embodiments of the present application disclose a computer-readable storage medium, where the computer-readable storage medium includes a Random Access Memory (RAM), a Memory, a Read-Only Memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a magnetic disk, or an optical disk or any other form of storage medium known in the art. Wherein the computer program, when executed by a processor, implements the aforementioned assertion code generation method. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, which are not described herein again.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. For the device disclosed by the embodiment, since the device corresponds to the assertion code generation method disclosed by the embodiment, the description is relatively simple, and the relevant points can be referred to the description of the method part.
The steps of training a task resource schedule or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The assertion code generating method, device, apparatus and medium provided by the present invention are described in detail above, and a specific example is applied in the present disclosure to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A predicate code generation method, comprising:
acquiring natural language description input by a user terminal, and analyzing the natural language description to determine a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters;
determining a target assertion scene corresponding to the predefined natural language scene based on the predefined natural language scene and a preset mapping table;
inquiring a target configuration template which corresponds to the target assertion scene and is used for constructing an assertion code from a preset configuration template library;
and filling the user configuration parameters into the target configuration template to generate target assertion codes corresponding to the natural language description.
2. An assertion code generation method as claimed in claim 1, wherein said parsing the natural language description to determine a predefined natural language scenario corresponding to the natural language description and corresponding user configuration parameters comprises:
analyzing the natural language description, and judging whether the analyzed natural language meets the preset format requirement or not;
if the analyzed natural language meets the preset format requirement, determining a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters;
and if the analyzed natural language does not meet the preset format requirement, sending an error report and sending an instruction for modifying the natural language description.
3. An assertion code generation method as claimed in claim 1, wherein said populating the user configuration parameters into the target configuration template to generate a target assertion code corresponding to the natural language description comprises:
determining whether the user configuration parameters have missing parameters by comparing the user configuration parameters with the parameters to be configured in the target configuration template;
if the user configuration parameters do not have missing parameters, filling the user configuration parameters into the target configuration template to generate target assertion codes corresponding to the natural language description;
and if the user configuration parameters have missing parameters, filling the user configuration parameters into the target configuration template, and then configuring the parameters which are not configured in the current target configuration template by using default parameters in the target configuration template so as to generate a target assertion code corresponding to the natural language description.
4. The assertion code generation method according to claim 1, further comprising:
determining different predefined natural language scenes respectively corresponding to the different assertion scenes;
and constructing a corresponding mapping table based on the corresponding relation between the assertion scene and the predefined natural language scene to obtain the preset mapping table.
5. An assertion code generation method as claimed in claim 1, wherein said parsing the natural language description to determine a predefined natural language scenario corresponding to the natural language description and corresponding user configuration parameters comprises:
analyzing the natural language description input line by using an analyzer constructed based on a regular expression in advance to determine a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters.
6. An assertion code generating method as claimed in claim 1, wherein after the populating the user configuration parameters into the target configuration template to generate the target assertion code corresponding to the natural language description, further comprising:
and the target assertion code is contained in a chip verification environment corresponding to a chip to be verified, and a signal corresponding to the target assertion code is connected with the chip to be verified so as to perform assertion verification on the chip to be verified.
7. An assertion code generation method as claimed in any one of claims 1 to 6, wherein after the parsing of the natural language description, further comprises:
and if no user configuration parameter exists in the analyzed natural language, configuring the parameter to be configured in the target configuration template by using the default parameter in the target configuration template so as to generate a target assertion code corresponding to the natural language description.
8. An assertion code generating apparatus, comprising:
the analysis module is used for acquiring natural language description input by a user terminal and analyzing the natural language description to determine a predefined natural language scene corresponding to the natural language description and corresponding user configuration parameters;
the assertion scene determining module is used for determining a target assertion scene corresponding to the predefined natural language scene based on the predefined natural language scene and a preset mapping table;
the configuration template query module is used for querying a target configuration template which corresponds to the target assertion scene and is used for constructing an assertion code from a preset configuration template library;
and the assertion code generation module is used for filling the user configuration parameters into the target configuration template so as to generate target assertion codes corresponding to the natural language description.
9. An electronic device comprising a processor and a memory; wherein the processor, when executing the computer program stored in the memory, implements the assertion code generating method as recited in any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the assertion code generating method as claimed in any one of claims 1 to 7.
CN202111594357.3A 2021-12-23 2021-12-23 Assertion code generation method, device, equipment and medium Pending CN114385132A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111594357.3A CN114385132A (en) 2021-12-23 2021-12-23 Assertion code generation method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111594357.3A CN114385132A (en) 2021-12-23 2021-12-23 Assertion code generation method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN114385132A true CN114385132A (en) 2022-04-22

Family

ID=81198365

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111594357.3A Pending CN114385132A (en) 2021-12-23 2021-12-23 Assertion code generation method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114385132A (en)

Similar Documents

Publication Publication Date Title
CN111428462B (en) Communication protocol template construction method and terminal equipment
KR20210149045A (en) artificial intelligence chip verification
CN112765023B (en) Test case generation method and device
CN110955410A (en) Automatic code generation method, device, equipment and medium
CN110795141B (en) Training task submitting method, device, equipment and medium
CN112527286A (en) Service code generation method and device, computer equipment and storage medium
CN111580821B (en) Script binding method and device, electronic equipment and computer readable storage medium
CN115757014A (en) Power consumption testing method and device
CN112860587A (en) UI automatic test method and device
CN110717315B (en) System data batch modification method and device, storage medium and electronic equipment
CN112286532A (en) Method and system for realizing front-end code formatting based on ESLint and Prettier
US9880813B2 (en) RTE code generating method and apparatus performing the same
CN114385132A (en) Assertion code generation method, device, equipment and medium
CN108132799B (en) Inter-process static program analysis information extraction method, device and equipment
CN110988661B (en) FPGA prototype verification development board time division analysis system, method, medium and terminal
CN115687108A (en) Verification method, platform, terminal and storage medium based on combination of UVM and FPV
CN114385493A (en) Performance test method and device, electronic equipment and storage medium
CN115033434A (en) Kernel performance theoretical value calculation method and device and storage medium
CN114564903A (en) Chip simulation design verification method, device, equipment and medium
CN113254027A (en) Method, system, equipment and storage medium for converting control program of semiconductor equipment
CN113535581A (en) Test script generation method, device, equipment and computer readable storage medium
CN117077616B (en) Circuit generation method, device, equipment and medium based on structure guidance
WO2018215651A1 (en) A big data processing method, device, and system, and a machine readable medium
CN114756217B (en) Plug-in based script generation system
CN113589700B (en) Method and system for checking intelligent household zigbee request

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination