Re: [sv-bc] Net declaration and implicit continuous assignment

From: Steven Sharp <sharp_at_.....>
Date: Thu Mar 17 2005 - 14:19:57 PST
>1. A import syntax will make a variable declared in a package visible or 
>it is equivalent to declaration of package variables in a local scope.If 
>itmakes the variables visible then from above example if a package 
>variable is imported twice in diffrent scope it will be able to retain 
>the earlier changes  i.e  value of b will be 1.  If it is a declaration 
>then value of b should be 5. Please provide your suggesions.

It does not declare a new copy of the package variables, it simply allows
access to the single copy that is in the package.  So the answer is 1.


>2. If we consider import syntax will make variables/nets visible, then a 
>net declared in a package can be used on the RHS of assignment. A net if 
>used on the RHS will have no significance untill it is driven by some 
>value.

It is perfectly significant, it just has the default undriven value.
That is 'z for a wire, but would be '0 for a supply0 net that was being
used as a shared ground throughout the design.  If the user wants to
drive a different value onto it, they can import it into a module scope
and drive it with a continuous assignment, gate, or module port.


>If package import syntax will declare the package variables in a local 
>scope, then a net cannot be declared in procedural block.

Since the import syntax does not declare the net, it just imports it,
this is not a problem.


> From above argument a net declaration is not a significant construct 
>for a package_or_generate_item_declaration.

Sure it is.  The net can be driven by importing it into a scope (such
as the module scope) where it can be driven.  Or you can declare global
supply0 and supply1 nets in a package, to be shared across the design.
The fact that it can also be imported into scopes from which it cannot
be driven does not make it useless.

Steven Sharp
sharp@cadence.com
Received on Thu Mar 17 14:20:15 2005

This archive was generated by hypermail 2.1.8 : Thu Mar 17 2005 - 14:20:30 PST