P
Paul Jansen
Guest
Problem #1: I have a task which I need to return from/disable early.
This means that I can't use inout or output parameters to return data
from the task.
Problem #2: The task needs to be recursive.
I can't imemdiately see how to implement this. I can get around #1 by
writing return values to global variables, but this then means that
the task can't be recursive, because all instances of it will attempt
to write their results to the same variables. Without pointers, I
can't see how to make an assignment to a global actually assign to
different variables for different instances of the task.
Any ideas on how to do this?
Actually, now that I've got around to writing this down, it seems that
I could do this with a block disable, rather than a task disable:
task x;
input a;
output b;
begin : innards
...
if(need_to_return)
disable innards;
...
x(fu, bar);
...
end // innards
// disable to here - output b written correctly?
endtask
Comments/other ideas? And presumably I can't do anything recursive at
all in Verilog-1995?
Thanks -
/PJ
This means that I can't use inout or output parameters to return data
from the task.
Problem #2: The task needs to be recursive.
I can't imemdiately see how to implement this. I can get around #1 by
writing return values to global variables, but this then means that
the task can't be recursive, because all instances of it will attempt
to write their results to the same variables. Without pointers, I
can't see how to make an assignment to a global actually assign to
different variables for different instances of the task.
Any ideas on how to do this?
Actually, now that I've got around to writing this down, it seems that
I could do this with a block disable, rather than a task disable:
task x;
input a;
output b;
begin : innards
...
if(need_to_return)
disable innards;
...
x(fu, bar);
...
end // innards
// disable to here - output b written correctly?
endtask
Comments/other ideas? And presumably I can't do anything recursive at
all in Verilog-1995?
Thanks -
/PJ