WO2020237508A1 - 一种断言验证代码绑定方法及装置 - Google Patents

一种断言验证代码绑定方法及装置 Download PDF

Info

Publication number
WO2020237508A1
WO2020237508A1 PCT/CN2019/088850 CN2019088850W WO2020237508A1 WO 2020237508 A1 WO2020237508 A1 WO 2020237508A1 CN 2019088850 W CN2019088850 W CN 2019088850W WO 2020237508 A1 WO2020237508 A1 WO 2020237508A1
Authority
WO
WIPO (PCT)
Prior art keywords
module
assertion
target
information
target module
Prior art date
Application number
PCT/CN2019/088850
Other languages
English (en)
French (fr)
Inventor
刘建
刘列峰
崔明
Original Assignee
深圳市大疆创新科技有限公司
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 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to CN201980008861.5A priority Critical patent/CN111615688A/zh
Priority to PCT/CN2019/088850 priority patent/WO2020237508A1/zh
Publication of WO2020237508A1 publication Critical patent/WO2020237508A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/32Circuit design at the digital level
    • G06F30/33Design verification, e.g. functional simulation or model checking

Definitions

  • the present invention relates to the field of computer technology, in particular to a method and device for assertion verification code binding.
  • the verification link has gradually become an important part of the chip design process. After the chip design is completed, in order to facilitate the inspection of abnormal conditions and check whether certain scenes are covered during simulation, it is often necessary to go inside the chip. Add assertion verification code to the module of, and bind the assertion verification code with the target module.
  • Assertion verification is a programming term, expressed as some Boolean expressions. The programmer believes that the expression value is true at a certain point in the program. Assertion verification can be enabled and disabled at any time. Therefore, assertion verification can be enabled during testing. Disable assertion verification at deployment time. Similarly, after the program is put into operation, end users can re-enable assertion verification when they encounter problems.
  • the prior art obtains the location information and interface information of each module that needs to bind the assertion verification code by artificial search, and then manually writes the assertion verification code at the corresponding position of the module according to the location information, and implements the assertion based on the interface information Verify the binding of the code and the target module.
  • the same module in the chip design may be instantiated multiple times.
  • the instantiation refers to the modules with the same function set in different positions in the chip.
  • the position of the instantiated module is difficult to find. Therefore, add assertion verification code At this time, the location where the assertion verification code is added is prone to errors, and different target modules are manually bound to different assertion verification codes, which requires a large workload and low work efficiency.
  • the embodiments of the present invention provide a method and device for binding assertion verification codes to solve the problem that the position where the assertion verification code is added in the prior art is prone to errors and the workload of the assertion verification code binding. Big problem.
  • an embodiment of the present invention provides an assertion verification code binding method, including:
  • the target module is bound with the corresponding assertion verification code.
  • an assertion verification code binding device including:
  • the module information determining module is used to determine the module identification, location information and interface information corresponding to multiple modules of the chip;
  • the module information searching module is used to find the location information and interface information corresponding to the target module according to the module identifier of the target module when receiving the searching instruction for the target module;
  • the assertion binding module is configured to bind the target module with the corresponding assertion verification code according to the location information and interface information of the target module.
  • an embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and running on the processor, and the processor executes the computer program When implementing the above assertion verification code binding method
  • an embodiment of the present invention additionally provides a computer-readable storage medium, the computer-readable storage medium stores program instructions, and when the program instructions are executed by a processor, they are used to execute the aforementioned assertion verification code binding. Set method.
  • the location corresponding to the target module is found according to the module identification of the target module Information and interface information, according to the location information and interface information of the target module, bind the target module with the corresponding assertion verification code.
  • the location information and interface information corresponding to the target module are automatically searched, so that the location added by the subsequent assertion verification code is not prone to error, and based on the location information and interface of the target module Information, bind the target module with the corresponding assertion verification code, reduce the workload of artificially binding the assertion verification code with the target module, and improve the efficiency of binding.
  • Figure 1 shows a flow chart of a method for binding assertion verification codes according to the first embodiment of the present invention
  • FIG. 2 shows a flowchart of a method for binding assertion verification codes according to a second embodiment of the present invention
  • FIG. 3 shows a structural block diagram of an assertion verification code binding device according to a third embodiment of the present invention.
  • Fig. 4 shows a structural block diagram of another device for binding assertion verification codes according to the third embodiment of the present invention.
  • Step S101 Determine module identifiers, location information, and interface information corresponding to multiple modules of the chip.
  • FIFO First Input First Output
  • RAM Random Access Memory, random access memory
  • ARBITER arbitrator
  • the chip file list includes not only the code of each module integrated inside the chip, but also other related codes, such as modules and modules.
  • the code of each module includes the module identification and interface information of the module, etc.
  • the interface information of the module includes the interface name of the module, the configuration parameters of the interface and other related parameters, etc.
  • the module identification can use the module name To represent.
  • a top-level module includes multiple sub-modules, and each sub-module can nest multiple sub-modules. Therefore, the location information of the module is usually based on the path of the module. Said.
  • the top-level module is module A
  • the top-level module includes multiple sub-modules B1, B2, and B3, and sub-module B1 is nested with sub-module C1. Therefore, the location information of sub-module C1 follows the path “module A-sub-module B1-sub-module C1" to indicate.
  • Step S102 When a search instruction for the target module is received, the location information and interface information corresponding to the target module are searched according to the module identifier of the target module.
  • modules in the chip need to bind assertion verification code. Therefore, multiple modules in the chip can be divided into two categories, one is the target module, and the other is the non-target module.
  • the division criteria for target modules and non-target modules are set according to the design requirements of the chip by the developer.
  • the division criteria for each chip may be the same or different; the target module refers to the need to bind assertion verification Code modules, non-target modules refer to modules that do not need to bind assertion verification code.
  • the location information and interface information corresponding to the target module are searched according to the module identification of the target module.
  • the target module includes at least one of a FIFO module, a RAM module, an ARBITER module, and a counter module.
  • Step S103 Bind the target module with the corresponding assertion verification code according to the location information and interface information of the target module.
  • the assertion verification code includes the assertion code and the assertion coverage code.
  • the assertion code is used to verify whether the corresponding target module has an exception during chip simulation. When an exception occurs, The assertion code will alarm, and the assertion coverage code is used to detect whether the scene that needs to be verified in the target module is covered after the chip simulation ends.
  • the target module is a counter in the chip, and the count value of the counter is 1 to 100.
  • the assertion code detects a count value of 101, it is determined that the counter is abnormal. After the simulation ends, the assertion coverage code counts the actual detection The count value of the counter can determine the assertion coverage of the counter. If the count value of the counter is 1, 10, and 100, it means that the assertion coverage is 3%. According to the assertion coverage, determine whether the scene to be verified is Covered to.
  • the assertion verification code corresponding to the target module determines the position where the assertion verification code needs to be inserted according to the location information of the target module, and connect the assertion verification code with the interface of the target module according to the interface information of the target module, so as to realize the assertion verification code and the target module Binding.
  • the workload of artificially binding the assertion verification code and the target module is reduced, and the efficiency of binding is improved.
  • the assertion verification code bound to the target module can be used to verify the target module.
  • the assertion verification code binding method proposed by the embodiment of the present invention has at least the following technical effects:
  • the location corresponding to the target module is found according to the module identification of the target module Information and interface information, according to the location information and interface information of the target module, bind the target module with the corresponding assertion verification code.
  • the location information and interface information corresponding to the target module are automatically searched, so that the location added by the subsequent assertion verification code is not prone to error, and based on the location information and interface of the target module Information, bind the target module with the corresponding assertion verification code, reduce the workload of artificially binding the assertion verification code with the target module, and improve the efficiency of binding.
  • FIG. 2 a flowchart of a method for binding assertion verification codes according to a second embodiment of the present invention is shown, which may specifically include the following steps:
  • step S201 an assertion code library is provided, and the assertion verification code corresponding to the multiple modules and the assertion identifier corresponding to each of the assertion verification codes are stored in the assertion code library.
  • assertion verification code For different modules, developers will write the assertion verification code corresponding to the module, and store the assertion verification code in the assertion code library, which stores the assertion verification code corresponding to multiple modules; of course, in writing When asserting the verification code, a unique assertion identifier can be set for each assertion verification code. That is to say, in addition to the assertion verification code corresponding to multiple modules, each assertion is stored in the assertion code library. The assertion identifier corresponding to the verification code.
  • the written assertion code library After the written assertion verification code and the corresponding assertion identifier are stored in the assertion code library, the written assertion code library can be obtained.
  • assertion identifier corresponds to the module identifier of the target module, and is used to facilitate subsequent call of the assertion verification code; of course, it is understandable that the assertion identifier can also be represented by the module name of the target module.
  • Step S202 According to the module identifiers of the multiple modules of the chip, use the VERDI tool to search the location information and interface information of the multiple modules from the chip file list.
  • the module identification of each module in the chip is unique, and because the VERDI tool can analyze the chip file list, the module identification of each module of the chip can be input into the VERDI tool in turn, and the VERDI tool is used to analyze the chip file list.
  • the location information and interface information of the module corresponding to the module identifier are found in the chip file list, thereby obtaining the location information and interface information of multiple modules.
  • Step S203 Store the module identities, location information and interface information of the multiple modules in a target file.
  • the location information and interface information of the multiple modules found are stored in the target file, and correspondingly, the module identifiers corresponding to the modules are also stored in the target file.
  • the target file may include the module identifier, the location information of the module, and the interface information of the module, and the format of the target file may be a txt format.
  • Step S204 when receiving the search instruction for the target module, read the corresponding location information and interface information from the target file according to the module identifier of the target module.
  • the location information and interface information corresponding to the target module are read from the target file according to the module identification of the target module.
  • the target module includes at least one of a FIFO module, a RAM module, an ARBITER module, and a counter module.
  • Step S205 Match the module identifier of the target module with the assertion identifier in the assertion code library.
  • the module identifier of the target module is matched with each assertion identifier in the assertion code library, and the assertion verification code corresponding to the successfully matched assertion identifier is determined, that is, the assertion verification code to be bound to the target module is determined.
  • the target module is a FIFO (First Input First Output) module, and its module identification is FIFO.
  • the assertion code base includes assertion verification code 1, assertion verification code 2, and assertion verification code 3.
  • Assertion verification code 1 is used for Verify the FIFO module
  • assertion verification code 2 is used to verify the RAM module
  • assertion verification code 3 is used to verify the ARBITER module
  • the assertion identifier of assertion verification code 1 is 0001
  • the assertion identifier of assertion verification code 2 is 0002
  • the assertion identifier of the assertion verification code 3 is 0003
  • the module identifier FIFO of the target module is matched with each assertion identifier in the assertion code library, and the matched assertion identifier is 0001, then it is determined from the assertion code library that binding is required
  • the assertion verification code is assertion verification code 1.
  • Step S206 Call the assertion verification code corresponding to the successfully matched assertion identifier from the assertion code library.
  • the assertion verification code corresponding to the successfully matched assertion identifier is called from the assertion code library.
  • Step S207 Connect the assertion verification code with the interface of the target module according to the location information and interface information of the target module.
  • assertion verification code in the assertion code base is also manually written, in subsequent applications, when errors in the assertion verification code are found, they can be corrected manually. After multiple verifications by multiple users, the assertion The assertion verification code in the code base is more accurate. When the assertion verification code in the assertion code base is called and the assertion verification code is connected to the interface of the target module, the assertion verification code is accurate, thereby avoiding manual addition to the target module Assertion verification code is prone to errors, and when the same target module is instantiated, there is no need to copy the assertion verification code, just call the assertion verification code in the assertion code library directly to avoid errors in the copying process.
  • an assertion code library is provided.
  • the VERDI tool is used to find the location information and interface information of the multiple modules from the chip file list, and the module identifications and locations of the multiple modules The information and interface information are stored in the target file.
  • the corresponding location information and interface information are read from the target file according to the module ID of the target module, and the module ID and assertion of the target module.
  • the assertion identifier in the code base is matched, the assertion verification code corresponding to the successfully matched assertion identifier is called from the assertion code base, and the assertion verification code is connected with the interface of the target module according to the location information and interface information of the target module.
  • the assertion verification code is automatically invoked, and the assertion verification code is connected to the interface of the target module according to the location information and interface information, which reduces the workload of artificially binding the assertion verification code and the target module and improves the efficiency of binding; and
  • the assertion verification code just call the assertion verification code in the assertion code library directly to avoid errors in the copying process.
  • the assertion verification code binding apparatus 300 may include:
  • the module information determining module 301 is used to determine the module identifiers, location information, and interface information corresponding to multiple modules of the chip;
  • the module information search module 302 is configured to, when receiving a search instruction for the target module, find the location information and interface information corresponding to the target module according to the module identifier of the target module;
  • the assertion binding module 303 is configured to bind the target module with the corresponding assertion verification code according to the location information and interface information of the target module.
  • the assertion verification code binding device 300 further includes:
  • the assertion code library providing module 304 is configured to provide an assertion code library.
  • the assertion code library stores assertion verification codes corresponding to the multiple modules and an assertion identifier corresponding to each assertion verification code.
  • the assertion binding module 303 includes:
  • the identification matching sub-module 3031 is configured to match the module identification of the target module with the assertion identification in the assertion code library
  • the assertion calling submodule 3032 is used to call the assertion verification code corresponding to the successfully matched assertion identifier from the assertion code library;
  • the assertion binding submodule 3033 is configured to connect the assertion verification code with the interface of the target module according to the location information and interface information of the target module.
  • the module information determining module 301 includes:
  • the module information searching sub-module 3011 is used for searching the position information and interface information of the multiple modules from the chip file list by using the VERDI tool according to the module identifiers of the multiple modules of the chip;
  • the module information storage sub-module 3012 is used to store the module identities, location information and interface information of the multiple modules in the target file.
  • the module information searching module 302 includes:
  • the module information reading sub-module 3021 is configured to read the corresponding location information and interface information from the target file according to the module identifier of the target module when a search instruction for the target module is received.
  • the target module includes: at least one of a FIFO module, a RAM module, an ARBITER module, and a counter module.
  • the location corresponding to the target module is found according to the module identification of the target module Information and interface information, according to the location information and interface information of the target module, bind the target module with the corresponding assertion verification code.
  • the location information and interface information corresponding to the target module are automatically searched, so that the location added by the subsequent assertion verification code is not prone to error, and based on the location information and interface of the target module Information, bind the target module with the corresponding assertion verification code, reduce the workload of artificially binding the assertion verification code with the target module, and improve the efficiency of binding.
  • an embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and running on the processor.
  • the processor executes the computer program, Implement the above assertion verification code binding method.
  • the embodiment of the present invention additionally provides a computer-readable storage medium, the computer-readable storage medium stores program instructions, and the program instructions are used to execute the aforementioned assertion verification code binding method when the program instructions are executed by a processor.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing terminal equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the instruction device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

一种断言验证代码绑定方法及装置,该方法包括:确定芯片的多个模块对应的模块标识、位置信息和接口信息,在接收到针对目标模块的查找指令时,根据目标模块的模块标识,查找到目标模块对应的位置信息和接口信息,根据目标模块的位置信息和接口信息,将目标模块与对应的断言验证代码进行绑定。在接收到针对需要绑定断言验证代码的目标模块的查找指令时,自动查找目标模块对应的位置信息和接口信息,使得后续断言验证代码添加的位置不易出错,并根据目标模块的位置信息和接口信息,将目标模块与对应的断言验证代码进行绑定,减小因人为绑定断言验证代码与目标模块的工作量,提高了绑定的效率。

Description

一种断言验证代码绑定方法及装置 技术领域
本发明涉及计算机技术领域,特别是涉及一种断言验证代码绑定方法及装置。
背景技术
随着芯片设计流程的完善,验证环节在芯片设计流程中逐渐成为重要的一环,在芯片设计完成后,为了方便仿真时查看异常情况和检查某些场景是否被覆盖到,常常需要在芯片内部的模块中添加断言验证代码,将断言验证代码与目标模块绑定。
断言验证是编程术语,表示为一些布尔表达式,程序员相信在程序中的某个特定点该表达式值为真,可以在任何时候启用和禁用断言验证,因此可以在测试时启用断言验证而在部署时禁用断言验证。同样,程序投入运行后,最终用户在遇到问题时可以重新启用断言验证。
现有技术通过人为查找的方式获取每个需要绑定断言验证代码的模块的位置信息和接口信息,然后,根据位置信息在模块的相应位置处,人工编写断言验证代码,并基于接口信息实现断言验证代码与目标模块的绑定。
但是,芯片设计中同一模块可能会被多次例化,例化指的是具有相同功能的模块设置在芯片中的不同位置,例化后的模块的位置难以查找,因此,在添加断言验证代码时,断言验证代码添加的位置容易出错,且人工将不同的目标模块绑定不同的断言验证代码,工作量较大且工作效率低。
发明内容
为解决现有技术存在的技术问题,本发明实施例提出一种断言验证代码绑定方法及装置,以解决现有技术中断言验证代码添加的位置容易出错,且断言验证代码绑定的工作量大的问题。
第一方面,本发明实施例提供了一种断言验证代码绑定方法,包括:
确定芯片的多个模块对应的模块标识、位置信息和接口信息;
在接收到针对目标模块的查找指令时,根据目标模块的模块标识,查找到所述目标模块对应的位置信息和接口信息;
根据所述目标模块的位置信息和接口信息,将所述目标模块与对应的断言验证代码进行绑定。
第二方面,本发明实施例提供了一种断言验证代码绑定装置,包括:
模块信息确定模块,用于确定芯片的多个模块对应的模块标识、位置信息和接口信息;
模块信息查找模块,用于在接收到针对目标模块的查找指令时,根据目标模块的模块标识,查找到所述目标模块对应的位置信息和接口信息;
断言绑定模块,用于根据所述目标模块的位置信息和接口信息,将所述目标模块与对应的断言验证代码进行绑定。
第三方面,本发明实施例还提供了一种电子设备,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述的断言验证代码绑定方法
第四方面,本发明实施例另外提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有程序指令,该程序指令被处理器运行时,用于执行上述的断言验证代码绑定方法。
在本发明实施例中,通过确定芯片的多个模块对应的模块标识、位置信息和接口信息,在接收到针对目标模块的查找指令时,根据目标模块的模块标识,查找到目标模块对应的位置信息和接口信息,根据目标模块的位置信息和接口信息,将目标模块与对应的断言验证代码进行绑定。在接收到针对需要绑定断言验证代码的目标模块的查找指令时,自动查找目标模块对应的位置信息和接口信息,使得后续断言验证代码添加的位置不易出错,并根据目标模块的位置信息和接口信息,将目标模块与对应的断言验证代码进行绑定,减小因人为绑定断言验证代码与目标模块的工作量,提高了绑定的效率。
附图说明
图1示出了本发明第一实施例的一种断言验证代码绑定方法的流程图;
图2示出了本发明第二实施例的一种断言验证代码绑定方法的流程图;
图3示出了本发明第三实施例的一种断言验证代码绑定装置的结构框图;
图4示出了本发明第三实施例的另一种断言验证代码绑定装置的结构框图。
具体实施方式
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。
参照图1,示出了本发明第一实施例的一种断言验证代码绑定方法的流程图,具体可以包括如下步骤:
步骤S101,确定芯片的多个模块对应的模块标识、位置信息和接口信息。
芯片内部通常集成有多个模块,如FIFO(First Input First Output,先入先出)模块、RAM(Random Access Memory,随机存储器)模块、ARBITER(裁决器)模块和计算器模块等。
在芯片设计中,开发人员会将整个芯片设计中涉及的代码存储在芯片文件列表中,芯片文件列表中不仅包括芯片内部集成的每个模块的代码,还包括其他相关的代码,例如模块与模块之间的交互代码,具体的,每个模块的代码包括模块标识和模块的接口信息等,模块的接口信息包括模块的接口名称、接口的配置参数以及其他相关参数等,模块标识可以用模块名称来表示。
在芯片设计中,模块与模块之间具有一定的层级结构,通常是一个顶层模块包括多个子模块,而每个子模块又可以嵌套多个子模块,因此,模块的位置信息通常以模块的路径来表示。
例如,顶层模块为模块A,顶层模块包括多个子模块B1、B2和B3,子模块B1嵌套有子模块C1,因此,子模块C1的位置信息以路径“模块A-子模块B1-子模块C1”来表示。
确定芯片文件列表中芯片的多个模块对应的模块标识、位置信息和接口 信息。
步骤S102,在接收到针对目标模块的查找指令时,根据目标模块的模块标识,查找到所述目标模块对应的位置信息和接口信息。
在实际应用中,并不是芯片的所有模块都需要绑定断言验证代码的,因此,可将芯片中的多个模块划分为两类,一类是目标模块,另一类是非目标模块。
需要说明的是,目标模块和非目标模块的划分标准,是根据开发人员根据芯片的设计需求进行设定的,各个芯片的划分标准可能相同也可能不同;目标模块指的是需要绑定断言验证代码的模块,非目标模块指的是不需要绑定断言验证代码的模块。
在接收到针对目标模块的查找指令时,根据目标模块的模块标识,查找目标模块对应的位置信息和接口信息。
自动查找目标模块对应的位置信息和接口信息,且不易出错,即使针对的是多次例化的目标模块,也可查找到例化后的目标模块的位置,使得后续在添加断言验证代码时,断言验证代码添加的位置不易出错。
其中,目标模块包括:FIFO模块、RAM模块、ARBITER模块、计数器模块其中至少一者。
步骤S103,根据所述目标模块的位置信息和接口信息,将所述目标模块与对应的断言验证代码进行绑定。
开发人员针对不同的模块,会编写模块对应的断言验证代码,断言验证代码包括断言代码和断言覆盖率代码,断言代码用于在芯片仿真时验证对应的目标模块是否有异常,当出现异常时,断言代码会报警,断言覆盖率代码用于在芯片仿真结束后,检测目标模块中需要验证的场景是否被覆盖到。
例如,目标模块为芯片中的计数器,计数器的计数值为1至100,在仿真时,当断言代码检测到计数值101时,确定计数器出现异常,在仿真结束后,断言覆盖率代码统计实际检测到的计数器的计数值,可确定出计数器的断言覆盖率,如果检测到的计数器的计数值1、10和100,则表示断言覆盖 率为3%,根据断言覆盖率确定需要验证的场景是否被覆盖到。
获取目标模块对应的断言验证代码,根据目标模块的位置信息确定断言验证代码需要插入的位置,根据目标模块的接口信息,将断言验证代码与目标模块的接口连接,从而实现断言验证代码与目标模块的绑定。
通过自动获取目标模块对应的断言验证代码,并将断言验证代码与目标模块进行绑定,减小因人为绑定断言验证代码与目标模块的工作量,提高了绑定的效率。
在对芯片中的模块仿真时,则可以利用与目标模块绑定的断言验证代码,实现对目标模块的验证。
根据上述可知,本发明实施例提出的断言验证代码绑定方法,至少具有如下技术效果:
在本发明实施例中,通过确定芯片的多个模块对应的模块标识、位置信息和接口信息,在接收到针对目标模块的查找指令时,根据目标模块的模块标识,查找到目标模块对应的位置信息和接口信息,根据目标模块的位置信息和接口信息,将目标模块与对应的断言验证代码进行绑定。在接收到针对需要绑定断言验证代码的目标模块的查找指令时,自动查找目标模块对应的位置信息和接口信息,使得后续断言验证代码添加的位置不易出错,并根据目标模块的位置信息和接口信息,将目标模块与对应的断言验证代码进行绑定,减小因人为绑定断言验证代码与目标模块的工作量,提高了绑定的效率。
参照图2,示出了本发明第二实施例的一种断言验证代码绑定方法的流程图,具体可以包括如下步骤:
步骤S201,提供断言代码库,所述断言代码库中存储了分别对应于所述多个模块的断言验证代码以及每个断言验证代码对应的断言标识。
开发人员针对不同的模块,会编写模块对应的断言验证代码,并将断言验证代码存储在断言代码库中,该断言代码库中存储了分别对应于多个模块的断言验证代码;当然,在编写断言验证代码时,可为每个断言验证代码设置一个具有唯一性的断言标识,也就是说,断言代码库中除了存储了分别对 应于多个模块的断言验证代码外,还存储了每个断言验证代码对应的断言标识。
在将编写的断言验证代码与对应的断言标识存储在断言代码库后,可获取编写好的断言代码库。
需要说明的是,断言标识与目标模块的模块标识相对应,用于后续便于断言验证代码的调用;当然,可以理解的是,断言标识也可通过目标模块的模块名称来表示。
步骤S202,根据芯片的多个模块的模块标识,采用VERDI工具从芯片文件列表中查找所述多个模块的位置信息和接口信息。
通常,芯片中的每个模块的模块标识具有唯一性,且由于VERDI工具可以分析芯片文件列表,因此,可以将芯片的各个模块的模块标识依次输入VERDI工具,采用VERDI工具分析芯片文件列表,从芯片文件列表中查找到模块标识对应的模块的位置信息和接口信息,从而得到多个模块的位置信息和接口信息。
步骤S203,将所述多个模块的模块标识、位置信息和接口信息存储在目标文件中。
将查找到的多个模块的位置信息和接口信息存储在目标文件中,相应的,也将模块对应的模块标识存储在目标文件中。其中,目标文件可包括模块标识、模块的位置信息和模块的接口信息,该目标文件的格式可以为txt格式。
步骤S204,在接收到针对目标模块的查找指令时,根据目标模块的模块标识,从所述目标文件中读取对应的位置信息和接口信息。
在接收到针对目标模块的查找指令时,根据目标模块的模块标识,从目标文件中读取目标模块对应的位置信息和接口信息。
其中,目标模块包括:FIFO模块、RAM模块、ARBITER模块、计数器模块其中至少一者。
步骤S205,将所述目标模块的模块标识与所述断言代码库中的断言标识进行匹配。
将目标模块的模块标识与断言代码库中的各个断言标识进行匹配,确定匹配成功的断言标识对应的断言验证代码,即确定出目标模块需要绑定的断言验证代码。
例如,目标模块为FIFO(First Input First Output,先入先出)模块,其模块标识为FIFO,断言代码库中包括断言验证代码1、断言验证代码2和断言验证代码3,断言验证代码1用于对FIFO模块进行验证,断言验证代码2用于对RAM模块进行验证,断言验证代码3用于对ARBITER模块进行验证,且断言验证代码1的断言标识为0001、断言验证代码2的断言标识为0002,断言验证代码3的断言标识为0003,将目标模块的模块标识FIFO与断言代码库中的各个断言标识进行匹配,得到匹配后的断言标识为0001,则从断言代码库中确定出需要绑定的断言验证代码为断言验证代码1。
步骤S206,从断言代码库中调用匹配成功的断言标识对应的断言验证代码。
在确定出目标模块需要绑定的断言验证代码后,从断言代码库中调用匹配成功的断言标识对应的断言验证代码。
步骤S207,根据所述目标模块的位置信息和接口信息,将所述断言验证代码与所述目标模块的接口进行连接。
根据目标模块的位置信息确定断言验证代码需要插入的位置,根据目标模块的接口信息,将断言验证代码与目标模块的接口进行连接,从而实现断言验证代码与目标模块的绑定;具体的,可以使用bind命令将断言验证代码与目标模块的接口连接。
虽然,断言代码库中的断言验证代码也为是人工编写的,但是在后续的应用中,当发现断言验证代码编写错误时,可人工进行改正,经过多个用户的多次验证使用后,断言代码库中的断言验证代码更准确,在调用断言代码库中的断言验证代码,并将断言验证代码与目标模块的接口进行连接时,断言验证代码是准确的,从而避免通过人工为目标模块添加断言验证代码时容易出错的问题,且当同一目标模块被例化时,也无需复制断言验证代码,直接调用断言代码库中的断言验证代码即可,避免复制过程中出现错 误。
在本发明实施例中,提供断言代码库,根据芯片的多个模块的模块标识,采用VERDI工具从芯片文件列表中查找多个模块的位置信息和接口信息,将多个模块的模块标识、位置信息和接口信息存储在目标文件中,在接收到针对目标模块的查找指令时,根据目标模块的模块标识,从目标文件中读取对应的位置信息和接口信息,将目标模块的模块标识与断言代码库中的断言标识进行匹配,从断言代码库中调用匹配成功的断言标识对应的断言验证代码,根据目标模块的位置信息和接口信息,将断言验证代码与目标模块的接口进行连接。采用VERDI工具从芯片文件列表中查找到多个模块的位置信息和接口信息并将其储存至目标文件中,避免人为查找模块位置易出错的问题,且通过目标模块的模块标识从断言代码库中自动调用断言验证代码,并根据位置信息和接口信息,将断言验证代码与目标模块的接口进行连接,减小因人为绑定断言验证代码与目标模块的工作量,提高了绑定的效率;且当同一目标模块被例化时,也无需复制断言验证代码,直接调用断言代码库中的断言验证代码即可,避免复制过程中出现错误。
参照图3,示出了本发明第三实施例的一种断言验证代码绑定装置的结构框图,断言验证代码绑定装置300可以包括:
模块信息确定模块301,用于确定芯片的多个模块对应的模块标识、位置信息和接口信息;
模块信息查找模块302,用于在接收到针对目标模块的查找指令时,根据目标模块的模块标识,查找到所述目标模块对应的位置信息和接口信息;
断言绑定模块303,用于根据所述目标模块的位置信息和接口信息,将所述目标模块与对应的断言验证代码进行绑定。
参照图4,示出了本发明第三实施例的另一种断言验证代码绑定装置的结构框图。
在图3的基础上,可选的,所述断言验证代码绑定装置300还包括:
断言代码库提供模块304,用于提供断言代码库,所述断言代码库中存储了分别对应于所述多个模块的断言验证代码以及每个断言验证代码对应 的断言标识。
可选的,所述断言绑定模块303,包括:
标识匹配子模块3031,用于将所述目标模块的模块标识与所述断言代码库中的断言标识进行匹配;
断言调用子模块3032,用于从断言代码库中调用匹配成功的断言标识对应的断言验证代码;
断言绑定子模块3033,用于根据所述目标模块的位置信息和接口信息,将所述断言验证代码与所述目标模块的接口进行连接。
可选的,所述模块信息确定模块301,包括:
模块信息查找子模块3011,用于根据芯片的多个模块的模块标识,采用VERDI工具从芯片文件列表中查找所述多个模块的位置信息和接口信息;
模块信息存储子模块3012,用于将所述多个模块的模块标识、位置信息和接口信息存储在目标文件中。
可选的,所述模块信息查找模块302,包括:
模块信息读取子模块3021,用于在接收到针对目标模块的查找指令时,根据目标模块的模块标识,从所述目标文件中读取对应的位置信息和接口信息。
可选的,所述目标模块包括:FIFO模块、RAM模块、ARBITER模块、计数器模块其中至少一者。
在本发明实施例中,通过确定芯片的多个模块对应的模块标识、位置信息和接口信息,在接收到针对目标模块的查找指令时,根据目标模块的模块标识,查找到目标模块对应的位置信息和接口信息,根据目标模块的位置信息和接口信息,将目标模块与对应的断言验证代码进行绑定。在接收到针对需要绑定断言验证代码的目标模块的查找指令时,自动查找目标模块对应的位置信息和接口信息,使得后续断言验证代码添加的位置不易出错,并根据目标模块的位置信息和接口信息,将目标模块与对应的断言验证代码进行绑定,减小因人为绑定断言验证代码与目标模块的工作量,提高了绑定的效率。
相应的,本发明实施例还提供了一种电子设备,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述的断言验证代码绑定方法。
本发明实施例另外提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有程序指令,该程序指令被处理器运行时,用于执行上述的断言验证代码绑定方法。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本发明实施例是参照根据本发明实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设 备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明实施例范围的所有变更和修改。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。
以上对本发明所提供的一种断言验证代码绑定方法及装置,进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。

