Sign in to follow this  
Followers 0
Bart

Problems with starting_phase

7 posts in this topic

I'm trying to use the new get_starting_phase() mechanism in UVM1.2, but it's not working for me.

 

For UVM1.1, I have the following working fine:

 

  task pre_body();

    if (starting_phase != null)

      starting_phase.raise_objection( this, get_type_name() );

  endtask

 

In UVM1.2 RC8, I add:

 

  task pre_body();

       uvm_phase phase = get_starting_phase();

    if (starting_phase != null)

      starting_phase.raise_objection( this, get_type_name() );

  endtask

 

This just doesn't work. get_starting_phase() returns null everytime and the objection is never raised so the simulation immediately ends.

 

Attached is a simple testcase - in UVM1.1 the sequence successfully waits for 20ns, but after adding get_starting_phase(), in UVM1.2 RC8 the simulation ends immediately.

 

Have I misunderstood how get_starting_phase is suposed to work?

Share this post


Link to post
Share on other sites

OK attach file doesn't seem to work - heres the simple test case example:

module top;
  import uvm_pkg::*;
  `include "uvm_macros.svh"

class base_seq extends uvm_sequence;
 
  `uvm_object_utils(base_seq)

  function new(string name="base_seq");
    super.new(name);
  endfunction

  task pre_body();
    uvm_phase phase = get_starting_phase(); // add for UVM1.2
    if (starting_phase != null) begin
      starting_phase.raise_objection(this, get_type_name());
      `uvm_info(get_type_name(), "raise objection", UVM_MEDIUM)
    end
  endtask : pre_body

  task body();
    #20ns;
  endtask

  task post_body();
    uvm_phase phase = get_starting_phase(); // add for UVM1.2
    if (starting_phase != null) begin
      starting_phase.drop_objection(this, get_type_name());
      `uvm_info(get_type_name(), "raise objection", UVM_MEDIUM)
    end
  endtask : post_body

endclass : base_seq

class test extends uvm_test;

  `uvm_component_utils(test)

  uvm_sequencer sequencer;

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

  function void build_phase(uvm_phase phase);
    super.build_phase(phase);
    sequencer = uvm_sequencer::type_id::create("sequencer", this);
    uvm_config_wrapper::set(this, "sequencer.run_phase",
                            "default_sequence",
                            base_seq::type_id::get());

  endfunction
endclass

initial begin
  run_test("test");
end

endmodule : top

Share this post


Link to post
Share on other sites

Duh - thanks Alan - you're right.

 

However that raises a much more serious question.

 

I thought that using get_starting_phase() was optional in UVM1.2. However since the method call is redundant in the example above, it shows that the UVM1.1 starting phase mechanism fails with no warning or error in UVM1.2.

 

Thats a big backwards compatibility issue!

Share this post


Link to post
Share on other sites

Bart-

 

That's definitely a bug in the library, and there's a mantis item open for it at: http://www.eda.org/mantis/view.php?id=4969

 

For the record, "get_starting_phase()" isn't 'optional', it's the official mechanism for retrieving the starting phase.  The old "starting_phase" variable is considered deprecated in UVM 1.2... so if there are no references to it whatsoever, then everything works.  The bug is in the deprecation code, which isn't properly setting the old variable.

 

Thanks for the help,

 

-Justin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0