dmq0420 Posted December 23, 2011 Report Share Posted December 23, 2011 I had created 2 classes like following: class a; class b extends a; I'm using a::type_id::set_type_override(b::get_type()); to do the type override. However, I found it didn't work. I added the post_randomize and some display information in the class b. But it never display anything. ---------------------------- I use the factory.print(), it show the following: Type Overrides: Requested Type Override Type ----------------------- ------------------------------------------ a b Does anyone know this problem? Quote Link to comment Share on other sites More sharing options...
calvapete Posted December 28, 2011 Report Share Posted December 28, 2011 (edited) This is just a guess, so I haven't checked it... Firstly both a and b must be registered with the factory for the factory t be able to print it, and secondly the field which is to be overidden must also be registered with the factory. So say you wanted to override component a with component b in the enviromnent env. component a must include : `uvm_component_<param>_utils (a) component b must include : `uvm_component_<param>_utils ( Environment must include : `uvm_component_utils_begin(env) ... `uvm_field_object(inst_a, UVM_DEFAULT) ... `uvm_component_utils_end I think this will work. Edited December 28, 2011 by calvapete incomplete Quote Link to comment Share on other sites More sharing options...
dmq0420 Posted December 29, 2011 Author Report Share Posted December 29, 2011 Thanks. It works like what you said. 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.