Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Defining interface inside a package

In IEEE Std 1800-2012 we can find description of packages and such information:

Types, nets, variables, tasks, functions, sequences, properties, and checkers may be declared within a package

I was wondering, if there is any particular reason why interfaces can't be defined inside a package? It seems to me that it might be useful, but apparently the creators of the standard wouldn't agree.

like image 567
Qiu Avatar asked Aug 08 '14 17:08

Qiu


1 Answers

The main reason has to do with the different namespaces that exist in SystemVerilog, and requirements for separate compilation. Interfaces are one kind of design element (See the 1800-2012 LRM section 3.2 Design elements) whose definitions exist in their own namespace and do not require compilation before use. Packages were intended for types that have a specific compilation order requirement as well as create a separate namespace. Over the different revisions of the standard, that original intent may have been lost.

Verilog has a configuration mechanism that allows you to have different implementations of the same design elements existing in different libraries.

like image 120
dave_59 Avatar answered Nov 20 '22 07:11

dave_59