[sv-bc] $root question

From: Francoise Martinolle <fm@cadence.com>
Date: Fri Nov 05 2004 - 07:37:03 PST

Can $root be followed by a package name?
The bnf syntax does not seem to allow something like:
 
$root.p::i
 
BNF is:
hierarchical_identifier ::= [ $root . ] { identifier { [ constant_expression
] } . } identifier

But it seems to allow $root.p where p is the name of a package.
 
The description of $root in 18.4 does not provide any restriction on the
type of top level instance.
A package is a top level instance, so does it mean that $root.p should be
legal and so $root.p::i?
If not, we may want to add a note in section 18.4.
 
For the same rational as in 18.4, $root.p can be useful to distinguish a
package p from a locally declared item
p in the scope.
 
Section 18.4 is as follows:
 
The name $root is added to unambiguously refer to a top level instance, or
to an instance path starting from

the root of the instantiation tree. $root is the root of the instantiation
tree.

For example:

$root.A.B // item B within top instance A

$root.A.B.C // item C within instance B within instance A

$root allows explicit access to the top of the instantiation tree. This is
useful to disambiguate a local path

(which takes precedence) from the rooted path. In Verilog, a hierarchical
path is ambiguous. For example,

A.B.C can mean the local A.B.C or the top-level A.B.C (assuming there is an
instance A that contains an

instance B at both the top level and in the current module). Verilog
addresses that ambiguity by giving priority

to the local scope, thereby preventing access to the top level path. $root
allows explicit access to the top level

in those cases in which the name of the top level module is insufficient to
uniquely identify the path.
Received on Fri Nov 5 07:37:11 2004

This archive was generated by hypermail 2.1.8 : Fri Nov 05 2004 - 07:37:22 PST