Claims (14)

  1. 一种断言验证代码绑定方法,其特征在于,包括:
    确定芯片的多个模块对应的模块标识、位置信息和接口信息;
    在接收到针对目标模块的查找指令时,根据目标模块的模块标识,查找到所述目标模块对应的位置信息和接口信息;
    根据所述目标模块的位置信息和接口信息,将所述目标模块与对应的断言验证代码进行绑定。
  2. 根据权利要求1所述的方法,其特征在于,在所述根据所述目标模块的位置信息和接口信息,将所述目标模块与对应的断言验证代码进行绑定的步骤之前,还包括:
    提供断言代码库,所述断言代码库中存储了分别对应于所述多个模块的断言验证代码以及每个断言验证代码对应的断言标识。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述目标模块的位置信息和接口信息,将所述目标模块与对应的断言验证代码进行绑定的步骤,包括:
    将所述目标模块的模块标识与所述断言代码库中的断言标识进行匹配;
    从断言代码库中调用匹配成功的断言标识对应的断言验证代码;
    根据所述目标模块的位置信息和接口信息,将所述断言验证代码与所述目标模块的接口进行连接。
  4. 根据权利要求1所述的方法,其特征在于,所述确定芯片的多个模块对应的模块标识、位置信息和接口信息的步骤,包括:
    根据芯片的多个模块的模块标识,采用VERDI工具从芯片文件列表中查找所述多个模块的位置信息和接口信息;
    将所述多个模块的模块标识、位置信息和接口信息存储在目标文件中。
  5. 根据权利要求4所述的方法,其特征在于,所述在接收到针对目标模块的查找指令时,根据目标模块的模块标识,查找到所述目标模块对应的位置信息和接口信息的步骤,包括:
    在接收到针对目标模块的查找指令时,根据目标模块的模块标识,从所述目标文件中读取对应的位置信息和接口信息。
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述目标模块包括:FIFO模块、RAM模块、ARBITER模块、计数器模块其中至少一者。
  7. 一种断言验证代码绑定装置,其特征在于,包括:
    模块信息确定模块,用于确定芯片的多个模块对应的模块标识、位置信息和接口信息;
    模块信息查找模块,用于在接收到针对目标模块的查找指令时,根据目标模块的模块标识,查找到所述目标模块对应的位置信息和接口信息;
    断言绑定模块,用于根据所述目标模块的位置信息和接口信息,将所述目标模块与对应的断言验证代码进行绑定。
  8. 根据权利要求7所述的装置,其特征在于,还包括:
    断言代码库提供模块,用于提供断言代码库,所述断言代码库中存储了分别对应于所述多个模块的断言验证代码以及每个断言验证代码对应的断言标识。
  9. 根据权利要求8所述的装置,其特征在于,所述断言绑定模块,包括:
    标识匹配子模块,用于将所述目标模块的模块标识与所述断言代码库中的断言标识进行匹配;
    断言调用子模块,用于从断言代码库中调用匹配成功的断言标识对应的断言验证代码;
    断言绑定子模块,用于根据所述目标模块的位置信息和接口信息,将所述断言验证代码与所述目标模块的接口进行连接。
  10. 根据权利要求7所述的装置,其特征在于,所述模块信息确定模块,包括:
    模块信息查找子模块,用于根据芯片的多个模块的模块标识,采用VERDI工具从芯片文件列表中查找所述多个模块的位置信息和接口信息;
    模块信息存储子模块,用于将所述多个模块的模块标识、位置信息和接口信息存储在目标文件中。
  11. 根据权利要求10所述的装置,其特征在于,所述模块信息查找模块,包括:
    模块信息读取子模块,用于在接收到针对目标模块的查找指令时,根据目标模块的模块标识,从所述目标文件中读取对应的位置信息和接口信息。
  12. 根据权利要求7至11中任一项所述的装置,其特征在于,所述目标模块包括:FIFO模块、RAM模块、ARBITER模块、计数器模块其中至少一者。
  13. 一种电子设备,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至6中任一项所述的断言验证代码绑定方法。
  14. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有程序指令,该程序指令被处理器运行时,用于执行如权利要求1至6中任一项所述的断言验证代码绑定方法。
