-
Notifications
You must be signed in to change notification settings - Fork 215
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
makedepend-style output #221
Comments
Hi, thanks for pitching your idea. Summarizing the problem, it sounds like you just want Verible doesn't have a proper preprocessor yet (we are looking for one, see #183 ), and there is a start of what I call a pseudo-preprocessor here: https://github.com/google/verible/tree/master/verilog/preprocessor. That said, if you're able to tolerate imperfect information from Verible's unpreprocessed token stream, you might be able to create something "good enough". If you limit/assume Idea:
|
Maybe the reference to This likely means the best I could hope for is "good enough" because it would not be able to apply any preprocessor I am afraid I don't understand your idea steps though. If you remove everything unrelated to preprocessing, then you would remove all the module instances and package calls. It looks like the idea would only get the include files. |
Ah, so beyond One way to get started is to build up (per source file) definition and reference information (akin to a symbol database). You might even ignore preprocessing and evaluate all branches, or some other pseudo preprocessing strategy. You could walk the concrete syntax tree of every parsed file to extract this information. |
I found verible searching for something to help me in my
make
-based build system. I'm looking for something that can function similarly togcc -M
.Consider this file,
testcase.sv
:If I ran
verilog_syntax -printmakedepend test.sv
, the result would be something like this:test.o test.d : my_incl.svh pkg1 pkg2 submod1 submod2
The format of the output isn't terribly important, as I can munge it to what I need, but the difficult problem without a full parser is identifying the module name(s) and dependencies. I think it is sufficient (in my style of SV coding at least) to classify includes, packages, and module/interface instances as dependencies.
I might be able to figure something out from the output of
verilog_syntax -printtokens
and I may even take a look and see if I can contribute here, but I thought I'd get the idea out there.Here's a helpful page describing the general
make
architecture I'm creating.The text was updated successfully, but these errors were encountered: