Skip to content
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

how to parser a file with macro? #1952

Open
ddppt-yy opened this issue Jul 3, 2023 · 2 comments
Open

how to parser a file with macro? #1952

ddppt-yy opened this issue Jul 3, 2023 · 2 comments
Labels
rejects-valid syntax If the parser wrongly rejects syntactically valid code (according to SV-2017).

Comments

@ddppt-yy
Copy link

ddppt-yy commented Jul 3, 2023

imput file like this:

module A ( ifdef DEBUG
input debug_tag,
endif input xxx, ); endmodule

but verible-verilog-syntax cant parse debug_tag, unless add
define DEBUG.

how to add "define DEBUG" in cmd line?

@ddppt-yy ddppt-yy added the rejects-valid syntax If the parser wrongly rejects syntactically valid code (according to SV-2017). label Jul 3, 2023
@ddppt-yy
Copy link
Author

ddppt-yy commented Jul 3, 2023

I think my issue like this #1898

@fpgauserdude
Copy link

fpgauserdude commented Aug 8, 2023

This is really too bad. Verilator was doing exactly what I needed, but the preprocessor is sort of half-way implemented. Example:

ifdef TEST1
foo test1
  (.clk (port.clk));
endif

ifndef TEST2
foo test2
  (.clk (port.clk));
endif

But unfortunately, since there is no way to control in the "verible-verilog-syntax" command what preprocessor defines are present, "test2" will be present in the tree and "test1" will not. I was prepared to use the "rawtokens" output to essentially do my own preprocessing. But I can't because not enough information is put into the tree.

Were you able to find any work-arounds to your question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rejects-valid syntax If the parser wrongly rejects syntactically valid code (according to SV-2017).
Projects
None yet
Development

No branches or pull requests

2 participants