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