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, 35 guest(s) and 1 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 

connecting VERA class variables to HDL ports

 
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
unmesh
Senior
Senior


Joined: Jun 21, 2004
Posts: 11
Location: Bangalore

PostPosted: Fri Jul 30, 2004 1:26 am    Post subject: connecting VERA class variables to HDL ports Reply with quote

greetings all,
am still in the process of learning vera so apologies if this query seems a little stupid. i have created a class which has a variable named RST. i also have a rtl, from which i have generated a .if.vrh file which has a port named RESET. in the class, RST is pulled high @(posedge CLOCK). i want to connect this variable RST to the RTL port RESET. the objective behind this is to include all standard stimuli in the class itself. the end user just has to create an object of the class and plug it into his design.

so how do i connect this variable to the port in my vera code file (.vr).

thanks and best regards
Unmesh
Back to top
View user's profile Send e-mail
Logger
Senior
Senior


Joined: Jun 15, 2004
Posts: 340
Location: MN

PostPosted: Fri Jul 30, 2004 12:47 pm    Post subject: Virtual Ports Reply with quote

Hi Unmesh,

What you want to do is utilize virtual ports. They provide a level of abstraction to the physical interface that allows you to do what you want.

Take this example:

Code:
interface my_ifc {
  input  clk      CLOCK;
  output rst      PHOLD #1;
  input  data_in  PSAMPLE #-1;
  output data_out PSAMPLE #1;
}

port my_port {
  rst;
  in;
  out;
}

bind my_port dut_port {
  rst my_ifc.rst;
  in my_ifc.data_in;
  out my_ifc.data_out;
}

class xactor { 
  // my_port abstracts physical link to interface out of the class
  my_port p;
  task new(my_port p) {
    this.p = p;
  }

  task reset() {
    // Notice no @(posedge clk) references.  Utilize the implicit
    // synchronization provided by the interface.
    p.rst = 1'b1;
    @1 p.rst = 1'b0;
  }

  // more class tasks
}

program test {
  xactor my_xactor = new(dut_port);  // pass the dut_port binding
                                     // into the class
  my_xactor.reset();
  // do something
}
Back to top
View user's profile
unmesh
Senior
Senior


Joined: Jun 21, 2004
Posts: 11
Location: Bangalore

PostPosted: Thu Aug 05, 2004 11:05 pm    Post subject: Re: Virtual Ports Reply with quote

Hi Logger
the solution is perfect. tried it and it works like a charm.
thanks and best regards
Unmesh
Back to top
View user's profile Send e-mail
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.657 Seconds