NULL pointer dereference Problem in UVM

Dear All,

I’m trying to understand “NULL pointer dereference” Problem in my UVM

First off I do add multiple sequences for running multiple sequence.
and then I implement the style of “seq.start(sequencer)” for running the multiple sequence within multiple sequencer as the below.

But I’m getting the error message of NULL pointer dereference, Do I something understand wrong conceptually?
What am I supposed to do?



class test2 extends base_test;

  // component macro
  `uvm_component_utils(test2)

  // component constructor
  function new(string name, uvm_component parent);
    super.new(name, parent);
  endfunction : new

  function void build_phase(uvm_phase phase);
	super.build_phase(phase);
	seq_yapp_5_packets			= yapp_5_packets 	     ::type_id::create("seq_yapp_5_packets"		  , this);
	seq_yapp_012_seq            = yapp_012_seq           ::type_id::create("seq_yapp_012_seq"         , this);
	seq_yapp_1_seq              = yapp_1_seq             ::type_id::create("seq_yapp_1_seq"           , this);
	seq_yapp_111_seq            = yapp_111_seq           ::type_id::create("seq_yapp_111_seq"         , this);
	seq_yapp_incr_payload_seq   = yapp_incr_payload_seq  ::type_id::create("seq_yapp_incr_payload_seq", this);
	seq_yapp_rnd_seq            = yapp_rnd_seq           ::type_id::create("seq_yapp_rnd_seq"         , this);
	seq_six_yapp_seq            = six_yapp_seq           ::type_id::create("seq_six_yapp_seq"         , this);
	seq_yapp_exhaustive_seq     = yapp_exhaustive_seq    ::type_id::create("seq_yapp_exhaustive_seq"  , this);
  endfunction

  task run_phase(uvm_phase phase);
	  super.run_phase(phase);
	  phase.raise_objection(this);    // raise objection
		seq_yapp_5_packets.start(		yapp.tx_agent.sequencer);
    	seq_yapp_012_seq.start(			yapp.tx_agent.sequencer);
		seq_yapp_1_seq.start(			yapp.tx_agent.sequencer);  
		seq_yapp_111_seq.start(			yapp.tx_agent.sequencer);
		seq_yapp_incr_payload_seq.start(yapp.tx_agent.sequencer);
		seq_yapp_rnd_seq.start(			yapp.tx_agent.sequencer);         
		seq_six_yapp_seq.start(			yapp.tx_agent.sequencer);         
		seq_yapp_exhaustive_seq.start(	yapp.tx_agent.sequencer);  
	  phase.drop_objection(this);     // drop objection

  endtask
endclass : test2


In reply to UVM_LOVE:

Your problem is here:

  task pre_body();
    starting_phase.raise_objection(this, get_type_name());
    `uvm_info(get_type_name(), "raise objection", UVM_MEDIUM)
  endtask : pre_body

  task post_body();
    starting_phase.drop_objection(this, get_type_name());
    `uvm_info(get_type_name(), "drop objection", UVM_MEDIUM)
  endtask : post_body

The starting phase has not been set. When commenting out both tasks. It works.
3 additional things:
(1) be carefull using the obhection mechanism. The best place is the test.
(2) when using `uvm_do the pre_body and post_body task are not executed automatically.
(3) in the build_phase the UVM components will be constructed. The sequences are uvm_objects and not components. They will be constructed on the body task.

In reply to chr_sue:

Thanks a lot!

In your comments, “The starting phase has not been set.”
1.Would you please let me know some good reference about how to set “the starting phase”?

Thanks again.^^

In reply to UVM_LOVE:

What you should do when implementing the objection mechanism in the sequence is the following:

task pre_start;
    uvm_phase starting_phase = get_starting_phase();
    if (starting_phase != null)
      starting_phase.raise_objection(this);
  endtask

get_starting_phase() returns the starting_phase object.
In your case you do not have this object.

When implementing the objection in the test it is not a good idea to do this also in the sequence.
You might end up in a big confusion.