Cannot pass virtual interface with default parameters to a class constructor (vsim-8754)

At load time in Questasim, I am getting the error “vsim-8754: Actual input arg. of type ‘virtual axi_ifc’ for formal ‘axi’ of ‘new’ is not compatible with the formal’s type ‘virtual axi_ifc #(32, 2, 32)’”. Here is the offending code:

virtual axi_ifc axi;
. . .
begin
   axi_target_submonitor #() tgc_mon;
   tgc_mon = new(axi, cfg, cfg.this_analog_of(RX_SYS_CTRL), inport, outport); // <--
   tgc_mon.body();
end

axi is a virtual interface of type virtual axi_ifc (with default parameters) passed to a class whose declaration is:

class axi_target_submonitor #(uint DATA_W = 32, ID_W = 2, ADDR_W = 32,
                              type INSEQ=m_seq_item, OUTSEQ=m_seq_item)
      extends
      axi_common_submonitor #(DATA_W, ID_W, ADDR_W, INSEQ, OUTSEQ);

   function new(virtual axi_ifc #(DATA_W, ID_W, ADDR_W)  axi       = null,
                maui_agent_config                        cfg       = null,
                xactor_s                                 partner   = INV_XACTOR,
                uvm_analysis_port #(INSEQ)               inport    = null,
                uvm_analysis_port #(OUTSEQ)              outport   = null);

      this.is_master = 0;
      this.axi       = axi;
      this.cfg       = cfg;
      this.partner   = partner;
      this.inport    = inport;
      this.outport   = outport;
   endfunction
endclass

My interface declaration is:

interface axi_ifc #(
   parameter   DATA_W   = 32,
   parameter   ID_W     = 2,
   parameter   ADDR_W   = 32
) (
   input       aclk
);

Questa does not seem to understand that axi_ifc’s default parameters are #(32,2,32). Any easy fix or switch I can use to get around this?

In reply to tonyle:

Try explicitly setting the parameters to #(32,2,32) see if it matches then. Also, it a good idea to write #() to take all the defaults to show your intent to take all the defaults, not that you forgot to specify them.

In reply to dave_59:

That works fine. I’d hoped I wouldn’t have to do that. I’ve since rewritten the constructor to pass the virtual interface directly and grab the needed parameters from there instead of re-parameterizing the VI. Thanks for your reply, in any case.