| Login | | 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. | |
| 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 |
|
| View previous topic :: View next topic |
| Author |
Message |
trican Senior


Joined: Oct 23, 2007 Posts: 33
|
Posted: Mon Jul 14, 2008 12:16 pm Post subject: Importing functions/tasks in a SV interface mod-port |
|
|
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 |
|
 |
FIRE_VERA Senior


Joined: Oct 25, 2007 Posts: 50
|
Posted: Fri Jul 18, 2008 5:18 am Post subject: |
|
|
Are you getting any error when trying with VCS :
Can yo please provide more info so that we can think |
|
| Back to top |
|
 |
trican Senior


Joined: Oct 23, 2007 Posts: 33
|
Posted: Fri Jul 18, 2008 6:06 am Post subject: |
|
|
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 |
|
 |
xxx Senior


Joined: Jul 03, 2008 Posts: 13
|
Posted: Mon Jul 21, 2008 8:56 pm Post subject: |
|
|
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 |
|
 |
|
|
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
|
| |
|
|