uvm:8.4.2 to create a class from a string

Source: Internet
Author: User

1.factory a parameterized class is required to create a class based on a string:


2. When defining a Class (My_driver), declare a corresponding registry class and its variables:


1) When creating an instance, place the pointer of the instance and the name "My_driver" in a union array global_tab.

2) The above basic is Uvm_*_utils macro implementation of the function, just uvm_*_utils macro to do more, better.

3) Me=new () should be just for name, not for real in-memory instances.


3. When you want to create an instance of My_driver based on the class name "My_driver", first find the pointer to the registry# (My_driver, My_driver) instance of the "My_driver" index from Global_tab me_ptr , and then call the Me_ptr.inst = new () function, and eventually return to Me_ptr.inst. The process is as follows:


Basically, it's just that the real implementation is much more complicated than this.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

uvm:8.4.2 to create a class from a string

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.