sanketshah Posted January 24, 2013 Report Share Posted January 24, 2013 I am unable to retrieve associative array from config database. Here is what I tried. class sample extends uvm_object; int a; endclass class ex_sample extends uvm_component; typedef bit[3:0] addr; sample s_obj[addr]; function build_phase(uvm_phase phase); super.new(phase); uvm_config_db#(sample)::set(this,"*","s_obj",s_obj); endfunction endclass ERROR:: "formal and actual do not have assignment compatible data types" Quote Link to comment Share on other sites More sharing options...
sanketshah Posted January 24, 2013 Author Report Share Posted January 24, 2013 Also, I want to know if data set is visible to upper layer. Means Is it possible that data is set by monitor or driver and get inside agent or level above it. Quote Link to comment Share on other sites More sharing options...
Hash Posted January 24, 2013 Report Share Posted January 24, 2013 Tried compiling the code as irun -uvm -sv <Test.sv> and could not reproduce the issue, am using 11.10-s067 NCSIM Am i missing something here? Quote Link to comment Share on other sites More sharing options...
dave_59 Posted January 24, 2013 Report Share Posted January 24, 2013 s_obj is an associative array of sample handles, yet your config_db is parametrized by only a single sample handle. Try using a typedef typedef bit[3:0] addr_t; typedef sample s_obj_aa_t[addr_t]; s_obj_aa_t s_obj_aa; function build_phase(uvm_phase phase); super.new(phase); uvm_config_db#(s_obj_aa_t)::set(this,"*","s_obj_aa",s_obj_aa); Quote Link to comment Share on other sites More sharing options...
sanketshah Posted January 24, 2013 Author Report Share Posted January 24, 2013 Thanks Dave for the response. I wrap my associative array inside one class and they put into uvm_config_db. That is working. Still, I will change to the solution you have provided. I have one more question. I believe uvm_config_db#(type)::set(this,"*","handle",handle) will be visible to all the components down to the hierarchy from current level(this to "*"). Is it possible to get this handle on upper layer. Will uvm_root::get as "cntxt" will solve the issue? Quote Link to comment Share on other sites More sharing options...
dave_59 Posted January 24, 2013 Report Share Posted January 24, 2013 You are better off performance-wise wrapping many variables in one config class than setting/getting many individual variables. Yes, if you can get a handle to that component from an upper layer, you can replace 'this; with than handle. 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.