PCT/CN2019/088850 2019-05-28 2019-05-28 一种断言验证代码绑定方法及装置 WO2020237508A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980008861.5A CN111615688A (zh) 2019-05-28 2019-05-28 一种断言验证代码绑定方法及装置
PCT/CN2019/088850 WO2020237508A1 (zh) 2019-05-28 2019-05-28 一种断言验证代码绑定方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/088850 WO2020237508A1 (zh) 2019-05-28 2019-05-28 一种断言验证代码绑定方法及装置

Publications (1)

Publication Number Publication Date
WO2020237508A1 true WO2020237508A1 (zh) 2020-12-03

Family

ID=72204345

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/088850 WO2020237508A1 (zh) 2019-05-28 2019-05-28 一种断言验证代码绑定方法及装置

Country Status (2)

Country Link
CN (1) CN111615688A (zh)
WO (1) WO2020237508A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112364581B (zh) * 2020-11-13 2023-07-25 上海兆芯集成电路股份有限公司 自动在寄存器传输级设计文件中插入特定代码的方法及装置
CN112364580A (zh) * 2020-11-13 2021-02-12 上海兆芯集成电路有限公司 自动在寄存器传输级设计文件中插入特定代码的方法及装置
CN115114135B (zh) * 2021-03-17 2024-05-17 中国联合网络通信集团有限公司 软件数据测试方法、装置、设备、介质及产品
CN116627846B (zh) * 2023-07-20 2023-09-22 北京云枢创新软件技术有限公司 确定目标调用标识的位置信息的方法、电子设备和介质
CN117472670A (zh) * 2023-11-09 2024-01-30 紫光同芯微电子有限公司 一种芯片验证中断言验证管理的方法、装置、系统和介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070156378A1 (en) * 2005-12-30 2007-07-05 Cadence Design Systems, Inc. System and method for verification aware synthesis
CN103019745A (zh) * 2012-12-31 2013-04-03 青岛中星微电子有限公司 一种自动生成断言的方法及装置
CN107016189A (zh) * 2017-04-05 2017-08-04 广东浪潮大数据研究有限公司 一种基于perl实现断言自动插入RTL的方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7313772B2 (en) * 2005-05-24 2007-12-25 International Business Machines Corporation Systems, methods, and media for block-based assertion generation, qualification and analysis
US20070294647A1 (en) * 2006-06-01 2007-12-20 Via Technologies, Inc. Transferring software assertions to hardware design language code
CN103020396B (zh) * 2012-12-31 2016-04-06 青岛中星微电子有限公司 一种自动生成断言的方法及装置
US9501598B1 (en) * 2014-09-22 2016-11-22 Cadence Design Systems, Inc. System and method for assertion publication and re-use

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070156378A1 (en) * 2005-12-30 2007-07-05 Cadence Design Systems, Inc. System and method for verification aware synthesis
CN103019745A (zh) * 2012-12-31 2013-04-03 青岛中星微电子有限公司 一种自动生成断言的方法及装置
CN107016189A (zh) * 2017-04-05 2017-08-04 广东浪潮大数据研究有限公司 一种基于perl实现断言自动插入RTL的方法

