Verification Guild
A Community of Verification Professionals

 Create an AccountHome | Calendar | Downloads | FAQ | Links | Site Admin | Your Account  

Login
Nickname

Password

Security Code: Security Code
Type Security Code
BACKWARD

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Modules
· Home
· Downloads
· FAQ
· Feedback
· Recommend Us
· Web Links
· Your Account

Advertising

Who's Online
There are currently, 38 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here

  
Verification Guild: Forums

 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile  ProfileDigest    Log inLog in 

How can I get Vera Classes to interract.

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Verification Guild Forum Index -> Simulation
View previous topic :: View next topic  
Author Message
vishaln
Senior
Senior


Joined: Sep 30, 2004
Posts: 10

PostPosted: Mon Oct 25, 2004 11:32 am    Post subject: How can I get Vera Classes to interract. Reply with quote

Hi,

I have some basic question. I dont know whether these questions were answered before. I tried to search but ended up wasting too much time... hence this posting.

In Vera HVL, the BFM is encapsulated in a class. Also test stimulus (records) are encapsulted in seperate class.

Now my problem is, I need to check out resources (whether memory is unoccupied/available) before generating a record.
I have commands in my BFM to check this. However if I instantiate both the classes in my program (same level of hierarchy) then how do I use methods of BFM in my record class?

I cannot have more than one instance of BFM.

What is the recommended methodology? Is it better to instantiate the BFM (declared as static) in my record class? Is there some other soln that I am missing out on?

In specman I beleive it is possible to access the parent struct/unit, can it be done in Vera?

Is there any layered approach/methodology for vera? I beleive there was such methodology some 2/3 yrs back (4 layered approach for building Vera IP)... whats the latest on it?

regards
vishal
Back to top
View user's profile
Janick
Site Admin
Site Admin


Joined: Nov 29, 2003
Posts: 1382
Location: Ottawa, ON Canada

PostPosted: Mon Oct 25, 2004 12:51 pm    Post subject: Re: How can I get Vera Classes to interract. Reply with quote

vishaln wrote:
Is there any layered approach/methodology for vera? I beleive there was such methodology some 2/3 yrs back (4 layered approach for building Vera IP)... whats the latest on it?


Yes. Check out your on-line Vera documentation set for the "Reference Verification Methodology User's Guide" in $VERA_HOME/doc/rvm/rvm.pdf

vishaln wrote:
Now my problem is, I need to check out resources (whether memory is unoccupied/available) before generating a record.
I have commands in my BFM to check this. However if I instantiate both the classes in my program (same level of hierarchy) then how do I use methods of BFM in my record class?


There are many ways to do this, not all of them equally good.

You can use a global reference as everything instantiated in the program becomes a global variable (like Specman's sys) but that is not a good approach as your will now intertwine both classes making them difficult to use in different contexts.

What you are asking for is to pass a reference of the BFM to the class that needs to invoke its methods via the constructor:

Code:
class record_gen {
   local the_bfm bfm;

   task new(the_bfm bfm) {
      this.bfm = bfm;
   }

   task main_t() {
      while (1) {
         record rec;
         ...
         this.bfm.wait_for_resources_available();
         rec = new;
         if (!rec.randomize()) ...
         this.bfm.do(rec);
      }
   }
}



Note that this approach creates transactors within transactors (i.e. a "russian doll") testbench, not a layered testbench. Reusing upper layers or generators may become difficult.

But there are usually differences between what one is asking for and what one really needs...

Why does the generator need to be aware of the resource availability? Is it because it needs to know something about the available resources in order to generate a valid record? Or is it for simple data flow requirements?.

If it is only for simple data flow requirement, I'd build the check in the BFM itself and have the BFM only consume records when it finds out resources are available. The generator is thus unaware of the resources limitations and becomes much simpler. That can be easily implemented using the rvm_channel, as described in the manual above.

If you need to know which resources are available to generate a valid applicable record, then things get suddenly more complicated and passing a reference of the BFM to the generator via the constructor is usually required (as described above) or you can make the resource availability request a pseudo transaction for the BFM and use the same channel as the record.
Back to top
View user's profile Send e-mail Visit poster's website
vishaln
Senior
Senior


Joined: Sep 30, 2004
Posts: 10

PostPosted: Mon Oct 25, 2004 11:21 pm    Post subject: Thanks. Reply with quote

Thanks.
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Verification Guild Forum Index -> Simulation All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Verification Guild © 2006 Janick Bergeron
Web site engine's code is Copyright © 2003 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.134 Seconds