UVM Error Mismatched number of actual and formal arguments in function tmp.new call

762 views
Skip to first unread message

Peter Lin

unread,
Dec 4, 2019, 8:27:51 PM12/4/19
to EDA Playground
https://www.edaplayground.com/x/2MF6
ERROR VCP2898 "Mismatched number of actual and formal arguments in function tmp.new call." "testclass.sv" 7 443
ERROR VCP2898 "Mismatched number of actual and formal arguments in function tmp.new call." "testclass.sv" 11 473

Can someone help?

thanks
/Peter


Matthew Taylor

unread,
Dec 5, 2019, 3:55:02 AM12/5/19
to EDA Playground

Yes. Whenever you extend a class in UVM, you must override the constructor. So, instead of

`include "packet.sv"
class packet_generator extends uvm_sequence #(packet);
  `uvm_object_utils(packet_generator)
endclass

you need

`include "packet.sv"
class packet_generator extends uvm_sequence #(packet);
  `uvm_object_utils(packet_generator)
  function new (string name = "");
    super.new(name);
  endfunction
endclass

This is because, by default, systemVerilog calls the base class constructor with no arguments if you do not override the constructor in the extended class. As you have found, "no arguments" is the wrong number of arguments. You'll have to do the same thing for your packet class, too.

Frankly, in systemVerilog, if you extend a class, always override the constructor and always call super.new.

Matthew

Matthew Taylor

unread,
Dec 5, 2019, 3:55:46 AM12/5/19
to EDA Playground

Peter Lin

unread,
Dec 5, 2019, 4:19:31 AM12/5/19
to EDA Playground
You are right, that is the issue.  After I updated it, the original issue disappears, but I am now getting 
# KERNEL: Warning: Call to undefined Verilog far function 'factory.print' from file '/home/runner/testclass.sv' encountered.
# KERNEL: Warning: Call to undefined Verilog far function 'factory.^print^^' from file '/home/runner/testclass.sv' encountered.
# KERNEL: Warning: Call to undefined Verilog far function 'factory.^print^^^OUT' from file '/home/runner/testclass.sv' encountered.

Any clue?

thanks
/Peter

Peter Lin

unread,
Dec 5, 2019, 4:32:40 AM12/5/19
to EDA Playground
Resolved it, can't use UVM 1.2(not official release), need to stick with 1.1d.

Matthew Taylor

unread,
Dec 5, 2019, 9:51:42 AM12/5/19
to EDA Playground

This error is caused by you calling the factory's print method without declaring and initialiising the factory variable. You need this:
 
  virtual function void end_of_elaboration_phase (input uvm_phase phase);
    uvm_factory factory = uvm_factory::get();
    super.end_of_elaboration_phase(phase);


Also, there should be no semicolon at the end of this line:

    `uvm_info("TEST","HELLO WORLD", UVM_MEDIUM)

Peter Lin

unread,
Dec 5, 2019, 7:22:44 PM12/5/19
to EDA Playground
Good point, if I use uvm 1.1d, it does not complain on this.
Also Aldec seems to be loose on `umm_info..... with ';' at the end.  It actually works fine.

thanks

cmplin

unread,
Oct 2, 2021, 11:16:37 PM10/2/21
to EDA Playground
Hi,
    I am having problem accessing my playground account using my google account, can you check for me?
This is the message I received. My google account is cmp...@gmail.com.

HTTP Status 404 -


type Status report

message

description The requested resource is not available.


Apache Tomcat/7.0.52 (Ubuntu)


thanks
/Peter

--
You received this message because you are subscribed to a topic in the Google Groups "EDA Playground" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/eda-playground/CHbDZ6KhLro/unsubscribe.
To unsubscribe from this group and all its topics, send an email to eda-playgroun...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eda-playground/a9d3179f-7161-4259-af95-13f5d2eb8fb8%40googlegroups.com.

cmplin

unread,
Oct 2, 2021, 11:19:16 PM10/2/21
to EDA Playground
Weird, after more than 10 times trying, it is working again. No idea what happened.

/Peter
Reply all
Reply to author
Forward
0 new messages