Hypothetical question : what if there are major updates in my interface, creating new interface with different name but don't want to touch Driver & Monitor code

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:

  1. create new interface with another name : interface definition

/*
interface interface_1(input clk); // old
endinterface
*/    
interface interface_2(input clk);  // new
endinterface  

  1. 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


  1. 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);  

  1. 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.

In reply to vickydhudashia:

Unfortunately a interface design unit or virtual interface does not fit into the OOP inheritance model to allow factory overrides.

Since you say you don’t want to touch any of your testbench code I have to assume that these additional signals have no functionality that your testbench has to be aware of. Otherwise you need to explain how these additional signal will impact your test.

One way of handling this is parameterizing your agent with the virtual interface name and passing that parameter down to the monitor and driver classes.

Another way that might also handle functional changes in the interface is creating an accessor class registered with the factory and each override can deal with the particular interface as needed. See Doulos

In reply to dave_59:

Thanks Dave, I learned something new !