Skip to content

Support for packages

Andrea Paterno requested to merge packages into master

Description of the changes

This MR introduces elaboration support for package declarations containing parameter, struct and enum declaration. Each module will gain visibility of any package defined outside other modules and its contents, which it can access using the :: operator.

Modules can import package contents using the import construct directly in the module declaration header, using the syntax:

module a import my_package_pkg::*; ();
endmodule

or inside the module body using the syntax:

import my_package_pkg::a, other_package_pkg::b;

Imported elements will be added to the module namespace and would thus become reference-able without using the :: operator.

Importing non-existent elements from packages, or referencing non-existent packages, will result in an error being thrown. Due to this reason, some tests have been moved from iverilog elaboration to syntax checking and checking against a golden reference.

Check-list

  • Make sure that a changelog entry is present
  • Label the MR according to the content
  • If this MR has a dependency on another MR, specify the order in which the MRs should be merged
  • If the MR is done, please mark it as such by using the ~"Done - awaits merge" label, else mark it as "Draft: " by adding the prefix to the title
  • Designate a reviewer for this MR once done

Reviewer check-list

  • Make sure that the title describes the changes in the merge request
  • Make sure that the description of the changes is relevant and it describes all the changes
  • Make sure that the changelog entry is consistent with the changes. If the first release on top was released, then make sure that a new running release is created incrementing the minor index (the version is in the format major.minor.patch)
Edited by Andrea Paterno

Merge request reports