CN113835787A - Visitor mode method applied to VIP - Google Patents
Visitor mode method applied to VIP Download PDFInfo
- Publication number
- CN113835787A CN113835787A CN202111183926.5A CN202111183926A CN113835787A CN 113835787 A CN113835787 A CN 113835787A CN 202111183926 A CN202111183926 A CN 202111183926A CN 113835787 A CN113835787 A CN 113835787A
- Authority
- CN
- China
- Prior art keywords
- component
- interviewee
- visitor
- uvm
- vip
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 63
- 238000004806 packaging method and process Methods 0.000 claims abstract description 3
- 230000007246 mechanism Effects 0.000 abstract description 7
- 230000008859 change Effects 0.000 abstract description 3
- 238000012795 verification Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 4
- 230000004075 alteration Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4488—Object-oriented
- G06F9/4492—Inheritance
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a visitor mode method applied to VIP, comprising the following steps: creating a component A, wherein the component A is not derived from a UVM component, and code data of a preset function is added in the component A according to needs; packaging the component A by using a UVM component, wherein the UVM component provides an accessor component and an interviewee component; inheriting the visitor component to obtain the access method of the visitor; inheriting an interviewee component, and obtaining an access method of an interviewee so as to accept the access of an interviewee; and calling the accessed method of the interviewee, automatically executing the access method of the calling interviewee and realizing overloading. The invention adopts the visitor mode in software development to solve the problem of adding new codes in the existing codes and does not change the original codes; the invention can replace the existing scheme, namely the function of overloading by using the factor mechanism, to a certain extent.
Description
Technical Field
The invention relates to the technical field of visitor modes, in particular to a visitor mode method applied to VIP.
Background
In the chip verification process, new functions, such as adding some checks, printing records of a debugging log, and the like, are often required to be added in a built verification environment, that is, some data members or interface methods are added in some of the classes. Of course, the simplest and most straightforward method is to add functions directly to the corresponding code. However, if the verification environment code is to be developed and maintained by another colleague, then a principle needs to be followed that you preferably do not alter the code of the other party for later code maintainability considerations. In addition, you may not know what unknown effects your modified part will have on other parts of the original verification environment, causing the entire verification platform to become unstable.
Therefore, for the above situation, the existing scheme is to inherit the class that needs to be changed originally, then develop the class in the subclass, and replace the original parent class by the overloading function of the factory mechanism of the UVM (Universal Verification Methodology) when in use. The overloading function of the factor mechanism is a common practice, but in order to improve the development efficiency, the Verification platform often combines VIP (Verification IP) purchased from EDA manufacturers for Verification, and whether to not modify VIP for stability is not mentioned, and the VIP is often encrypted and cannot be directly modified at all, i.e. new functions cannot be added in the VIP. And often cannot be implemented using the previously existing scheme, i.e., the overloading function of the factor mechanism can no longer be used. Because the first two of the following three conditions using the factory mechanism are not met: first, whether the overloaded class (B) or the reloaded class (A) is, when defined, the object or component is to be registered in the factor using the macro 'uvm _ object _ utilis (T) or' uvm _ component _ utilis (T). Second, the reloaded class (A), when instantiated, is to use type _ name: : type _ id: : the way of create () is instantiated instead of the new constructor. Third, the overloaded class (B) must be derived from, i.e., must be a subclass of, the overloaded class (a). VIP, provided by EDA manufacturers, is likely not developed based on UVM methodology, meaning that the first two are not satisfied. In such a case, the original solution is not feasible and a new solution is needed to solve the above-mentioned problems.
Disclosure of Invention
According to an embodiment of the present invention, there is provided a visitor mode method applied to a VIP, including the steps of:
creating a component A, wherein the component A is not derived from a UVM component, and code data of a preset function is added in the component A according to needs;
packaging the component A by using a UVM component, wherein the UVM component provides an accessor component and an interviewee component;
inheriting the visitor component to obtain the access method of the visitor;
inheriting an interviewee component, and obtaining an access method of an interviewee so as to accept the access of an interviewee;
and calling the accessed method of the interviewee, automatically executing the access method of the calling interviewee and realizing overloading.
Further, the preset functions include: and detecting data and debugging the printing record of the log.
Further, the visitor component also includes: a start method, an end method, and an access method.
Further, for class codes which are not developed based on the UVM components, elements of one layer of UVM components are packaged in the class codes.
According to the visitor mode method applied to the VIP, the visitor mode in software development is adopted to solve the problem that new codes are added in the existing codes, and the original codes are not changed; the invention can replace the existing scheme, namely the function of overloading by using the factor mechanism, to a certain extent.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and are intended to provide further explanation of the claimed technology.
Drawings
Fig. 1 is a schematic diagram illustrating a visitor pattern method applied to a VIP according to an embodiment of the present invention.
FIG. 2 is a visitor pattern method applied to a VIP according to an embodiment of the present invention
Detailed Description
The present invention will be further explained by describing preferred embodiments of the present invention in detail with reference to the accompanying drawings.
First, a visitor mode method applied to a VIP according to an embodiment of the present invention will be described with reference to fig. 1 to 2, which is used for adding some new functions (such as checking, printing records of a debug log, and the like) in a built verification environment, and the application scenarios of the visitor mode method are wide.
As shown in fig. 1-2, a visitor mode method applied to a VIP according to an embodiment of the present invention includes the following steps:
s1: as shown in fig. 1-2, a component a is created, which is not derived from the UVM component, and code data of a preset function is added to the component a as needed.
S2: as shown in fig. 1-2, a UVM component is used to package a, the UVM component providing an interviewer component (UVM _ visitor) and an interviewee component (UVM _ visitor _ adapter).
S3: as shown in fig. 1-2, the visitor component (uvm _ visitor) is inherited to obtain the visitor's access method (visit method). In this embodiment, the visitor component (uvm _ visitor) is an abstract parent class provided for the visitor, and may access any node object in the existing authentication platform, inherit the abstract parent class to generate a visitor, write an access method (visit method) for implementing the visitor therein, and add a new function to the original class in the method.
S4: as shown in fig. 1-2, inheriting an interviewee component, and obtaining an accessed method of an interviewee so as to receive the access of an interviewee. In this embodiment, the interviewee component (uvm _ viewer _ adapter) is an abstract parent class that is referred to the interviewee (receiving access), inherits this class to create an interviewee, and writes therein the interviewee's access method (accept method) to indicate which interviewee is to access which interviewee.
S5: as shown in fig. 1-2, the visited method of the visited person is called, and the visited method of the calling visitor is automatically executed, so as to realize overloading. In this embodiment, if the interviewee accepts the visitor to access the interviewee, then the method (visit method) for executing the visitor is called, so that the function newly added to the visitor before is equivalent to being added to the interviewee object, which means that the newly added change of the original code function is realized.
Further, as shown in fig. 1-2, in the present embodiment, the preset functions include: and detecting data and debugging the printing record of the log.
Further, as shown in fig. 1-2, in the present embodiment, the visitor component further includes: a start method (begin _ v method), an end method (end _ v method), and an access method (visit _ display method).
Further, as shown in fig. 1 to 2, in the present embodiment, for a class code that is not developed based on a UVM component, a layer of elements of the UVM component is encapsulated therein, so as to access the class code.
In the above, with reference to fig. 1 to 2, a visitor mode method applied to VIP according to an embodiment of the present invention is described, and the present invention adopts a visitor mode in software development to solve the problem of adding a new code to an existing code and to achieve no change to the original code; the invention can replace the existing scheme, namely the function of overloading by using the factor mechanism, to a certain extent.
It should be noted that, in the present specification, 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 … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
While the present invention has been described in detail with reference to the preferred embodiments, it should be understood that the above description should not be taken as limiting the invention. Various modifications and alterations to this invention will become apparent to those skilled in the art upon reading the foregoing description. Accordingly, the scope of the invention should be determined from the following claims.
Claims (4)
1. A visitor pattern method applied to a VIP, comprising the steps of:
creating a component A which is not derived from a UVM component and in which code data of a preset function is added according to needs;
packaging the component A by using the UVM component, wherein the UVM component provides an accessor component and an interviewee component;
inheriting the visitor component to obtain an access method of a visitor;
inheriting the interviewee component to obtain an interviewing method of an interviewee so as to accept the visit of an interviewee;
and calling the accessed method of the interviewee, automatically executing the access method of the calling interviewee and realizing overloading.
2. The visitor pattern method applied to a VIP of claim 1 wherein the predetermined function comprises: and detecting data and debugging the printing record of the log.
3. The visitor pattern method applied to a VIP of claim 1 wherein the visitor component further comprises: a start method, an end method, and an access method.
4. A visitor mode method applied to a VIP as claimed in claim 1 wherein elements of a layer of the UVM component are encapsulated therein for class code not developed based on the UVM component.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111183926.5A CN113835787A (en) | 2021-10-11 | 2021-10-11 | Visitor mode method applied to VIP |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111183926.5A CN113835787A (en) | 2021-10-11 | 2021-10-11 | Visitor mode method applied to VIP |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113835787A true CN113835787A (en) | 2021-12-24 |
Family
ID=78968571
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111183926.5A Pending CN113835787A (en) | 2021-10-11 | 2021-10-11 | Visitor mode method applied to VIP |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113835787A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117172168A (en) * | 2023-08-10 | 2023-12-05 | 芯华章智能科技(上海)有限公司 | Method for realizing callback in simulation, electronic equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN206921077U (en) * | 2017-05-23 | 2018-01-23 | 北京同方微电子有限公司 | A kind of register checking auto-building model device based on UVM |
CN111859834A (en) * | 2020-06-12 | 2020-10-30 | 苏州浪潮智能科技有限公司 | UVM-based verification platform development method, system, terminal and storage medium |
CN112131147A (en) * | 2020-09-21 | 2020-12-25 | 成都海光微电子技术有限公司 | Controller verification method, device and system, electronic equipment and storage medium |
-
2021
- 2021-10-11 CN CN202111183926.5A patent/CN113835787A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN206921077U (en) * | 2017-05-23 | 2018-01-23 | 北京同方微电子有限公司 | A kind of register checking auto-building model device based on UVM |
CN111859834A (en) * | 2020-06-12 | 2020-10-30 | 苏州浪潮智能科技有限公司 | UVM-based verification platform development method, system, terminal and storage medium |
CN112131147A (en) * | 2020-09-21 | 2020-12-25 | 成都海光微电子技术有限公司 | Controller verification method, device and system, electronic equipment and storage medium |
Non-Patent Citations (2)
Title |
---|
LI LEE: "访问接口先后顺序_UVM设计模式 (五)访问者模式、uvm_phase、uvm_visitor", pages 7 - 8, Retrieved from the Internet <URL:https://blog.csdn.net/weixin_29189003/article/details/112658818> * |
MELON XIANG: "UVM方法学与设计模式(三):访问者模式 & UVM Objection", pages 1 - 7, Retrieved from the Internet <URL:https://zhuanlan.zhihu.com/p/66392196> * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117172168A (en) * | 2023-08-10 | 2023-12-05 | 芯华章智能科技(上海)有限公司 | Method for realizing callback in simulation, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3786722B2 (en) | Method and apparatus for effective use of progressive object-oriented program using digital signature | |
US7886041B2 (en) | Design time validation of systems | |
US8863074B2 (en) | Software modeling framework | |
US9575873B2 (en) | Software testing system and method | |
CN108614702B (en) | Byte code optimization method and device | |
US20070073724A1 (en) | System and method for automatic or semi-automatic software integration | |
US20060195819A1 (en) | Method and system for verifying rule compliance of an application object | |
US20080306958A1 (en) | System and method for role based analysis and access control | |
CN102339219B (en) | For supporting the system and method for object-oriented wscript.exe | |
CN111259412B (en) | Authority control method, authority control device, computer equipment and storage medium | |
CN104360920A (en) | Automatic testing method and device for interface | |
TW200937188A (en) | Contract programming for code error reduction | |
US20070169065A1 (en) | Computer program with metadata management function | |
CN111782535A (en) | Test method and device | |
US20050251719A1 (en) | Test case inheritance controlled via attributes | |
US5848232A (en) | Method of making secure collaboration between objects of an object-oriented program | |
EP3812917A1 (en) | Data structure reading method and apparatus, data structure updating method and apparatus, and electronic device | |
CN113835787A (en) | Visitor mode method applied to VIP | |
US20050149712A1 (en) | Post-install configuration of modules during startup of a modular application platform | |
US20030051229A1 (en) | Application class extensions | |
US10176011B2 (en) | Automatically generating and executing a service operation implementation for executing a task | |
US6792596B2 (en) | Method and system for protecting resource central programs | |
EP1498813A2 (en) | Design time validation of systems | |
CN111752547A (en) | Method for modifying Java serialized object serial number and application thereof | |
CN115495196A (en) | Container mirror image compliance checking method and system for container cloud platform |
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 | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Country or region after: China Address after: 3 / F, 665 Zhangjiang Road, China (Shanghai) pilot Free Trade Zone, Pudong New Area, Shanghai Applicant after: Yunhe Zhiwang (Shanghai) Technology Co.,Ltd. Address before: 311202 Room 202, building 1, Information Port Phase V, No. 733, Jianshe Third Road, economic and Technological Development Zone, Xiaoshan District, Hangzhou City, Zhejiang Province Applicant before: Hangzhou yunhezhi Network Technology Co.,Ltd. Country or region before: China |