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
Macro expansion question #89
Comments
Original Redmine Comment I intentionally didn't add the newlines because it was messing up the line number count of downstream tools (that use `line). What breaks? |
Original Redmine Comment Verilog-Perl isn't breaking... other scripts of my own were breaking, I think I have it under control now though. Thanks, |
Original Redmine Comment Hi Wilson, Here is the issue I'm having: some (old) tools I'm using don't support constant functions in a localparam declaration. My RTL has that. So basically I'm using the parser to construct a hash of all localparams declared and the values (RHS of the declaration expression), and later on I'm doing inline expansion of these localparams. Currently the parser doesn't have any callback for expression termination (when a semi-colon is found). So on the RTL I was looking for linefeeds/newlines to determine when the expression ended. This works fine given the coding conventions in our RTL of only 1 expression per line. When I try to do the same thing with macros (macros with RTL code as the macro text) it doesn't work because the preprocessor eliminates all the newlines and I still don't have any callbacks for the expression termination. Could you provide this callback (expression termination / semi-colon callaback) or leave an option to expand macros in multiple lines? or is there any other way you can suggest I could use to solve this problem? this would be greately appreciated. Thanks, |
Original Redmine Comment All of the Verilog::Parser callbacks should also be called when using Verilog::SigParser. |
Original Redmine Comment All set? |
Original Redmine Comment Yes thanks. BTW, would it be possible for the Preproc to leave newlines when the `line are suppressed (line_directives=>0)? Thanks in advance, |
Original Redmine Comment Settled months ago. |
Author Name: David A
Original Redmine Issue: 89 from https://www.veripool.org
Original Date: 2009-05-14
Original Assignee: Wilson Snyder (@wsnyder)
Hi!
On IEEE Std 1364-2005, section 19.3.1 page 350 here is what it says about multiline macro expansion:
"The newline preceded by a backslash shall be replaced in the expanded macro with a newline (but without the preceding backslash character)."
If Im not mistaken it seems that Verilog::Preproc expands multiline macros in a single line. If this is true, could it be modified?
Thanks,
David
The text was updated successfully, but these errors were encountered: