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

Access package import declaration(s) after file parsing #1676

Open
fischphob opened this issue Oct 13, 2022 · 1 comment
Open

Access package import declaration(s) after file parsing #1676

fischphob opened this issue Oct 13, 2022 · 1 comment

Comments

@fischphob
Copy link

Hi there,

we have a script based on Verilog::Netlist to parse existing SystemVerilog files and generate a black box (bbox) version of them. We can access the parameter and port lists to write them to the bbox file. No problems with that.

But, we often use the package import declaration in the header syntax, for example:

module test
  import test_pkg::*;   // g_dw definition
  #(parameter integer c_param = 'd7)
  (input [g_dw-1:0] data_in);
endmodule

I call the Verilog::Netlist read_file sub two times: first with the package file and second with the module file. No parsing problems so far.

But, how can I get a list with imported packages, so that I can write it to the bbox variant too?

@wsnyder
Copy link
Member

wsnyder commented Oct 13, 2022

Verilog::SigParser calls the import() callback on these, but presently Verilog::Netlist does not use that callback to remember the packages.

If you would like to submit a pull request to record this information, I'd welcome including it. It is unlikely it will get added otherwise, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants