RE: [sv-bc] Member select or hierarchical name

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Wed Jan 07 2009 - 03:51:31 PST
Hi,

This is actually one of the simpler cases and is connected to sections 23.8 and 23.9 as well. 

This whole subject is still far from being adequately described in the LRM, but we try to improve each time.

One of the basic rules is that you look for the first component of the name in the local scope. If you find it, then you go downward from there. If not, then you go upward and try again.

In this case, the first component of bl.x is bl. bl is not declared within the initial procedure, so you go up to the generate block. In this case, bl is declared inside the generate block, as the name of the struct. Then bl.x is considered to be a member select of bl.x.

A more complex case would be if struct bl did not contain a member x. Would it go up to the generate block called bl and the variable int x inside it or would it still consider bl to be a reference to the struct bl and then bl.x would be an error because it does not exist? 

This was ambiguous in previous versions of the standard. This revision attempts to resolve that ambiguity. I believe that the rules defined in 23.7 in this draft will define that bl would resolve to the struct in any case and bl.x would be an error.

Regards,
Shalom

> -----Original Message-----
> From: owner-sv-bc@server.eda.org 
> [mailto:owner-sv-bc@server.eda.org] On Behalf Of Surya Pratik Saha
> Sent: Wednesday, January 07, 2009 1:26 PM
> To: sv-bc@eda.org
> Subject: [sv-bc] Member select or hierarchical name
> 
> Hi,
> I have just gone through the section 23.7 (Member selects and 
> hierarchical names). The section seems very interesting. 
> However, I am not sure if a hierarchical name will be 
> converted to member select or not when the whole scope is 
> traversed. For e.g.
> 
> module top;
>     generate
>         begin:bl
>             int x;
>             initial begin
>                bl.x = 1; // will it be converted to member 
> select of struct after the full scope is traversed
>             end
>              struct {int x;} bl;
>        end
>     endgenerate
> endmodule
> 
> Please let me know.
> Currently all standard simulators consider 'bl.x' as member select.
> 
> --
> Regards
> Surya
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Jan 7 03:54:35 2009

This archive was generated by hypermail 2.1.8 : Wed Jan 07 2009 - 03:54:49 PST