-
Notifications
You must be signed in to change notification settings - Fork 69
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
[BUG] Verilog preprocessor, ifdef around
include statement
#223
Comments
I have also encountered this issue |
This is intentional due to the Perl preprocessor being a step that is executed completely separately and prior to Verilog preprocessor. Unfortunately stacking multiple preprocessors like RDL does causes some inherent contradictions which result in quite a messy situation. |
I tried a commercial SystemRDL compiler, and it seems like it works for the example I provided initially, but would fail if the include file contains any perl directives. I think the following example demonstrates the issue about perl variables in include files mixed with verilog preprocessor:
When I call peakrdl with:
The question is if the |
Describe the bug
In the following code:
I want to include
inc.rdl
only ifSOME_MACRO
is defined.However this doesn't work, as the
PerlPreprocessor
runs before VerilogPreprocess and expandsinclude
directives without consideringifdef
,if
,else
, ... directives.systemrdl-compiler/systemrdl/preprocessor/__init__.py
Lines 12 to 19 in 191f4dd
Expected behavior
I expect
PerlPreprocessor
to ignoreinclude
directives if they are surrounded byifdef
which should disable it.Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: