mea1201 Posted March 9, 2012 Report Share Posted March 9, 2012 AARGH!!! It shouldn't be this difficult, but it apparently is for me. In my top module, I am trying to support a parametric design where the number of interfaces is determined by a parameter (let's call it num_ifs). So, I declared an array of interfaces: my_if_type`params_map my_if[0:num_ifs-1](.*); Later, I would like to set the UVM config DB with these interfaces, so that each agent instance gets the right virtual interface to play with. So, I tried the following: string inst_name; initial begin : SET_CFG_DB foreach(my_if[i]) begin $sformat(inst_name, "MY_IF[%0d]", i); uvm_config_db#(virtual my_if_type`params_map)::set(uvm_root::get(), "*", inst_name, my_if[i]); end : SET_CFG_DB IES (10.20-s105) fails at compile-time with the following: ncvlog: *E,NOTPAR (my_top.sv,line_no|col): Illegal operand for constant expression [4(IEEE)]. The error points to the i index in the config set method call. WTF???!!! I am at a loss here. I don't see anything wrong with what I'm trying to do. Since I have no access to other simulators (Questa, VCS), I cannot say if this problem is Cadence-specific, or a broader UVM issue. The funny part is that I actually have several arrays of interfaces, so the initial block would have several foreach loops. I initially got an INTERNAL EXCEPTION (MESSAGE: cetpfunc unknown wad struct id 'ifs_vst') and an ncvlog.err dump. As I commented each loop out, I could bypass the INTERNAL EXCEPTION and get to the NOTPAR error described earlier. The only work-around I can think of is to do something stupid like this: initial begin : SET_CFG_DB uvm_config_db#(virtual my_if_type`params_map)::set(uvm_root::get(), "*", "MY_IF", my_if); // and so on... end : SET_CFG_DB Clearly, that is not an acceptable work-around for a parametric design. Ideas? Any help? Please? Quote Link to comment Share on other sites More sharing options...
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.