verilog-perl icon indicating copy to clipboard operation
verilog-perl copied to clipboard

Parser doesn't understand constraint implication operator ('->')

Open veripoolbot opened this issue 9 years ago • 3 comments


Author Name: Dave Storrar Original Redmine Issue: 1064 from https://www.veripool.org Original Date: 2016-05-29


The following code produces a parsing error:

class testcase;
  rand bit [3:0] a, b;
  constraint c { (a == 0) -> (b == 1); }
endclass

%Error: testcase.sv:3: syntax error, unexpected '}'

I see a comment in the VParseBison.y that seems to relate to a conflict between the 2009 and 2012 SystemVerilog versions, but I'm not familiar with Bison, so can't work out what should be happening.

Hope you can help.

veripoolbot avatar May 29 '16 12:05 veripoolbot


Original Redmine Comment Author Name: Wilson Snyder (@wsnyder) Original Date: 2016-06-05T20:35:48Z


I spent about 3 hours trying to fix this, sorry it's a big mess due to ambiguities in the Verilog language specification, so give me some more time. For the moment you may want to `ifndef around it.

veripoolbot avatar Jun 05 '16 20:06 veripoolbot


Original Redmine Comment Author Name: Wilson Snyder (@wsnyder) Original Date: 2016-09-09T02:07:26Z


Sorry, but after days of trying this appears almost impossible to fix using the current parser. I'm going to have to abandon fixing this for the time being. If you or a Bison expert wants to provide a patch, excellent!

veripoolbot avatar Sep 09 '16 02:09 veripoolbot


Original Redmine Comment Author Name: Dave Storrar Original Date: 2016-09-09T08:20:54Z


Thanks for making the attempt, I'll just have to work-around it.

Will let you know if I find a Bison expert ;-)

veripoolbot avatar Sep 09 '16 08:09 veripoolbot