I was running a code and while compileing i met with the error given below and i am not able to debugg this . so, please give some suggetions on this.
** Error: (vsim-3978) ../tbd/mc_agent.sv(66): Illegal assignment to class mtiUvm.uvm_pkg::uvm_port_base #(class mtiUvm.uvm_pkg::uvm_tlm_if_base #(class work.mc_interface_sv_unit::mc_xactn, class work.mc_interface_sv_unit::mc_xactn)) from class mtiUvm.uvm_pkg::uvm_analysis_imp #(class work.top/mc_xactn, class mtiUvm.uvm_pkg::uvm_tlm_analysis_fifo #(class work.top/mc_xactn))
** Error: (vsim-8754) ../tbd/mc_agent.sv(66): Actual input arg. of type ‘class mtiUvm.uvm_pkg::uvm_analysis_imp #(class work.top/mc_xactn, class mtiUvm.uvm_pkg::uvm_tlm_analysis_fifo #(class work.top/mc_xactn))’ for formal ‘provider’ of ‘connect’ is not compatible with the formal’s type ‘class mtiUvm.uvm_pkg::uvm_port_base #(class mtiUvm.uvm_pkg::uvm_tlm_if_base #(class work.mc_interface_sv_unit::mc_xactn, class work.mc_interface_sv_unit::mc_xactn))’.
I am getting error similar to this
Error: (vsim-3978) tc_agent.sv(21): Illegal assignment to class mtiUvm.uvm_pkg::uvm_port_base #(class mtiUvm.uvm_pkg::uvm_sqr_if_base #(class mtiUvm.uvm_pkg::uvm_sequence_item, class mtiUvm.uvm_pkg::uvm_sequence_item)) from class mtiUvm.uvm_pkg::uvm_seq_item_pull_imp #(class work.v::tc_transaction, class work.v::tc_transaction, class mtiUvm.uvm_pkg::uvm_sequencer #(class work.v::tc_transaction, class work.v::tc_transaction))
Error: (vsim-8754) tc_package.sv(21): Actual input arg. of type ‘class mtiUvm.uvm_pkg::uvm_seq_item_pull_imp #(class work.v::tc_transaction, class work.v::tc_transaction, class mtiUvm.uvm_pkg::uvm_sequencer #(class work.v::tc_transaction, class work.v::tc_transaction))’ for formal ‘provider’ of ‘connect’ is not compatible with the formal’s type ‘class mtiUvm.uvm_pkg::uvm_port_base #(class mtiUvm.uvm_pkg::uvm_sqr_if_base #(class mtiUvm.uvm_pkg::uvm_sequence_item, class mtiUvm.uvm_pkg::uvm_sequence_item))’.
I am designing a simple VIP .The error is coming in the tc_agent.sv file. The error line is actually is the connection phase
line 21: tc_d.seq_item_port.connect(tc_seqr.seq_item_export);
The original poster never came back with a response to what their problem was - there are many different reasons that you could be getting this error. I suspect your problem is different, but showing us the code would help a lot.
I suspect you are connecting a sequencer and driver and have not parameterized them with the same sequence_item class.
Hello Dave,
here is the agent code where I get the error.
class tc_agent extends uvm_agent;
`uvm_component_utils(tc_agent)
tc_driver tc_d;
tc_monitor tc_m;
tc_sequencer tc_seqr;
function new(string name,uvm_component parent);
super.new(name,parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
tc_d=tc_driver::type_id::create(“tc_d”,this);
tc_m=tc_monitor::type_id::create(“tc_m”,this);
tc_seqr=tc_sequencer::type_id::create(“tc_seqr”,this);
endfunction:build_phase
function void connect_phase(uvm_phase phase);
super.connect_phase(phase);
tc_d.seq_item_port.connect(tc_seqr.seq_item_export);
//tc_m.
endfunction:connect_phase
endclass:tc_agent
Thanks for a quick reply. I really appreciate this.
The driver code
class tc_driver extends uvm_driver;
`uvm_component_utils(tc_driver)
virtual intf dut_vi; //virtual interface
function new(string name, uvm_component parent);
super.new(name,parent);
endfunction
function void build_phase(uvm_phase phase);
endfunction:build_phase
task run_phase(uvm_phase phase);
forever
begin
tc_transaction tx;
@(posedge dut_vi.clock);
seq_item_port.get_next_item(tx); //the get_next_item is synchronus to the start_item()
dut_vi.a<=tx.a;
dut_vi.comma<=tx.comma;//pin wiggles for the DUT
dut_vi.enable<=tx.enable;
//dut_vi.out=tx.out;
seq_item_port.item_done();//transaction is complete
end //this signals the sequencer that transaction is complete
//it //this tells the sequencer to return
endtask:run_phase
endclass:tc_driver
===============================
The sequence code
class tc_sequence extends uvm_sequence;
`uvm_object_utils(tc_sequence)
tc_transaction tc_tr;
function new(string name=“tc_sequence”);
super.new(name);
endfunction:new
task body();
//tc_transaction tc_tr;
tc_tr=tc_transaction::type_id::create("tc_tr");
//`uvm_do(tc_tr)
repeat(100)
begin
start_item(tc_tr); //the start_item returns
//the driver is ready to recive the transaction
//this synchronize the driver with the sequencer
assert(tc_tr.randomize());
//tc_tr.cmd=READ; read (use enum)
finish_item(tc_tr);
end
endtask:body
function void report_phase(uvm_phase phase);
//if(tc_tr.randomize)
// $display("the randomization is successfull");
endfunction:report_phase