Virtual Interface Resolution Cannot Find a Matching Instance?

Hi All,

I have;

interface.svh
main_test.svh
param_pkg.sv

////////////////////////////////////
Interface code is as follows;

interface intf #(int DATA=32) ();

endinterface

///////////////////////////////////
Main testcase code is as follows;

class main_test extends uvm_test;

typedef virtual intf#(DATA) i_intf;

if (!uvm_config_db #(i_intf) ::get(this, …))
`uvm_errors(…)

////////////////////////////////////////
Param_pkg is as follows;

package test_param;
localparam DATA=32;
endpackage

///////////////////////////////////////

Now, when running the testcase with Questa 10.5, it gives an error;
Virtual Interface Resolution Cannot Find a Matching Instance for ‘virtual intf #32

I have gone through the similar queries from this forum and I have tried;

  1. Replacing DATA as 32 in main_test, but still the error remains same.
  2. Replacing code in main_test;
    if (!uvm_config_db #(i_intf) ::get(this, …)) with
    if (!uvm_config_db #(i_intf #(32) ) ::get(this, …))

but I could not find the solution.

May I know what changes I need to do to fix this error?

In reply to Mahesh K:

Try creating an instance of intf:


intf u_intf;

In reply to Mahesh K:
You need to make an instance of your interface in the top-level module of your testbench. In the initial block you have to perform a uvm_config_db set to pass this interface to the cnfiguration db.