Skip to content

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

@fischphob

Description

@fischphob

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions