[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  SystemPerl
  Voneline
  WFH
General Info
  Papers

Issue #524

Parser bug in processing compiler directives in comments

Added by Ramana Mokkapati 11 months ago. Updated 11 months ago.

Status:NoFixNeeded Start date:06/14/2012
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:-

Description

Parser bug in processing compiler directive in comments. The comment should have been ignored, but it is not.

See belowe more for detail and how to reproduce (in attachment)

Script to parse Verilog and output a new Verilog with all cells prefixed with "try_"

usage: test.pl bug.v output.v

Note output.v has "bbb" unprefixed becuase of the compiler directive inside the preceding comment line is not treated correctly. If compile directive is broken (say) by inserting an extra space between ` and ifdef, the cell "bbb" is prefixed correctly. Summary: Comments are not handled correctly by the parser.

[snip] module top(); aaa();

`ifdef FIRST assign i1 = 1'b1 ; `else assign i2 = 1'b1 ; `endif // `ifdef XYZ endmodule

bbb();
ccc();

module aaa(); endmodule

module bbb(); endmodule

module ccc(); endmodule

[/snip]

report.tar.gz - How to reproduce (1.7 kB) Ramana Mokkapati, 06/14/2012 12:54 am

History

Updated by Ramana Mokkapati 11 months ago

Issue was verified with parser 3.315 (the latest one).

Updated by Wilson Snyder 11 months ago

  • Status changed from New to AskedReporter

It looks like your code is the one doing the searching for `ifndef, etc, as you're writing a raw parser that doesn't use Verilog::Preproc. If I turn on your verbose code I get

comment = // `ifdef XYZ

which is correct parsing by Verilog-Perl.

Perhaps I'm confused, if so please make very explicit as to what Verilog-Perl itself, not your script, is returning that you believe is incorrect.

Updated by Ramana Mokkapati 11 months ago

Wilson,

Thanks for your quick attention and comments. Yes, the derived class has the bug and I fixed it.

This ticket can be closed.

Regards, Ramana

Updated by Wilson Snyder 11 months ago

  • Status changed from AskedReporter to NoFixNeeded

Also available in: Atom