mrforever Posted April 1, 2013 Report Share Posted April 1, 2013 Hi, experts, I met such a problem. Here are the codes and the vcs reports: -------codes-------- class my_env extends uvm_env; my_sub_env subenv[]; ... // build phase function void build_phase(uvm_phase phase); ... subenv=new[10]; for (int i =0; i <10; i++) begin subenv = my_sub_env::type_id::create(sformatf("subenv%0d", i), this); end ... endfunction: build_phase // connect phase function void connect_phase(uvm_phase phase); ... foreach(subenv) begin reg_R.a_map.set_sequencer(subenv.v_sqr.cfg_sqr, reg2apb); end ... endfunction: connect_phase endclass: my_env class my_sub_env extends uvm_env; vsequencer v_sqr; ... function void build_phase(uvm_phase phase); ... v_sqr = vsequencer::type_id::create("v_sqr", this); ... endfunction: build_phase ... endclass: my_sub_env -------reports-------- The vcs reports such an error: UVM_FATAL /EDA_Tools/synopsys/vcs1209/etc/uvm-1.1/uvm-1.1c/src/base/uvm_component.svh(1744) @ 0: v_sqr [CLDEXT] Name 'v_sqr' is not unique to other top-level instances. If parent is a module, build a unique name by combining the the module name and component name: $sformatf("%m.%s","v_sqr"). How can I build a unique name when the parent isn't a module. I mean I cann't build a unique name because there is only one v_sqr in class my_sub_env. I have built a unique name for each subenv, that is sformatf("subenv%0d", i). Does the reports mean that each object should have a unique name when there are multiple subenvs? Could anybody help me to solve this problem? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
mrforever Posted April 2, 2013 Author Report Share Posted April 2, 2013 ow can I build a unique name when the parent isn't a module. I mean I cann't build a unique name because there is only one v_sqr in class my_sub_env. I have built a unique name for each subenv, that is sformatf("subenv%0d", i). Does the reports mean that each object should have a unique name when there are multiple subenvs? Could anybody help me to solve this problem? Thanks in advance. Have solved this problem. Quote Link to comment Share on other sites More sharing options...
Hash1 Posted April 4, 2013 Report Share Posted April 4, 2013 Hi can share what is the fix here? -Thanks Quote Link to comment Share on other sites More sharing options...
mrforever Posted April 4, 2013 Author Report Share Posted April 4, 2013 Hi can share what is the fix here? -Thanks You can have one int variable ID to mark the component as the unique one. Then use uvm_config_db to pass specific value to it. Regards mrforever 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.