New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vppreproc corner-case comment issue #311
Comments
Original Redmine Comment Thanks for the report, I think you're right it should become a space. I'm always amazed how the preprocessor which is given so few pages in the spec, causes so many issues. |
Original Redmine Comment Fixed in git for 3.306. Give it a try; it adds spaces at every removed comment, block or line, though only block should be strictly required. |
Original Redmine Comment I have not been able to give it a try. If it works on my small contrived module, Next time, I'll try to remember to create (or patch) a test |
Original Redmine Comment In 3.306. |
Author Name: Gene Sullivan
Original Redmine Issue: 311 from https://www.veripool.org
Original Date: 2011-01-06
Original Assignee: Wilson Snyder (@wsnyder)
Consider the following Verilog code in a file I named "tb.v":
There is a block comment between a keyword and an identifier, with
no whitespace surrounding the block comment.
Using vppreproc to remove the comments produces output which is not legal
Verilog syntax.
The deleted block comment effectively concatenates the keyword and the identifier,
leaving illegal Verilog code. I used the --noline option to simplify the
output; the issue remains if --noline is not used.
The Verilog LRM (1800-2009) is not specific enough to describe what should
be done in the case. However, the two simulators I used (VCS and NC-Verilog)
compiled the code with the nasty comment cleanly. I also used the NC decompile
utlilty (ncdc), which shows that it replaced the block comment with a single space.
Running ncverilog/ncdc produces:
For what it's worth, gcc also replaces the comment with a space:
Ideally, I guess vppreproc should replace the block comment with a single
space in this case.
Since I didn't have much luck digging through the source code to try a track down
where comments are removed, I can not provide a patch.
I am using recent (2010) versions of VCS (Synopsys) and NC-Verilog (Cadence).
I am using the latest version of vppreproc (3.305).
The text was updated successfully, but these errors were encountered: