Hi ,
I need assistance with following line from LRM .
LRM 18.5.12 :: Function in Constraints states states that
" Functions that appear in constraint expressions should be automatic (or preserve no state information) and have no side effects "
I understand that function with static lifetimes are illegal in classes .
class ..
...
function static .. // Illegal !!
....
endclass
However within a class I can have a static variable within automatic function ( by default function are automatic ) right ?
class ..
...
function automatic ..
static variable ; // Static Variable , Legal ?
....
endclass
[1] So is it legal to call such a function ( with static variables ) in constraint ?
I mean to ask in context of LRM .
( Across Simulators I observe that they do allow , but I am not certain if its LRM violation or not )
[2] Also what does “and have no side effects” mean ?
If possible a small snippet would be helpful
Thanks