Method for enhancing SVA debugging and control
By writing the construction instantiation of agent abstract classes and signal interfaces in the package file encapsulated by UVC agent, dynamically obtaining configuration objects, solving the problems of inconvenience in debugging of SVA and excessive transmission paths of configuration objects, realizing dynamic transmission and management of SVA, improving the reusability and debugging convenience of project code.
Patent Information
- Application Number
- CN202210085220.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-25
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-01-25
AI Technical Summary
In the prior art, SVA debugging is inconvenient, and rich message type control callback methods cannot be used. The delivery path of the configuration object is too wide, resulting in inconvenient project code management and post-debugging.
Write a proxy abstract class in the package file encapsulated by UVC agent, and derive and construct instantiate through the proxy encapsulation class and signal interface, dynamically obtain configuration objects, and control message callbacks and update synchronization in the agent component to realize dynamic transmission and management of SVA.
It improves the convenience of SVA debugging and the management ability of configuration objects, enhances the reusability of project code and the convenience of post-problem debugging.
Smart Images

Figure CN114443007B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of chip verification, and particularly to a method for enhancing the debugging and control of SVA. Background Art
[0002] As shown in the prior art Figure 1 By using the UVM (Universal Verification Methodology) configuration database config_db to obtain the configured configuration objects in the verification environment, and deriving the UVM component classes in the interface, the configured objects can be directly obtained and passed in the end_of_elaboration_phase by means of the UVM phase mechanism, and the monitoring and updating of the configured objects can be maintained in the run_phase, and finally the dynamic passing of the configured objects to SVA can be realized.
[0003] The existing solutions do not adopt the UVM message printing method, so more rich message types and other control callback methods cannot be used, resulting in inconvenience in debugging after problems occur.
[0004] The SVA (SystemVerilog Assertion) of the existing solutions is encapsulated in a static interface. Therefore, for the setting of the configured objects in the existing solutions, it is necessary to directly pass them downward from the top layer to the interface declared and passed in the top layer module. The scope of the passing path is too wide. The configured objects should be passed layer by layer to the corresponding UVC (Universal Verification Component) encapsulation, and finally passed to the agent, and then the agent passes them to its bottom layer, so as to facilitate the control and management of the configured objects.
[0005] The existing solutions encapsulate SVA in the corresponding interface, while the improved solutions achieve the effect of encapsulating and instantiating SVA code in the agent component, which more conforms to the principle of UVC encapsulation, facilitates the management, reusability and later problem debugging of project code. Summary of the Invention
[0006] According to an embodiment of the present invention, a method for enhancing the debugging and control of SVA is provided, including the following steps:
[0007] Write a proxy abstract class in the package file encapsulated by UVC agent;
[0008] Encapsulate the proxy abstract class in the package file to obtain a proxy encapsulation class;
[0009] Write the get_proxy method in the proxy encapsulation class;
[0010] Derive the proxy abstract class and the proxy encapsulation class in the signal interface and construct and instantiate the proxy encapsulation class;
[0011] The configuration database of UVM passes the proxy encapsulation class to the agent component of UVM;
[0012] The agent component obtains the proxy encapsulation class and calls the get_proxy method to construct and instantiate the derived subclass of the proxy abstract class to obtain the second proxy class;
[0013] Write the message callback object;
[0014] The message reporting system of UVM applies the message callback object to control the message statistics log;
[0015] Dynamically obtain the configuration object and perform real-time update synchronization on the configuration parameters of the configuration object.
[0016] Furthermore, while constructing and instantiating the proxy encapsulation class, write the first implementation method in the signal interface to overload and implement the get_proxy method.
[0017] Furthermore, when the agent component calls the first implementation method to construct and instantiate the derived subclass of the proxy abstract class, the agent component itself is passed as the parent node.
[0018] Furthermore, write the message callback object, including the following sub-steps:
[0019] Inherit the UVM_report_catcher object of UVM;
[0020] Write the callback method in the UVM_report_catcher object.
[0021] Furthermore, the return parameter of the callback method is of the action_e enumeration type.
[0022] Furthermore, the message reporting system of UVM applies the message callback object to control the message statistics log, including the following sub-steps:
[0023] Declare and instantiate the callback object in the end_of_elaboration_phase of UVM;
[0024] Call the static method add of UVM to add the target object to the callback object for processing.
[0025] Furthermore, dynamically obtaining the configuration object includes the following sub-steps:
[0026] Add an update method to the proxy abstract class for updating and synchronizing the configuration object;
[0027] Inherit the proxy abstract class in the signal interface and write a second implementation method for implementing the update method to update and synchronize the configuration object;
[0028] The agent component calls the update method to update and synchronize the configuration parameters.
[0029] The method for enhancing SVA debugging and control according to the embodiments of the present invention solves the defect that the prior art cannot use a richer message type to control the callback method and is inconvenient for debugging, facilitates the control and management of the configuration object, and has the characteristics of convenient project code management, usability, and convenient problem debugging in the later stage.
[0030] It should 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. Brief Description of the Drawings
[0031] Figure 1 Schematic diagram of the SVA encapsulation solution in the prior art according to the embodiments of the present invention;
[0032] Figure 2 Schematic diagram of the method for enhancing SVA debugging and control according to the embodiments of the present invention;
[0033] Figure 3 Schematic diagram of the message reporting system of UVM according to the embodiments of the present invention;
[0034] Figure 4 Flowchart of the method for enhancing SVA debugging and control according to the embodiments of the present invention;
[0035] Figure 5 Sub-step flowchart of step S7 according to the embodiments of the present invention;
[0036] Figure 6 Sub-step flowchart of step S8 according to the embodiments of the present invention;
[0037] Figure 7 Sub-step flowchart of step S9 according to the embodiments of the present invention. Detailed Description of the Embodiments
[0038] The following will describe in detail the preferred embodiments of the present invention with reference to the accompanying drawings and further elaborate on the present invention.
[0039] First, in combination with Figures 2 - 7Describe a method for enhancing SVA debugging and control according to an embodiment of the present invention, which is used for debugging and controlling SVA and has a wide range of application scenarios.
[0040] As Figures 2 - 4 shown, the method for enhancing SVA debugging and control according to an embodiment of the present invention includes the following steps:
[0041] In S1, as Figure 2 、 4 shown, write a proxy abstract class (checker_proxy) in the package file encapsulated by UVCagent as an SVA proxy.
[0042] Furthermore, before writing the proxy abstract class (checker_proxy) in the package file encapsulated by UVC agent, modify all assertions $error into the uvm_error macro, and use the $sformatf method combined with %m to specify the hierarchy, so as to facilitate the debugging of possible problems later.
[0043] In S2, as Figure 2 、 4 shown, encapsulate the proxy abstract class (checker_proxy) in the package file to obtain a proxy encapsulation class (checker_proxy_wrapper).
[0044] In S3, as Figure 2 、 4 shown, write a get_proxy method in the proxy encapsulation class (checker_proxy_wrapper).
[0045] In S4, as Figure 2 、 4 shown, derive the proxy abstract class (checker_proxy) and the proxy encapsulation class (checker_proxy_wrapper) in the signal interface (interface) and construct and instantiate the proxy encapsulation class (checker_proxy_wrapper), but only declare the proxy abstract class (checker_proxy) without constructing and instantiating it. It will only be constructed and instantiated when the get_proxy method inside the encapsulation class is called, and its string name and parent node object are passed through this method.
[0046] Further, while constructing and instantiating the proxy encapsulation class (checker_proxy_wrapper), write the first implementation method in the signal interface to overload and implement the get_proxy method.
[0047] In S5, as Figure 2 , 4 shown, the UVM configuration database passes the proxy encapsulation class (checker_proxy_wrapper) to the UVM agent component.
[0048] In S6, as Figure 2 , 4 shown, the agent component obtains the proxy encapsulation class (checker_proxy_wrapper) and calls the get_proxy method to construct and instantiate a subclass of the proxy abstract class (checker_proxy) to obtain the second proxy class.
[0049] Further, while the agent component calls the first implementation method to construct and instantiate a subclass of the proxy abstract class (checker_proxy), the agent Component itself is passed as the parent node, so that the SVA proxy is classified under the agent node hierarchy. After that, if we want to control the assertion check again, we can complete it through the SVA proxy under the agent hierarchy, that is, finally the effect of encapsulating and instantiating the SVA code in the agent is achieved, which is more in line with the UVC encapsulation principle and facilitates the management, reusability and later problem debugging of the project code.
[0050] In S7, as Figures 2 - 4 shown, write the message callback object (report_catcher).
[0051] Further, write the message callback object (report_catcher), which includes the following sub-steps:
[0052] In S71, as Figures 2 - 5 shown, inherit the UVM UVM_report_catcher object.
[0053] In S72, as Figures 2 - 5 shown, write the callback method (catch) in the UVM_report_catcher object.
[0054] Further, the return parameter of the callback method (catch) is of the action_e enumeration type.
[0055] In S8, asFigures 2 - 4 As shown, the message reporting system of UVM applies message callback objects to control message statistical logs.
[0056] Furthermore, the message reporting system of UVM applies message callback objects to control message statistical logs, including the following sub-steps:
[0057] In S81, as Figures 2 - 4 shown in Figure 6, instantiate the callback object in the end_of_elaboration_phase of UVM.
[0058] In S82, as Figures 2 - 4 shown in Figure 6, call the static method add of UVM to add the target object to the callback object for processing.
[0059] In S9, as Figures 2 - 4 shown, dynamically obtain the configuration object and perform real-time update synchronization on the configuration parameters of the configuration object.
[0060] Furthermore, dynamically obtaining the configuration object includes the following sub-steps:
[0061] In S91, as Figures 2 - 4 shown in Figure 7, add an update method (config_object_sync) to the proxy abstract class (checker_proxy) to perform update synchronization on the configuration object.
[0062] In S92, as Figures 2 - 4 shown in Figure 7, inherit from the proxy abstract class (checker_proxy) in the signal interface (interface) and write a second implementation method for implementing the update method (config_object_sync) to perform update synchronization on the configuration object.
[0063] In S93, as Figures 2 - 4 shown in Figure 7, the agent component calls the update method (config_object_sync) to perform update synchronization on the configuration parameters. At the same time, since we implement the update synchronization of the configuration object in the agent instead of in the helper class in the previous interface, the defect of the overly wide transmission path scope in the previous solution is avoided, because the configuration object passed from the previous-level configuration will be declared and obtained in the agent itself and can be directly used here.
[0064] Specifically, as Figure 3As shown, the working principle of the UVM message reporting system is as follows: First, four different message types, info, warning, error, and fatal, are generated through message macros. Then, the display threshold is set through the display threshold filter to filter out some information that we don't want. Then, corresponding different actions are taken according to information such as the message type and id. In addition, UVM provides message callbacks, that is, the Message Call-backs part in the figure is used to modify the attributes of the message before displaying. The modification callback of the message is implemented by inheriting the UVM object (UVM_report_catcher). It can modify the message type, message redundancy threshold, label id, corresponding operations, and even the specific string printing information, and then perform specific display operations through the UVM message system. Here, mainly the catch() method is implemented, and an enumeration parameter of type action_e is returned. This parameter has two return values.
[0065] Above, with reference to Figures 2 - 7 The method for enhancing SVA debugging and control according to an embodiment of the present invention is described, which solves the defect that the prior art cannot use a more abundant message type control callback method and is inconvenient for debugging, facilitates the control and management of configuration objects, and has the characteristics of convenient project code management, usability, and convenient problem debugging in the later stage.
[0066] It should be noted that in this specification, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, the elements defined by the statement "comprising..." do not exclude the existence of additional identical elements in the process, method, article or device including the said elements.
[0067] Although the content of the present invention has been described in detail through the above preferred embodiments, it should be recognized that the above description should not be considered as a limitation of the present invention. After those skilled in the art have read the above content, various modifications and alternatives to the present invention will be obvious. Therefore, the protection scope of the present invention should be defined by the appended claims.
Claims
1. A method for enhancing the debugging and control of SVA, characterized in that, It includes the following steps: Write a proxy abstract class in the package file encapsulated by UVCagent; Encapsulate the proxy abstract class in the package file to obtain a proxy encapsulated class; Write a get_proxy method in the proxy encapsulated class; Derive the proxy abstract class and the proxy encapsulated class in the signal interface and construct and instantiate the proxy encapsulated class; The configuration database of UVM passes the proxy encapsulated class to the agent component of UVM; The agent component obtains the proxy encapsulated class and calls the get_proxy method to construct and instantiate the derived subclass of the proxy abstract class to obtain a second proxy class; Write a message callback object; The message reporting system of UVM applies the message callback object to control the message statistics log; Dynamically obtain a configuration object and perform real-time update synchronization on the configuration parameters of the configuration object; Dynamically obtaining a configuration object includes the following sub-steps: Add an update method in the proxy abstract class to perform update synchronization on the configuration object; Inherit the proxy abstract class in the signal interface and write a second implementation method for implementing the update method to perform update synchronization on the configuration object; The agent component calls the update method to perform update synchronization on the configuration parameters.
2. The method for enhancing the debugging and control of SVA according to claim 1, wherein, While constructing and instantiating the proxy encapsulated class, write a first implementation method in the signal interface to perform overloading implementation on the get_proxy method.
3. The method for enhancing the debugging and control of SVA according to claim 2, wherein The agent component calls the first implementation method. While constructing and instantiating the derived subclass of the proxy abstract class, the agent component itself is passed as the parent node.
4. The method for enhancing the debugging and control of SVA according to claim 1, wherein Write a message callback object, including the following sub-steps: Inherit the UVM_report_catcher object of UVM; Write a callback method in the UVM_report_catcher object.
5. The method for enhancing the debugging and control of SVA according to claim 4, wherein The return parameter of the callback method is of the action_e enumeration type.
6. The method for enhancing the debugging and control of SVA as claimed in claim 1, wherein The message reporting system of UVM applies the message callback object to control the message statistics log, including the following sub-steps: Declare and instantiate the callback object in the end_of_elaboration_phase of UVM; Call the static method add of UVM to add the target object to the callback object for processing.
Citation Information
Patent Citations
A server SoC software and hardware co-simulation acceleration method and system
CN109711071A
Method and device for achieving AXI VIP through protocol layering and computer readable storage medium
CN111177056A