It is currently Fri Sep 10, 2010 11:32 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: weirdo vmm_consensus
PostPosted: Fri Jan 22, 2010 6:52 am 
Offline

Joined: Wed Jul 01, 2009 9:02 pm
Posts: 9
I don't know someone has noticed this vmm_consensus behavior, but I was really surprised looking this thing in my simulation.

As we know, The consensus in the Full Chip Verification Environment will always depend on the different sub-consensus registered under it (These sub-consensuses are nothing but Consensus from each block level VIPs. )

We do it, by registering the "Subenv(VIP)"s consensus instances under "env(Full Chip)"s consensus instance.
Code:
end_vote.register_consensus(subenv.end_vote)



One of the Gotcha which happened in my simulation is, Environment's execution came out of end_vote.wait_for_consensus() before the subenv's consensus was reached!!!!!
Which should not happen AT ALL, Because consensus will not be reached unless all the sub-consensus registered under it are reached.

After debugging we found that,
The issue was with end_vote.register_consensus(subenv.end_vote).

As soon as, end_vote.register_consensus(subenv.end_vote) is called, it starts a thread and checks if sub-consensus is opposing OR not?
sub-consensus may not oppose at THAT POINT OF TIME, so env's consensus will directly consider that subenv's consensus is reached.
> The problem got resolved when I registered the sub-consensus' decision makers first in SUBENV and after that sub-consensu was registered in the env's consensus.

For example Following code will work fine,

Code:
function env::build();
subenv = new();
subenv.end_vote.register_xactor(gen);
this.end_vote.register_consensus(subenv.end_vote);
endfunction : build



But, it will cause issue, if u swap the order of line no 3 and 4.

Is it a BUG OR is it a way VMM consensus works?

Now If we go to VMM-1.2 ,

Every vmm_unit instance has inbuilt vote instance and it gets registered under its parent's vote instance in the source code as u do super.new();

If the above explained issue is the behavior of VMM consensus then it will make situation worse while using VMM-1.2 with all implicitly based classes.

Because the vote() instance of vmm_unit will not be helpful AT ALL when it comes to hierarchy based consensus decisions (Like Env's decision making based on the consensus of VIP)


Top
 Profile  
 
 Post subject: Re: weirdo vmm_consensus
PostPosted: Mon Jan 25, 2010 1:47 am 
Offline

Joined: Fri Sep 11, 2009 2:41 am
Posts: 1
Following is the example code which I created from code snippet provided by you and found exchanging statement (marked 1 & 2 in example code) doesn’t change result and works expected. Please let me know if your scenario is little different and if you can provide small running test to demonstrate the issue. Also in vmm1.2 all componenst extending vmm_unit gets default consensus instance 'vote' which consents by default , and the fact that vmm_xactors etc still maintain their earlier behavior even though they extend from vmm_unit.

Code:
program test;
  `include "vmm.sv"
class cpu_trans extends vmm_xactor;

  function new (string inst, int stream_id);
    super.new(inst, inst, stream_id);
  endfunction

  task main();
    super.main();
    repeat(10) begin
      wait_if_stopped();
      #10;
    end
    this.notify.reset(XACTOR_BUSY);
    this.notify.indicate(XACTOR_IDLE);
  endtask
endclass

class cpu_subenv  extends vmm_subenv;
  cpu_trans trans;
  vmm_consensus end_vote;
  function new(string name, string inst, vmm_consensus end_test);
    super.new(name, inst, end_test);
    trans = new({name,"_transactor"}, 1);
    end_vote = new({name,"consensus"},inst);
    //this.end_vote.register_xactor(trans);
    super.configured();
  endfunction

  task start;
    super.start();
    trans.start_xactor();
    #10;
  endtask: start

  task stop;
    super.stop();
    trans.stop_xactor();
  endtask: stop

endclass: cpu_subenv

  class user_env extends vmm_env;
   vmm_log   log = new("test", "test");
   cpu_subenv cpu1;
    function void build();
      super.build();
      cpu1 = new("cpu1", "cpu1", end_vote);
/*2*/      this.end_vote.register_consensus(cpu1.end_vote);
/*1*/      cpu1.end_vote.register_xactor(cpu1.trans);
    endfunction

    task start();
      super.start();
      $display("start");
      cpu1.start();
    endtask

    task stop();
      super.stop();
      $display("stop");
      cpu1.stop();
    endtask

    task wait_for_end();
      super.wait_for_end();
      $display("########## test starts with consensus status  #######");
      $display("%s",this.end_vote.psdisplay());
      this.end_vote.wait_for_consensus();
      $display("########## test ends with consensus status  #######");
      $display("%s",this.end_vote.psdisplay());
    endtask

  endclass

    user_env env;
  initial begin
    env = new();
    env.run();
  end

endprogram : test


Top
 Profile  
 
 Post subject: Re: weirdo vmm_consensus
PostPosted: Tue Jan 26, 2010 8:42 pm 
Offline

Joined: Wed Jul 01, 2009 9:02 pm
Posts: 9
Yes, you are right. This piece of code seems to be proving wrong what I stated earlier.
I think I've made a mistake here by not reproducing the issue in small code.

Presently I am not able to get it back OR I could be wrong in assuming the vmm_consensus behavior. I will get back to you as soon as I am able to revert to that issue.

-Shunty


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group