In reply to ben@SystemVerilog.us:
Hi Ben ,
If I were to define the subroutine as ::
function automatic int getq();
return k ; // Simply return ' k ' without defining variables .
endfunction : getq
I observe the updated value of k is assigned to local variable w .
Are there any additional advantages of defining the variables within the subroutine as automatic ?
My understanding is that if the subroutine were to be called in parallel from
multiple places each call will have their own copy .
So if I pass different values as input to the subroutine from different places
at the same time , each invocation would return an appropriate value due to the automatic variables defined within the subroutine .