Hi all
i am a beginner in uvm. please correct me if any wrong.
The error message is
Error-[MFNF] Member not found
apb_agent.sv, 48
“this.seqr.”
Could not find member ‘seq_item_export’ in class ‘apb_rw_seq’, at
“apb_sequence.sv”, 41.
Here is a part of my code.
Many thanks in advance.
//---------------------------------------------------------------------
class apb_seq_item extends uvm_sequence_item;
//------------------
// items
//------------------
rand bit [31:0] addr;
rand bit [31:0] data;
rand bit [1:0] mode;
// Mode 0: Idle
// Mode 1: Write
// Mode 2: Read
// Mode 3: Bulk Write
bit [31:0] rdata;
constraint const_a{addr[31:0] >=0; addr[31:0] < 32'd256;};
constraint const_d{data[31:0] >=0; data[31:0] <= 32'hffff;};
//constraint const_m{mode[1:0] >=0; mode[1:0] <=2;};
//------------------
// construct
//------------------
function new(string name = "apb_seq_item");
super.new(name);
endfunction: new
endclass: apb_seq_item
class apb_bulk_seq extends uvm_sequence #(apb_seq_item);
`uvm_object_utils(apb_bulk_seq)
bit [2:0] bulk_count;
//----------------------
// construct
//----------------------
function new(string name = "apb_bulk_seq");
super.new(name);
endfunction
//----------------------
// bulk write
//----------------------
virtual task body();
bulk_count = 7;
if (bulk_count != 0) begin
repeat (1) begin
req = apb_seq_item::type_id::create("req");
start_item(req);
if(!req.randomize()) begin
`uvm_error("RANFAIL", "Randomize failed.");
end
finish_item(req);
bulk_count --;
end
end
else
bulk_count = 7;
endtask
endclass: apb_bulk_seq
class apb_rw_seq extends uvm_sequence #(apb_seq_item);
`uvm_object_utils(apb_rw_seq)
//----------------------
// construct
//----------------------
function new(string name = "apb_rw_seq");
super.new(name);
endfunction
virtual task body();
//`uvm_info(get_type_name(),$sformatf("------ Signle Write Mode ------"),UVM_LOW)
req = apb_seq_item::type_id::create("req");
start_item(req);
if(!req.randomize()) begin
`uvm_error("RANFAIL", "Randomize failed.");
end
finish_item(req);
endtask
endclass: apb_rw_seq
class apb_seq extends uvm_sequence #(apb_seq_item);
apb_rw_seq rw_seq;
apb_bulk_seq bulk_seq;
apb_seq_item my_item;
`uvm_object_utils(apb_seq)
//----------------------
// construct
//----------------------
function new(string name = "apb_seq");
super.new(name);
endfunction
//----------------------
// bulk mode count reset
//----------------------
virtual task body();
if (my_item.mode == 3) begin
`uvm_info(get_type_name(),$sformatf("------ Bulk Write Mode ------"),UVM_LOW)
`uvm_do(bulk_seq)
end
else if (my_item.mode == 1) begin
`uvm_info(get_type_name(),$sformatf("------ Signle Write Mode ------"),UVM_LOW)
`uvm_do(rw_seq)
end
else if (my_item.mode == 2) begin
`uvm_info(get_type_name(),$sformatf("------ Signle Read Mode ------"),UVM_LOW)
`uvm_do(rw_seq)
end
else
`uvm_info(get_type_name(),$sformatf("------ Idle Mode ------"),UVM_LOW)
`uvm_do(rw_seq)
endtask
endclass: apb_seq
//------------------------------------------
`include "apb_seq_item.sv"
`include "apb_sequence.sv"
`include "apb_driver.sv"
//`include "apb_monitor.sv"
class apb_agent extends uvm_agent;
//-----------------
// instance
//-----------------
apb_driver driver;
apb_rw_seq seqr;
// apb_monitor monitor;
`uvm_component_utils(apb_agent)
//-----------------
// construct
//-----------------
function new (string name, uvm_component parent);
super.new(name, parent);
endfunction: new
//-----------------
// build
//-----------------
function void build_phase(uvm_phase phase);
super.build_phase(phase);
// monitor = apb_monitor::type_id::create("monitor", this);
//creating driver and sequence only for ACTIVE agent
if(get_is_active() == UVM_ACTIVE) begin
driver = apb_driver::type_id::create("driver",this);
seqr = apb_rw_seq::type_id::create("seqr",this);
end
endfunction: build_phase
//-----------------
// connect
//-----------------
function void connect_phase(uvm_phase phase);
if(get_is_active() == UVM_ACTIVE) begin
driver.seq_item_port.connect(seqr.seq_item_export);
end
endfunction: connect_phase
endclass: apb_agent