Fatal: (vsim-8451)

Hi,

I have created a interface on the design side.

module aes_agent_bfm(aes_if aif);

   aes_driver_bfm driver(aif.master_mp);
   //tbx vif_binding_block
   initial begin
      import uvm_pkg::uvm_config_db;
      uvm_config_db #(virtual aes_driver_bfm)::
         set(null, "*", $psprintf("%m.driver"), driver);
   end
   
   aes_monitor_bfm monitor(aif.monitor_mp);
   //tbx vif_binding_block
   initial begin
      import uvm_pkg::uvm_config_db;
      uvm_config_db #(virtual aes_monitor_bfm)::
         set(null, "*", $sprintf("%m.monitor"), monitor);
   end
endmodule
----------------------------------------------------------------------------
interface aes_monitor_bfm(aes_if aif);
// pragma attribute aes_monitor_bfm partition_interface_xif   
      
   parameter int AES_RSP_NUM_BITS = $bits(aes_response_s);
   parameter int AES_RSP_NUM_BYTES = (AES_RSP_NUM_BITS+7)/8;
   
   typedef bit [AES_RSP_NUM_BITS-1:0] aes_response_vector_t;
   
   wire clk = aif.clk;
   
   task data_monitor(input aes_response_s rsp); //pragma tbx xtf
     @(posedge clk) 
	      $display("In the monitor vif.vip_clk.valid_out = %d", aif.valid_out); 
              $display("monitor_valid_out=%d", rsp.valid_out);
              $display("ciphertext=%h", rsp.ciphertext);
         end             
     endtask
endinterface
------------------------------------------------------------------------------------------
`ifndef ENCRYPT_ENV_SV
 `define ENCRYPT_ENV_SV

import uvm_pkg::*;
`include "uvm_macros.svh";
`include "agent.sv" 

class encrypt_env extends uvm_env;

  `uvm_component_utils(encrypt_env)

   encrypt_agent agent;
  
  function new(string name, uvm_component parent);
    super.new(name, parent);
  endfunction
  
  function void build_phase(uvm_phase phase);
    super.build_phase(phase);
    agent = encrypt_agent::type_id::create("agent", this);   
    uvm_config_db #(virtual aes_driver_bfm)::get(this, "", "top.aes_agent.driver", agent.driver.v_drv_bfm);   
    uvm_config_db #(virtual aes_monitor_bfm)::get(this, "", "top.aes_agent.monitor", agent.monitor.v_mon_bfm);  
  endfunction
endclass
`endif
------------------------------------------------------------------------------------------------------

Now i am getting the following error
Virtual interface resolution cannot find a matching instance for “virtual aes_monitor_bfm”

In reply to shankar_logic:

Your code looks a little bit confusing and essential parts are missing. I do not see any definition of your encrypt_agent.
Is the aes_agent_bfm your toplevel module of your UVM testbench?
What is the aes_driver_bfm? Is it a module or is it a class?

No actually aes_agent is the toplevel module and aes_agent_bfm is a module in the design side which includes aes_driver_bfm and aes_monitor_bfm.

In reply to shankar_logic:

Your answer confuses me. Is your design behavioral code? Because BFMs are not synthesizable.

In reply to shankar_logic:

Assuming you know what you are doing with fancy interfaces that you’ve shown, my guess is a typ - you got $sprintf instead of $psprintf:


uvm_config_db #(virtual aes_monitor_bfm)::
         set(null, "*", $sprintf("%m.monitor"), monitor);

If the error you mentioned comes from UVM at run time - this could well be the reason. Try using +UVM_CONFIG_DB_TRACE to debug further.

Srini
www.verifworks.com

In reply to shankar_logic:

Considering you have done class and module instantiations correctly.

Issue is with uvm_config_db:: get method,

As inside aes_agent_bfm uvm_config_db::set() method shares resources with name
1)aes_agent_bfm.driver
2)aes_agent_bfm.monitor

While uvm_config_db::get() method tries to access them with name-
1)top.aes_agent.driver
2)top.aes_agent.monitor

These field_name should be same as that of used with uvm_config_db::set().

In reply to DigvijayS:

Hi Shankar,
If your driver or monitor which you are using in set methods inside the module named aes_agent_bfm returning “top.aes_agent” or not?

If it is not returning then it will failed to get that config information with mismatched strings respectively.

Please check that %m return part.