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

From: Surya Pratik Saha <spsaha_at_.....>
Date: Wed Jan 07 2009 - 20:56:45 PST
Hi Dave/Shalom/Gordon,
All you mean then, 'member select' or 'hierarchical name' once decided at the time of analysis will never be changed even later it is declared in different way.

So 'bl.x' will always point to 'x' variable present inside generate block 'bl'. I can think of another similar counter example:

module top;
    generate
        begin:b
        struct {int x;} bl;
            initial begin:c
               bl.x = 1; // will it be converted to hierarchical reference of seq block after the full scope is traversed
                begin:bl
                   int x;
                end
            end
       end
    endgenerate
endmodule

Here in this case, 'bl.x' should point to 'x' inside struct. But no standard simulators work in that way currently, they all resolve it to 'x' present inside sequential block 'bl' as per their legacy code. So lots of legacy code already present inside simulators and other tools need to be re-written if we go by LRM. I can understand how the code is written - it never considers the first identifier of dotted name as simple identifier and never searches it at the point of reference, then later when it is searched the 'bl' is already declared lexically later. We have then two ways of solution:

1) LRM needs to be rewritten to keep the legacy code as it is.
2) Simulators and other tools code to be re-written, with the risk that lots of designs working fine earlier will not work then.

<1> is easy solution, but <2> is ideal solution.

Regards
Surya


-------- Original Message  --------
Subject: Re:[sv-bc] Member select or hierarchical name
From: Rich, Dave <Dave_Rich@mentor.com>
To: Surya Pratik Saha <spsaha@cal.interrasystems.com>, Bresticker, Shalom <shalom.bresticker@intel.com>
Cc: "sv-bc@eda.org" <sv-bc@eda.org>
Date: Wednesday, January 07, 2009 8:37:27 PM

Surya,

 

New terminology added to the LRM section 23.7 is “point of appearance”, which I believe was supposed to be “point of the reference” as defined by section 26.3 on locally visible identifiers.

 

A decision is supposed to be made from this point of reference without looking at any of the code forward of it. In the example in 23.7, dotted name 2 shows the intended behavior.

 

 

Dave

 

 


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 4:50 AM
To: Bresticker, Shalom
Cc: sv-bc@eda.org
Subject: Re: [sv-bc] Member select or hierarchical name

 

Hi Shalom,
So can you answer my original query that - is it required to revisit the 'hierarchical name' after completing the traversal of scope to convert it as 'memory select'. LRM is silent on that.

Regards
Surya



-------- Original Message  --------
Subject: Re:[sv-bc] Member select or hierarchical name
From: Bresticker, Shalom <shalom.bresticker@intel.com>
To: Surya Pratik Saha <spsaha@cal.interrasystems.com>
Cc: "sv-bc@eda.org" <sv-bc@eda.org>
Date: Wednesday, January 07, 2009 6:12:51 PM

Now I see what you mean.

 

Shalom

 


From: Surya Pratik Saha [mailto:spsaha@cal.interrasystems.com]
Sent: Wednesday, January 07, 2009 2:30 PM
To: Bresticker, Shalom
Cc: sv-bc@eda.org
Subject: Re: [sv-bc] Member select or hierarchical name

Hi Shalom,
An identifier can't be used as forward reference like task enable or function call. So for the following example:

module top;
int x;
if (1) begin : b // generate block
initial x = 1; // pointing to 'int x' inside module
bit x;
end
endmodule

The reference 'x' inside initial block is 'int x;' inside module, not 'bit x' inside generate block.

Now for my earlier example, 'bl' as struct is not yet declared when 'bl.x' is referred, and it must hit generate block 'bl'. So I am not sure how you derive rule <1> will be applied here.

Regards
Surya
    



-------- Original Message  --------
Subject: Re:[sv-bc] Member select or hierarchical name
From: Bresticker, Shalom <shalom.bresticker@intel.com>
To: Surya Pratik Saha <spsaha@cal.interrasystems.com>
Cc: "sv-bc@eda.org" <sv-bc@eda.org>
Date: Wednesday, January 07, 2009 5:41:54 PM

Hi,

 

I can see where you get confused. As I wrote, we still have a long way to go before the description is complete, precise, and clear.

 

In this case, "the first name in the sequence is resolved as though it were a simple identifier"

should point you to 23.9, where it says,

"If an identifier is referenced directly (without a hierarchical path) within a task, function, named block, or generate block, it shall be declared either within the task, function, named block, or generate block locally or within a module, interface, program, checker, task, function, named block, or generate block that is higher in the same branch of the name tree that contains the task, function, named block, or generate block. If it is declared locally, then the local item shall be used; if not, the search shall continue upward until an item by that name is found or until a module, interface, program, or checker boundary is encountered."

 

As a result bl resolves to the variable declaration. Then rule <1> applies.

Shalom


From: Surya Pratik Saha [mailto:spsaha@cal.interrasystems.com]
Sent: Wednesday, January 07, 2009 2:04 PM
To: Bresticker, Shalom
Cc: sv-bc@eda.org
Subject: Re: [sv-bc] Member select or hierarchical name

Hi Shalom,
Darft LRM mentioned:
When a dotted name is encountered at its point of appearance, the first name in the sequence is resolved as though it were a simple identifier.

And if we go by simple identifier searching rule, then 'b1' to be selected as generate block, as the struct is not yet declared. So the 'bl.x' has to be considered as 'hierarchical name' as per the rule <2> mentioned in the section. So your comment saying "bl.x is considered to be a member select of bl.x." is not correct. But my query is - after traversing the whole design, is it required to double check the 'hierarchical name's to convert to 'member select'. In that way, LRM is silent.

Regards
Surya
    



-------- Original Message  --------
Subject: Re:[sv-bc] Member select or hierarchical name
From: Bresticker, Shalom <shalom.bresticker@intel.com>
To: Surya Pratik Saha <spsaha@cal.interrasystems.com>, sv-bc@eda.org <sv-bc@eda.org>
Date: Wednesday, January 07, 2009 5:21:31 PM

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.
 
 
 
 
 
  

 

---------------------------------------------------------------------
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.
  

 

---------------------------------------------------------------------
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.


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

This archive was generated by hypermail 2.1.8 : Wed Jan 07 2009 - 20:59:42 PST