Jump to content

Recommended Posts

Posted (edited)

Hi,

I met some problem when I use parameterized interface in UVM 1.1. I don't know where I made the mistake.

It reported that "UVM_FATAL @ 0.00ns:uvm_test_top.env.ig_il.drv [NOIVF] virtual interface must be set for: uvm_test_top.env.eg_il.drv.if"

If I changed .EBB_SIZE(5),.DATA_SIZE(32) to the default .EBB_SIZE(4),.DATA_SIZE(16), eveything is OK.

Could any help to point out where's wrong? Thanks a lot!

Following is my code:

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

// Interface definition in il_if.sv

interface il_if #(EBB_SIZE=4, DATA_SIZE=16) (input logic clock);

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

//interface instantiation in il_tb.sv

il_if #(.EBB_SIZE(5),.DATA_SIZE(32)) drv_if(core_clk);

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

//Virtual interface assignment in il_top.sv

initial begin

uvm_config_db#(virtual il_if #(.EBB_SIZE(5),.DATA_SIZE(32)))::set(uvm_root::get(),"*drv","vif",il_tb.drv_if);

......

end

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

//Interface get in il_driver.sv

class il_driver extends uvm_driver #(il_pkt);

protected virtual il_if #(.EBB_SIZE(5),.DATA_SIZE(32)) vif;

......

function void build phase(uvm_phase phase);

super.build_phase(phase);

if(!uvm_config_db #(virtual il_if #(.EBB_SIZE(5), .DATA_SIZE(32)))::get(this,"","vif",vif))

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

endfunction: build_phase

endclass : il_driver

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

//Create driver in il_agent.sv

class il_agent extends uvm_agent;

il_driver drv;

.....

function void build_phase(uvm_phase phase);

super.build_phase(phase);

drv = il_driver::type_id::create("drv",this);

...

endfunction

endclass: il_agent

Best Regards

Benben

Edited by xiangben
Posted

how do you create create your driver?

Hi uwes,

class il_agent extends uvm_agent;

il_driver drv;

.....

function void build_phase(uvm_phase phase);

super.build_phase(phase);

drv = il_driver::type_id::create("drv",this);

...

endfunction

endclass: il_agent

class il_driver extends uvm_driver #(il_pkt);

protected virtual il_if#(.EBB_SIZE(5),.DATA_SIZE(32)) vif;

......

function build_phase(uvm_phase phase);

super.build_phase(phase);

if(!uvm_config_db #(virtual il_if #(.EBB_SIZE(5),.DATA_SIZE(32)))::get(this,"","vif",vif))

......

endfunction: build_phase

...

endclass:il_driver

Posted (edited)

how do you create create your driver?

Hi uwes,

Do we have any suggested example of parameterized interface with UVM? If there's one, we can follow it.

Edited by xiangben
Posted

Parameters used for sizing interfaces are like viruses! They propagate to every variable and environment that must use them.

Much better to rely on Verilog's automatic resizing and be done with it. That way, you can write width-generic code.

http://www.vmmcentral.org/vmartialarts/2008/07/size-does-matter/

Hi janick,

Does the "resizing" you mentioned is to declare a maximum size of interface we may use and then assign the interface varibles to a smaller size of interface?

Posted (edited)

Hi Benben,

you could try making your interface polymorphic. I found that a very elegant way for the parameterized interface to not behave like a virus, as Janick said. (And he is right.)

Cheers

Gunther

Edited by Gunther

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.

×
×
  • Create New...