Error-[TMAFTC] Too many arguments to function/task call

I am getting the following error in the uvm code

Error-[TMAFTC] Too many arguments to function/task call
/apps/vcsmx/etc/uvm-1.2/src/base/uvm_registry.svh, 66
“packet::new(name, parent)”
The above function/task call is done with more arguments than needed

In reply to yethishwar:

I do not know what packet is, but uvm_components need 2 arguments in the constructor, but uvm_objects only 1.

In reply to yethishwar:

It is difficult to help you without seeing your code. But from the error you showed, I think there was mismatched between “new” method and “create” statement:
It seems your “packet” class is an object (extended from uvm_oject), then please make sure:

  • “new” method of packet class has only one argument: new(string name = “packet”)
  • “create” statement to create packet class should has one argument as well: packet::type_id::create(“packet”).

In reply to chris_le:

yeah i have checked whole code .and passed the arguments as required .here is the code

ifndef PACKET_SV define PACKET_SV

class packet extends uvm_sequence_item;
rand integer we_addr;
rand integer rd_addr;
//rand integer data_out ;
rand integer data_in ;
rand integer we,rd;
//registry with factory
uvm_object_utils_begin (packet) uvm_field_int(we_addr,UVM_ALL_ON)
uvm_field_int (rd_addr,UVM_ALL_ON) uvm_field_int (data_in,UVM_ALL_ON)
uvm_field_int (we,UVM_ALL_ON) uvm_field_int (rd,UVM_ALL_ON)
`uvm_object_utils_end

//constructor
function new(string name = “packet”);
super.new(name);
endfunction
endclass : packet

`endif

In reply to yethishwar:

It seems the packet class is ok. The error is still happening? Where did you create this packet? Please check create statement.

In reply to chris_le:

Could you please show where and how you are constructing your seq_item?

In reply to chr_sue:

ifndef DPRAM_SCOREBOARD_SV define DPRAM_SCOREBOARD_SV

uvm_analysis_imp_decl(_before) uvm_analysis_imp_decl(_after)

class dpram_scoreboard extends uvm_scoreboard;
`uvm_component_utils(dpram_scoreboard)
uvm_analysis_imp_before #(packet,dpram_scoreboard) item_collected_before;
uvm_analysis_imp_after #(packet,dpram_scoreboard) item_collected_after;

	uvm_tlm_analysis_fifo #(packet) before_fifo;
	uvm_tlm_analysis_fifo #(packet) after_fifo;

	packet packet_1;
	packet packet_2;
		

function new(string name,uvm_component parent);
	super.new(name,parent);
	packet_1 = new("packet_1");
	packet_2 = new("packet_2");

endfunction :new

function void build_phase(uvm_phase phase);
	super.build_phase(phase);
  item_collected_before = new("item_collected_before",this);
  item_collected_after = new("item_collected_after",this);

	before_fifo = new("before_fifo ",this);
	after_fifo = new("after_fifo ",this);

endfunction :build_phase

//write
 function void connect_phase(uvm_phase phase );
	 item_collected_before.connect(before_fifo.analysis_export);
	 item_collected_after.connect(after_fifo.analysis_export);

// pkt.print();
endfunction : connect_phase

task run();

forever begin 
  before_fifo.get(packet_1);
  after_fifo.get(packet_2);
compare();

end
endtask :run

virtual function void compare();
if(packet_1 ==packet_2) begin
uvm_info("compare ",{"test : OK!"} ,UVM_LOW); end else begin uvm_info(“compare”,{“Test : Fail !”},UVM_LOW);
end
endfunction :compare

endclass : dpram_scoreboard

`endif

In reply to chr_sue:

In reply to chris_le:
Could you please show where and how you are constructing your seq_item?

could you please help me with this code , i am not able to find the bug

In reply to chris_le:

can you please me with this code , i am not able to find the bug .
here is the link for the code

In reply to yethishwar:

You are registering an object or component with the incorrect `uvm_xxx_utils() call, and have likely copy/pasted code to cause this error.

Make sure that every component uses uvm_component_utils(class_name) and every object uses uvm_object_utils(class_name).

DO NOT use the field macros (uvm_object_utils_begin or uvm_component_utils_begin). See other topics regarding why to not do this.

Make sure that class_name in the `uvm_xxx_utils() matches the actual class name and isn’t duplicated from a different class. It seems like you may have used ‘packet’ twice.

In reply to yethishwar:

In reply to chris_le:
can you please me with this code , i am not able to find the bug .
here is the link for the code
dpram_uvm_code_ with scoreboard_without_fifo - EDA Playground

Please run your code with another simulator as VCS. It generates a lot of errors.
Could you please explain what are the components starting with ‘_’.

In reply to yethishwar:

Look at line 8 of dpram_driver.sv. It has the exact error that I described above.

In reply to cgales:

One of your problems is here:

class dpram_driver extends uvm_driver #(packet);
  `uvm_component_utils(packet)

You have to register the dpram_driver like this

class dpram_driver extends uvm_driver #(packet);
  `uvm_component_utils(dpram_driver)

Another proble is in your packet class. The registration with the factory and using the field macros has to look like this

 `uvm_field_utils_begin(packet)  
  `uvm_field_int(we_addr,UVM_ALL_ON)
  `uvm_field_int (rd_addr,UVM_ALL_ON)
  `uvm_field_int (data_in,UVM_ALL_ON)
  `uvm_field_int (we,UVM_ALL_ON)
  `uvm_field_int (rd,UVM_ALL_ON)
  `uvm_field_utils_end

After fixing this you’ll see a lot more of errorrs.