sv-parser icon indicating copy to clipboard operation
sv-parser copied to clipboard

Fix sequence with parameter as cycle delay

Open yousifBilal opened this issue 8 months ago • 0 comments

This SystemVerilog code causes the parser to return an error:

property my_prop;
    in1
|-> 
    ##MY_PARAM (in2 == in3);
endproperty

Mainly because of ##MY_PARAM (in2 == in3). Removing the parenthesis around in2 == in3 makes it work. The reason from what I observed is that sv-parser first tries to parse MY_PARAM into a constant function call which takes (in2 == in3) as an argument. Then causes an error because there is no sequence expression after the cycle delay.

I attempted to fix it by trying a parser for constant primary without parsing constant function, if the original parser failed.

yousifBilal avatar Apr 23 '25 07:04 yousifBilal