Quantcast
Channel: UVM Forums RSS Feed
Viewing all articles
Browse latest Browse all 756

problem about macro uvm_do_with()

$
0
0

Hi, all

 

I have met such a problem, when i use uvm_do_with to start item, then it is stuck at uvm_do_with.

 

The hierarchy struct of the sequence is

v_seq

      |- cfg_seq

      |- sub_seq

      |- slv_seq

 

The hierarchy struct of the sequencer is

v_sqr

      |- cfg_sqr

      |- sub_sqr

      |- slv_sqr

 

pieces of code in test.sv

  task run_phase(uvm_phase phase); 
    //uvm_config_db#(uvm_phase)::set(this, "*", "starting_phase", phase); 
    for (int i = 0; i < num; i++) begin
      fork
        begin   
          env.v_seq[i].starting_phase = phase;
          env.v_seq[i].start(env.subenv[i].v_sqr);
        end
      join
    end  

    //set a drain-time for the environment if desired 
    phase.phase_done.set_drain_time(this, 50);
  endtask : run_phase

pieces of code in v_seq

  virtual task body()
  
   cfg_seq.start(p_sequencer.cfg_sqr, this);
    fork   
      begin : sub_seq // thread1 
        sub_seq.start(p_sequencer.sub_sqr, this);
      end     
      //begin : slave_seq // thread2 
      //  slv_seq.start(p_sequencer.slv_sqr, this);
      //end   
    join

  endtask
  ...

  // declare vsequencer as the p_sequencer of vsequence
    `uvm_declare_p_sequencer(vsequencer) 

pieces of code in sub_seq

  virtual task body();

    `uvm_info(get_type_name(),$sformatf("%0s starting...",
      get_sequence_path()), UVM_LOW)

    repeat(10) begin
      `uvm_do_with(req,
        { req.addr == `CFG_ADDR;
          req.req_typ == MWr; }) 
      get_response(rsp);
    end   

  endtask : body

pieces of code in v_sqr

class vsequencer extends uvm_sequencer;
  ...
  function void build_phase(uvm_phase phase);
    super.build_phase(phase);
    // instantiates sequencers and config_db
    cfg_sqr = config_sequencer::type_id::create("cfg_sqr", this);
    sub_sqr = sub_sequencer::type_id::create("sub_sqr", this);
    slv_sqr = slave_sequencer::type_id::create("slv_sqr", this);
  endfunction : build_phase
  ...
endclass: vsequencer

 

 

I find that it is stuck at line m_wait_for_arbitration_completed(req_s.request_id); of task wait_for_grant() in file uvm_sequencer_base.svh. Could anybody tell me the reason?

 

Thanks in advance!


Viewing all articles
Browse latest Browse all 756

Trending Articles