Jump to content

interface must be assigned a matching interface or virtual interface


ssingh
 Share

Recommended Posts

I have a 'parametrised' module(lets say mod) that has a 'parameterized' interface (lets say intf) inside it . I do the following in my top module:

initial

begin

uvm_config_db #(virtual intf)::set(null, "uvm_test_top", "vif", test_mod.test_intf);

run_test();

$finish;

end

test_mod is an instance of type mod (instantiated in top module). test_intf is an instance of type intf instantiated inside module mod. I tried to use permit_unmatched_virtual_intf flag with vsim command but I still get the error "interface must be assigned a matching interface or virtual interface".

I changed the above line to:

uvm_config_db #(virtual intf#(LINK_SPEED(4'h2))::set(null, "uvm_test_top", "vif", test_mod.test_intf);

Where LINK_SPEED is the parameter. Now this gives me the next error("[NOVIF] virtual interface must be set for: uvm_test_top.vif") in uvm_test class where I do the following in the build phase:

if(!uvm_config_db#( virtual intf)::get(this, "", "vif", hook))

`uvm_fatal("NOVIF",{"virtual interface must be set for: ",get_full_name(),".vif"});

hook is declared as : virtual intf hook. If I try to parameterize the hook declaration and the above statement, I go back to the original error. Can somebody help ? I have questa sim 10.0d

Link to comment
Share on other sites

  • 4 years later...

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 how to use the command in vsim "-permit_unmatched_virtual_int". 

My script looks like;

vlib $work

vmap work $work

vlog file1.svh

vopt top -o top_opt

vsim  -t  1ps  -c  top_opt  -permit_unmatched_virtual_int  +define+RTL  +define+AXI  .....   +UVM_TESTNAME=test  -do  "run  -a; q"

Now received one more error;

**Error: (vish-3296) Unknown option -permit_unmatched_virtual_int

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...