Here change in interface can be interpreted as adding more signals or as big of a change as you can think of.
I don’t want to change any (or most less possible) of my TB code. (specially in my driver and monitor where i declare vif and get value from uvm_config_db, And also I don’t want to keep new interface’s name same as my old interface.)
What I think:
- create new interface with another name : interface definition
/*
interface interface_1(input clk); // old
endinterface
*/
interface interface_2(input clk); // new
endinterface
- declare it in top tb, update dut connection if needed(replace old interface signals with new interface signals: assuming same ports), pass it through uvm_config_db
//interface_1 _if(clk); // old
interface_2 _if(clk); // new
/*
dut_module u0 (.clk(clk), // old
.rstn(_if.rstn),
.in(_if.in),
.out(_if.out));
*/
dut_module u0 (.clk(clk), // new
.rstn(_if.rstn),
.in(_if.in),
.out(_if.out),
.new_s(_if.new_s)); // (for example new signal added in interface)
//uvm_config_db#(virtual interface_1)::set(null,"", "interface_1", _if); // old
uvm_config_db#(virtual interface_2)::set(null,"", "interface_2", _if); // new
- In base test, declare it as virtual and then get/set for any component which need access to interface
/*
virtual interface_1 vif; // old
if (!uvm_config_db#(virtual interface_1)::get(this, "", "interface_1", vif))
`uvm_fatal("TEST", $psprintf("did not get vif"))
uvm_config_db#(virtual interface_1)::set(this, "*", "interface_1", vif);
*/
virtual interface_2 vif; // new
if (!uvm_config_db#(virtual interface_2)::get(this, "", "interface_2", vif))
`uvm_fatal("TEST", $psprintf("did not get vif"))
uvm_config_db#(virtual interface_2)::set(this, "*", "interface_2", vif);
- in monitor and driver i have : Which I Absolutely don’t want to touch.
virtual interface_1 vif; // need interface access
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
// CONFIG DB implementation
if (!uvm_config_db#(virtual interface_1)::get(this, "", "interface_1", vif))
`uvm_fatal("MONNITOR", $psprintf("did not get vif"))
What do i need to do in this type of situation? Does any kind of uvm type/inst override help ? I doubt it because we don’t register our interface to uvm factory.