Work-around needed for macro issues

288 views
Skip to first unread message

dave rector

unread,
Jun 3, 2023, 2:12:46 PM6/3/23
to Verible Users
Hello Verible Users,

We are just getting started with Verible - so far we are impressed!
Thanks much for developing such a useful tool.

In our early stages of adopting verible, we hit two of the issues with the preprocessor and macros, specifically:

... preprocessing error at token "`macro_name" : Error expanding macro identifier, might not be defined before.

and

syntax error at token "xyz"

 Which are known issues according to this issue in github:
"Smoke test improvement roadmap" #1839

Question: is there a way for verible-verilog-lint to ignore these preprocessor issues or a known workaround so the errors don't show up in our logs until they are resolved?

Thanks for the help.


David Fang

unread,
Jun 9, 2023, 9:24:01 PM6/9/23
to dave rector, Verible Users
Preprocessing is a known area of development at this moment.
For example the linter and its syntax checker attempt to parse unpreprocessed forms (best-effort, without performing any expansion).

We do have some related tools in the works, for example a standalone preprocessor:

$ verible-verilog-preprocessor help preprocess
Inputs:
  Accepts one or more Verilog or SystemVerilog source files to preprocess.
  Each one of them will be prepropcessed independently which means that
  declaration scopes will end by the end of each file, and won't be seen from
  other files (so multiple files will _not_ be treated as compilation unit).
  The +define+ and +include+ directives on the commandline are honored by
  the preprocessor.
Output: (stdout)
  The preprocessed files content (same contents with directives interpreted)
  will be written to stdout, concatenated.

A little background: the linter was originally designed to plug into an interface that only sees one file at a time with zero additional context, nor access to related files, for simplicity.

In contrast, the verible-verilog-project tool was intended for operations that did have access to information across multiple files, which might seem more suitable for deeper analysis and true preprocessing.

Henner could probably explain better what the plans are around these tools.

--
You received this message because you are subscribed to the Google Groups "Verible Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to verible-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/verible-users/acf1ee66-8d29-46cc-96f6-48b15c961cc7n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages