port as interface argument?

If you have a simple question and just want an answer.
User avatar
myndideal
Active Member
Posts: 59
Joined: Thu May 05, 2011 10:00 pm
Location: Budapest

port as interface argument?

Post by myndideal »

Hi,

is it possible to give a port to a handler/interface function on argument list?

Code: Select all

interface ia{  {unsigned} pop(out port ?debugpin);}; ...case i.pop(out port? debugpin) -> {unsigned res}: {  debugpin<:1;  res= doSomething();  debugpin<:0;}...debugpin<:0;result=a.pop(debugpin1);debugpin<:1;
It is compiles without errors, but it sends ET_ILLEGAL_RESOURCE on "case" line ... The handler and the caller is on the same tile, of course. There's no other tasks have a business with this debug pin at all. So, this would be a special use case, only for measuring or tracing the  operation...

I can't give the port from the function argument of the handler's main-loop, because in this case more than one par{} function will contains the same port. Yep. But the above example could touch the resource only sequentially because of the interface, I guess.

What is what I skipped? How can I do this similar way? 

Vineela
Member++
Posts: 21
Joined: Mon Dec 16, 2013 1:27 pm

Post by Vineela »

Hello, I am not sure if you can use port as an interface argument. Please check the attached example code which might serve your purpose! Hope this helps!

 

Thanks,

Vineela
You do not have the required permissions to view the files attached to this post.