Andy,
Yes it is illegal. $unit is only allowed as a prefix for building
hierarchical names to items declared in the compilation unit scope. Items
which can be declared outside modules can be anything that can be declared
in a package.
in 18.3
compilation-unit scope: a scope that is local to the compilation unit. It
contains all declarations that lie outside
of any other scope
— $unit: the name used to explicitly access the identifiers in the
compilation-unit scope
Modules, primitives are not part of the compilation unit name scope.
See the following definition for the compilation unit name space:
in 18.13
The compilation-unit scope name space exists outside the module,
macromodule, interface,
package, program, and primitive constructs. It unifies the definitions of
the functions, tasks,
parameters, named events, net declarations, variable declarations and user
defined types within the
compilation-unit scope.
Francoise
'
At 02:45 PM 7/1/2004 -0700, Andy Tsay wrote:
>Hi,
>
>Please help to clarify if $unit::<module_name> is NOT allowed.
>The LRM treats $unit as a package_scope, so I think it is illegal
>to say $unit::<module_name>.
>
>For example,
>module m1(output oo, input ii);
> assign oo = ~ii;
>endmodule
>module top(output o1, o2, input ii);
> module m1(output oo, input ii);
> assign oo = ii;
> endmodule
>m1 u0(o1, ii); // use the local nested m1 <-- OK
>$unit::m1 u1(o2, ii); // try to use the outside m1 <-- ERROR
>endmodule
>
>Thanks,
>Andy Tsay
Received on Wed Jul 7 10:32:50 2004
This archive was generated by hypermail 2.1.8 : Wed Jul 07 2004 - 10:32:54 PDT