Hi
Am getting following error in following tb scenario.
I have instantiated axi uvc in my tb and it is compile clean
Following that, am trying to send some random traffic on axi interface but getting run time error as below
Error-[NOA] Null object access
tb/sequences/tb_v_seq.sv, 117
The object at dereference depth 1 is being used before it was
constructed/allocated.
Please make sure that the object is allocated before using it.
Few questions:
- How do I know which object is the error referring to? When I look at the line number mentioned in the error, it is referring to the line in bold and underlined. So it could be either sequence or sequencer. I suspect p_sequencer because when I use
uvm_do instead of
uvm_do_on it again stops where p_sequencer is called. - What am I missing here in my code. I have created the seqr and also connected.
Any help/pointers is really appreciated.
Here is the required code
class tb_env extends uvm_env; // {
`uvm_component_utils(tb_env)
tb_vseqr vseqr;
//AXI switch Master agent
uvc_mst_env axi_switch_mst;
uvc_vif_mem_proxy vif_switch_m_proxy;
function new(string name = "TB_ENV", uvm_component parent);
super.new(name, parent);
endfunction:new
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
axi_switch_mst = uvc_mst_env::type_id::create("axi_switch_mst", this);
vif_switch_m_proxy = uvc_vif_mem_proxy::type_id::create("vif_switch_m_proxy",this);
vif_switch_m_proxy.assign_vi(tb_verif_top.axi_switch_mst_if);
uvm_config_db#(uvm_object)::set(this, "axi_switch_mst.agent", "vif_proxy", vif_switch_m_proxy);
vseqr = tb_vseqr::type_id::create("vseqr",this);
endfunction : build_phase
// Function: connect_phase
//
virtual function void connect_phase (uvm_phase phase); // {
super.connect_phase(phase);
vseqr.axi_switch_mst_wr_seqr = axi_switch_mst.agent.wr_agent.sequencer;
endfunction : connect_phase // }
endclass: tb_env // }
class tb_vseqr extends uvm_sequencer; // {
`uvm_component_utils(tb_vseqr)
uvc_mst_wr_sequencer axi_switch_mst_wr_seqr;
// Function: new
//
// This is an constructor, which creates with given ~name~
function new (string name = "tb_vseqr", uvm_component parent = null); // {
super.new(name,parent);
endfunction : new // }
// Function: build_phase
//
// In this phase the cfg interface is get using config_db, which is used in the <tb_v_seq> to get the clk, rst information.
virtual function void build_phase (uvm_phase phase); // {
super.build_phase(phase);
axi_switch_mst_wr_seqr = uvc_mst_wr_sequencer::type_id::create("axi_switch_mst_wr_seqr", this);
endfunction : build_phase // }
endclass : tb_vseqr // }
class tb_v_seq extends uvm_sequence ; // {
`uvm_object_utils(tb_v_seq)
`uvm_declare_p_sequencer(tb_vseqr)
function new (string name = "tb_v_seq"); // {
super.new(name);
endfunction : new // }
// Driving the Reset
virtual task tb_reset ();
.......
`uvm_info(get_type_name(),"Resetting DUT done",UVM_NONE)
endtask : tb_reset
endclass : tb_v_seq // }
class tb_random_axi_switch_seq extends tb_v_seq; // {
`uvm_object_utils(tb_random_axi_switch_seq)
`uvm_declare_p_sequencer(tb_vseqr)
seq_mst_rand_alltypes_incr axi4_wr_seq_incr;
function new(string name = "tb_random_axi_switch_seq"); // {
super.new(name);
endfunction : new // }
// Task: body
//
virtual task body(); // {
**_`uvm_do_on(axi4_wr_seq_incr,p_sequencer.axi_switch_mst_wr_seqr);_**
`uvm_info(get_type_name(),"AXI transaction sent",UVM_NONE)
endtask: body // }
endclass : tb_random_axi_switch_seq // }
class seq_mst_rand_alltypes_incr extends uvc_mst_wr_seq_base#(uvc_axi4_transaction);
`uvm_object_utils(seq_mst_rand_alltypes_incr)
uvc_axi4_transaction transfer;
function new (string name = "seq_mst_rand_alltypes_incr");
super.new(name);
endfunction // new
virtual task body();
uvm_report_info(get_type_name(), "Starting....");
for (int i= 0; i < 16;i++) begin
for (int j = 0; j <= 10;j++) begin
repeat(8) begin
`uvm_create(transfer)
initialize_axi4_transaction(transfer);
`uvm_rand_send_with(transfer, {addr <= 32'h10000; len == i; size == j;burst == AXI_BURST_TYPE_INCR;})
end
end
end
uvm_report_info(get_type_name(), "Completed....");
endtask
endclass : seq_mst_rand_alltypes_incr
Thank you for your time