Wanted to get some good programming advice on this…
I’ve got a handful of tasks that all call value_OK() at the beginning. The function returns a pass/fail, which I use to call reject_value, and then return. Could I roll reject_value() and return into the value_OK() function? Can a function cause the calling task to exit; perhaps it’s a bad idea!
task do_something1(uint32_t value);
if (!value_OK(value)) begin
reject_value();
return;
end
....
endtask
task do_something2(uint32_t value);
if (!value_OK(value)) begin
reject_value();
return;
end
....
endtask
task do_something2(uint32_t value);
if (!value_OK(value)) begin
reject_value();
return;
end
....
endtask