Re: [sv-bc] Is an unnamed block with declarations a scope?

From: Greg Jaxon <Greg.Jaxon_at_.....>
Date: Thu Aug 11 2005 - 11:53:27 PDT
Gordon Vreugdenhil wrote:

> The three options I see are:
>   1) unnamed block is always a real scope
>   2) unnamed block is a real scope iff the block_item_declaration
>      list is empty
>   3) unnamed block is only a real scope for block_item_declaration
>      list elements (i.e. other labels go into the nearest upwards
>      named scope).
> 
> (1) is the only choice that breaks 1364 compatibility which
> is why I was assuming that (1) was not the intent.  This
> leaves me with either (2) or (3).  While both of those have
> issues, I think that (2) is a cleaner rule with more
> obvious effects and interactions.
> 
> Gord.

I was preparing a response outlining (3).  As you might guess, it
gets messy.  There are two scope trees - one for data life times
and one for hierarchical accessibility.  Fortunately one is a
sub-tree of the other.  The named blocks merely offer a way
to abbreviate one or more levels of naming in the full scope tree.
The name collision rule they follow is a little unorthodox,
but it is done is service to this dictum

P-1364 section 9.8.3 ends by saying:
     The block names give a means of uniquely identifying
     all variables at any simulation time.

Clearly SV is not backward compatible with this property.
But just as clearly, those names exist to make variables
accessible and we should do what is necessary to keep
that function intact.

I second Mac's opinion that a declaration qualifier would be
a better way to opt out of hierarchical accessibility.

Greg Jaxon
Received on Thu Aug 11 11:51:54 2005

This archive was generated by hypermail 2.1.8 : Thu Aug 11 2005 - 11:51:58 PDT