Why uvm_task_phase::execute() is defined as a function?

It forks a process. Is it supposed to be a task?

In reply to eda2k4:

The function can also fork a process.

In reply to eda2k4:

It forks a process. Is it supposed to be a task?

Why should this be a task? It does not consume time itself, but it is starting the exec_task.

The forked process might/might not consume time. Is task a better choice? Beside, it is called uvm_task_phase for those task-type phases which can consume time (run/main/etc). Is it a better choice to use task rather than function?

In fact uvm_task_phase::execute() contains uvm_phase::exec_task(), a non time-consuming function contains a potentially time-consuming task. It is probably OK, I just feel it is better to be defined as a task. Or I probably missed something.

In reply to chr_sue:

In reply to eda2k4:

You should declare ANY routine that does not consume time as a function. Do not be misled by the word “task” embedded in the identifier.

The execute() function must not block because it is being called as part of the component hierarchy traversal and forking off all of the task-based phases in parallel.