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, 44 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 

Importing functions/tasks in a SV interface mod-port

 
Post new topic   Reply to topic    Verification Guild Forum Index -> Main
View previous topic :: View next topic  
Author Message
trican
Senior
Senior


Joined: Oct 23, 2007
Posts: 33

PostPosted: Mon Jul 14, 2008 12:16 pm    Post subject: Importing functions/tasks in a SV interface mod-port Reply with quote

All,

I have a number of simple tasks in a SV interface which I use to do a variety for things, (e.g. delay for a number of clock cycles). This works fine in NC, but it appears VCS (2006.06) doesn't support such importing/exporting of functions/tasks (and please correct me if I'm wrong with that statement).

Whats the best appraoch to get around this limitation?

[Just to clarify, when I call the constructor of a transactor, I pass in the mod port of the virtual intertface using the dot notation]


Last edited by trican on Fri Jul 18, 2008 5:31 am; edited 1 time in total
Back to top
View user's profile
FIRE_VERA
Senior
Senior


Joined: Oct 25, 2007
Posts: 50

PostPosted: Fri Jul 18, 2008 5:18 am    Post subject: Reply with quote

Are you getting any error when trying with VCS :
Can yo please provide more info so that we can think
Back to top
View user's profile Send e-mail
trican
Senior
Senior


Joined: Oct 23, 2007
Posts: 33

PostPosted: Fri Jul 18, 2008 6:06 am    Post subject: Reply with quote

The error in VCS just said that importing a task through a modport wasn't supported. For example the following gave this problem:

Code:

interface example (input bit clk);

  default clocking cb @(posedge clk);
    //signals
    .....
  endclocking

  modport mp ( clocking cb, import wait_clks );

  task wait_clks (input int i)
    ##i;
  endtask

end interface


I eventually got around this by moving the functionality of the waits_clks task back into a class, e.g.

Code:

class example_class
....
  task wait_clks(int i );
    repeat ( i )
      @( this.<virtual_interface_with_modport_name>.cb );       
  endtask : wait_clks
....
endclass
Back to top
View user's profile
xxx
Senior
Senior


Joined: Jul 03, 2008
Posts: 13

PostPosted: Mon Jul 21, 2008 8:56 pm    Post subject: Reply with quote

I think you can
1. define a class in the interface,
2. encapsulate the task in the class
3. instantiate an object name OBJ of that class in the interface
4. Include the ``input OBJ'' in your modport pin list

Then use it from an object connected to the interface using
interface.modport.object.task
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Verification Guild Forum Index -> Main All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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 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.457 Seconds