shalsays Posted January 29, 2013 Report Share Posted January 29, 2013 When uvm_component is created using create method of uvm_factory its does not throw an error inspite of the following code in header "uvm_component.svh":- // create // ------ function uvm_object uvm_component::create (string name =""); `uvm_error("ILLCRT", "create cannot be called on a uvm_component. Use create_component instead.") return null; endfunction Following is the code which I am using:- class my_env extends uvm_env; `uvm_component_utils(my_env) //implementation of my_env endclass class my_tb extends uvm_component; //implementation of testbench my_env env_local; function void build_phase(uvm_phase phase); super.build_phase(phase); env_local = my_env::type_id::create("env_local", this); endfunction : build_phase endclass Am I interpreting anything wrong here?Can we use create method to create a uvm_component? Quote Link to comment Share on other sites More sharing options...
jadec Posted February 11, 2013 Report Share Posted February 11, 2013 Your example is correct. I think you're confusing the component's own "create" method with the factory "create_object_by_type" method. The "create" method of a component is defined by `uvm_component_utils and uses the factory "create_component_by_type" method like it is supposed to. Quote Link to comment Share on other sites More sharing options...
shalsays Posted February 12, 2013 Author Report Share Posted February 12, 2013 Thanks Jadec. I learnt that after posting here.The confusion was with craete method. create method called in the example is of create_component_by_type as I have called `uvm_component_utils before. It is not the "create" of create_object_by_type. 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.