Hi,
I face a problem when using a parameterized OVC.
I have a component declared this way:
class vc_param_driver #(int RAM_DATA_WIDTH=32, int RAM_ADDR_WIDTH=17) extends ovm_driver #(vc_param_seq_item);
vc_param_seq_item s_item;
vc_param_configuration cfg;
virtual vc_param_interface #(.RAM_DATA_WIDTH_g(RAM_DATA_WIDTH), .RAM_ADDR_WIDTH_g(RAM_ADDR_WIDTH)) vif;
`ovm_component_param_utils_begin(vc_param_driver#(RAM_DATA_WIDTH,RAM_ADDR_WIDTH))
`ovm_field_object(cfg, OVM_ALL_ON)
`ovm_component_utils_end
From the toplevel, I create the env (which creates agent and then this driver), like this:
vc_param_agt = vc_param_agent #(32,24)::type_id::create(“vc_param_agt”,this);
And in the agent:
driver=vc_param_driver #(RAM_DATA_WIDTH,RAM_ADDR_WIDTH)::type_id::create(“driver”,this);
The toplevel interface is also instantiated with the parameters 32 and 24.
But the test bench can’t load. I get the following error:
** Fatal: (vsim-8451) …/vcparam_driver.svh(88): Virtual interface resolution cannot find a matching instance for ‘virtual vc_param_interface #(.RAM_ADDR_WIDTH_g(17), .RAM_DATA_WIDTH_g(32))’.
Candidates are:
…/vc_param_interface.svh(152): vc_param_interface #(.RAM_ADDR_WIDTH_g(24), .RAM_DATA_WIDTH_g(32)) mif()
…/vc_param_interface.svh(213): vc_param_interface #(.RAM_ADDR_WIDTH_g(24), .RAM_DATA_WIDTH_g(32)) mif()
It seems that when elaborating the bench, the tool uses the static default values given to the driver’s parameters to create the virtual interface instance, instead of using the values set from top-level… This I don’t understand. Is it really the case, or did I do something wrong somewhere?
Thanks in advance!