If I do not connect uvm_analysis_port to uvm_analysis_imp and use uvm_analysis_port.write method. What should happen

Hello,

I do not connect uvm_analysis_port to uvm_analysis_imp and using

uvm_analysis_port.write

Should not it give fatal error?

As write method for uvm_analysis_port is as below


  // Method: write
  // Send specified value to all connected interface
  function void write (input T t);
    uvm_tlm_if_base # (T, T) tif;
    for (int i = 0; i < this.size(); i++) begin
      tif = this.get_if (i);
      if ( tif == null )
        uvm_report_fatal ("NTCONN", {"No uvm_tlm interface is connected to ", get_full_name(), " for executing write()"}, UVM_NONE);
      tif.write (t);
    end 
  endfunction

So if it gets tif = null , it will give FATAL Error.

I may not be clear with understanding.
Please correct me

In reply to Jinam Shah:

No. this.size() will be 0 because no connections have been made. An analysis port can have 0 or more connections.

In reply to dave_59:

In reply to Jinam Shah:
No. this.size() will be 0 because no connections have been made. An analysis port can have 0 or more connections.

Ok. Thank you Dave_59. In which case this FATAL can trigger

In reply to Jinam Shah:

This might be overly conservative error checking. If something went wrong in your connection, you might get an error, but you would have to study the rest of the code to know for sure.