Also Published As

Publication number Publication date
CN111615688A (zh) 2020-09-01

Similar Documents

Publication Publication Date Title
WO2020237508A1 (zh) 一种断言验证代码绑定方法及装置
CN111428462B (zh) 通讯协议模板构建的方法及终端设备
TWI627547B (zh) 用於ic設計協定的自動化功能覆蓋生成和管理的系統和方法
US20100180263A1 (en) Apparatus and method for detecting software error
TWI764148B (zh) 風險預測和風險預測模型的訓練方法、裝置及電子設備
US10354031B2 (en) Information processing by interpenetrating signal transmission channel in design for testability of chip
CN105760292B (zh) 一种用于单元测试的断言验证方法和装置
CN109815141B (zh) 一种测试方法和装置
JP6976064B2 (ja) モデルチェックのためのデータ構造抽象化
US9870314B1 (en) Update testing by build introspection
CN109739700B (zh) 一种接口测试方法和装置
JP2018060525A (ja) イベント駆動型ソフトウェアテストシーケンス決定
CN112860587B (zh) Ui自动测试方法和装置
US9064042B2 (en) Instrumenting computer program code by merging template and target code methods
CN109189671B (zh) 逐层夹逼式变量定位方法、系统及终端设备
CN107562423B (zh) Ui页面开发方法及装置
US8554522B2 (en) Detection of design redundancy
US11989560B2 (en) Method and device for executing instructions to perform artificial intelligence
CN115509904A (zh) 一种接口测试用例的断言生成方法及装置
CN109388564B (zh) 一种测试方法、装置及电子设备
CN111859089B (zh) 一种用于互联网信息的错词检测控制方法
CN112463896A (zh) 档案编目数据处理方法、装置、计算设备及存储介质
CN109325239A (zh) 学生课堂表现管理方法及系统
CN110908902B (zh) 一种测试步骤的编辑方法、装置及电子设备
CN113742156B (zh) 联调方法、装置、电子设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19931415

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19931415

Country of ref document: EP

Kind code of ref document: A1