# Virtual Interface Resolution Cannot Find a Matching Instance?

**URL:** <https://verificationacademy.com/forums/t/virtual-interface-resolution-cannot-find-a-matching-instance/32999>\
**Category:** UVM\
**Tags:** UVM, virtual-Inter, mat, instance\
**Created:** [March 27, 2017, 10:35am UTC](https://verificationacademy.com/forums/t/virtual-interface-resolution-cannot-find-a-matching-instance/32999 "2017-03-27T10:35:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahesh\_6](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Mahesh\_6](https://verificationacademy.com/forums/u/Mahesh_6)\
**Post date:** [March 27, 2017, 10:35am UTC](https://verificationacademy.com/forums/t/virtual-interface-resolution-cannot-find-a-matching-instance/32999/1 "2017-03-27T10:35:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![landrewparker](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/l/a88e4f/32.png) [@landrewparker](https://verificationacademy.com/forums/u/landrewparker)\
**Post date:** [March 27, 2017, 2:59pm UTC](https://verificationacademy.com/forums/t/virtual-interface-resolution-cannot-find-a-matching-instance/32999/2 "2017-03-27T14:59:56Z")

</div>

_In reply to [Mahesh K](https://verificationacademy.com/forums/t/virtual-interface-resolution-cannot-find-a-matching-instance/32999):_

Try creating an instance of intf:

```verilog

intf u_intf;

```

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [March 27, 2017, 3:53pm UTC](https://verificationacademy.com/forums/t/virtual-interface-resolution-cannot-find-a-matching-instance/32999/3 "2017-03-27T15:53:20Z")

</div>

_In reply to [Mahesh K](https://verificationacademy.com/forums/t/virtual-interface-resolution-cannot-find-a-matching-instance/32999/2):_  
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.
