kam.zamani Posted February 25, 2015 Report Share Posted February 25, 2015 My env configuration object consists of a bunch of other configuration objects. They all extend from uvm_object. When I try to create the smaller config objects inside the new function of the env config, I get a compile error: formal and actual do not have assignment compatible data types (expecting datatype compatible with 'class uvm_pkg::uvm_component' but found 'class usb_env_cfg_pkg::usb_env_config' instead) But when I move the "create" to another fucntion that is called after creating the env config, it is fine. However, this is forcing me into first creating the env config and then calling a method (e.g. init) in it in order to create all those other config objects inside it. Can anyone shed some light why is this? Thank you, Kam Quote Link to comment Share on other sites More sharing options...
bhunter1972 Posted February 26, 2015 Report Share Posted February 26, 2015 Without seeing the code, I cannot be certain. However, I suspect that in your call to create the lower-level objects, you have provided a this pointer. In other words, I think you're doing this: my_cfg = my_cfg_c::type_id::create("my_cfg", this); When you should just be doing this: my_cfg = my_cfg_c::type_id::create("my_cfg"); Only components get a this pointer. kam.zamani 1 Quote Link to comment Share on other sites More sharing options...
kam.zamani Posted February 26, 2015 Author Report Share Posted February 26, 2015 Yes that was it. Thank you. Where is this documented? I could not find anything about type_id::create's arguments anywhere in the UVM 1.1 Reference. Quote Link to comment Share on other sites More sharing options...
dave_59 Posted February 26, 2015 Report Share Posted February 26, 2015 (edited) This because you need to understand the macro `uvm_oject_utils() See parameterized-classes-static-members-and-the-factory-macros, then look at the Reference for uvm_object_registry. Edited July 27 by dave_59 replace link shobhanaswarnkar and kam.zamani 1 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.