| View previous topic :: View next topic |
| Author |
Message |
giridhar Senior


Joined: Apr 10, 2008 Posts: 14
|
Posted: Thu Sep 25, 2008 7:18 am Post subject: virtual methods in modports? |
|
|
hi,
can there be virtual methods(tasks or functions) in the modport declaration i.e can i import or export virtual methods in the modport.(of course in SystemVerilog)
enjoyyyyy |
|
| Back to top |
|
 |
giridhar Senior


Joined: Apr 10, 2008 Posts: 14
|
Posted: Wed Oct 08, 2008 1:43 am Post subject: |
|
|
hello ........anyone please help...
not even one answer .....from the date of post ........
or i am thinking whether my question is wrong....
pls help...... |
|
| Back to top |
|
 |
tusharv Senior


Joined: Jul 18, 2008 Posts: 96 Location: india
|
|
| Back to top |
|
 |
giridhar Senior


Joined: Apr 10, 2008 Posts: 14
|
Posted: Fri Oct 10, 2008 3:42 am Post subject: |
|
|
hi,
thanks for the link.
but it didnt answer the question that whether the virtual methods can be used or not in the modports.
thanks |
|
| Back to top |
|
 |
AmreSultan Senior


Joined: Jan 13, 2004 Posts: 77 Location: Ottawa, Canada
|
Posted: Fri Oct 10, 2008 9:08 am Post subject: |
|
|
I'm pretty sure that the answer is no. I'm assuming when you say virtual tasks/functions you talking in the context of the virtual keyword used in class methods.
There is no concept of polymorphism or inheritance (in the OOP sense) outside of SystemVerilog Classes. Even if you consider virtual interfaces my first statement still applies. When you import/export tasks/functions in modports they're from other modules or interfaces not from classes.
Amre _________________ --Amre Sultan-- |
|
| Back to top |
|
 |
PaulM Senior


Joined: Apr 10, 2006 Posts: 111 Location: Ottawa, Ontario, Canada
|
Posted: Fri Oct 10, 2008 12:51 pm Post subject: |
|
|
You could fake virtual methods by creating a class instance in your interface and having the interface's function/task call a method from the class. It would be a straightforward factory application to create an instance of an appropriate class derivative which had the actual method you wanted. Just a thought.
Paul. _________________ Paul Marriott Ph.D.
Director Verification Engineering
XtremeEDA Corporation
613 254 9685 ext 208 (auto-links to mobile)
pmarriott@xtreme-eda.com
www.xtreme-eda.com |
|
| Back to top |
|
 |
|