Monday, November 15, 2010

short summary of package

Packages are explicitly named scopes appearing at the outermost level of the source text (at the same level as top-level modules and primitives). Types, variables, tasks, functions, sequences, and properties may be declared within a package.
Packages must not contain any processes. Therefore, wire declarations with implicit continuous assignments are not allowed.

Items within packages are generally type definitions, tasks, and functions. Items within packages cannot have hierarchical references. It is also possible to populate packages with parameters, variables, and nets.

One way to use declarations made in a package is to reference them using the class scope resolution operator ::.
ComplexPkg::Complex cout = ComplexPkg::mul(a, b);

Explicit import allows control over precisely which symbols are imported:
import ComplexPkg::Complex;


An alternate method for utilizing package declarations is via the import statement.

No comments: