Scope of disable fork

In reply to dave_59:

task my_task()
fork : first_fork
\\ task1
\\ task2
join_any

fork : sec_fork
\\ task3
\\ task4
join_any

disable sec_fork;
endtask : my_task

is this syntax valid? the intention is to kill task3 and task4 only, while keeping task1 and task2 alive.

  • i know i can swap the order of the forks and put the disable in between, this is just a theoretical question

my real issue is that i have several watchdog tasks in my ref_model, of course watchdog tasks should be kill once the expected event occurs, my concern is that if i use ‘disable fork’ in one watchdog task, it will kill all the other ref model watchdog tasks as well.

with that said, i would expect that the scope of the the ‘disable fork’ would be the scope of the task calling it. but from what i read above (and in other answers you gave), i understand that the scope of the ‘disable fork’ is the process in which it is called…

1 Like