RE: [sv-bc] Mantis 1610: Scoping of unnamed sequential blocks

From: Warmke, Doug <doug_warmke_at_.....>
Date: Wed Oct 31 2007 - 07:11:14 PDT
I like this idea, too.

Minor suggestion to consider:
How about "anonblk" rather than "unmblk"?
(Short for anonymous)

Thanks,
Doug

-----Original Message-----
From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org] On
Behalf Of Vreugdenhil, Gordon
Sent: Wednesday, October 31, 2007 7:05 AM
To: Bresticker, Shalom; Steven Sharp
Cc: sv-bc@server.eda.org
Subject: Re: [sv-bc] Mantis 1610: Scoping of unnamed sequential blocks



Bresticker, Shalom wrote:
> Hi,
> 
> Mantis 1610 passed in the email vote, but there were two comments that

> we did not discuss in the last meeting.
> 
> Brad wrote, "A type declared even in a named block can't be 
> hierarchichally referenced, can it? The text doesn't say it can, but I

> can imagine someone making that inference."

I'm not too worried about someone making that assumption.  It is
clearly stated elsewhere that you can't hierarchically reference
types and just because something is a declaration in a "hierarchy scope"
does not imply that it is hierarchically referencable.


> Also, Steven wrote, "Shouldn't we try to provide a standard 
> compiler-generated naming convention for unnamed blocks? I would
suggest 
> following the pattern used for generate blocks, but with "genblk" 
> replaced with something like "unmblk"." I have filed that as an 
> enhancement request in Mantis 2167.


I think we should do this.  However I think the naming scheme can
be (and must be!) simpler than the "directly nested conditions" part
of the generate block naming since all sequential unnamed blocks
will exist.  I would suggest just numbering starting at 1 within
each scope.  Each anonymous scope with a "begin" counts
as do implicit scopes for a for loop with an inline declaration even
if the body of the loop wouldn't otherwise create a scope.

The only thing to be careful about is that I think you need to use the
next number in the scope in which the implicit scope name lives.  So
for a begin..end that does NOT create a declarative scope, nested blocks
use the count of the nearest enclosing declarative scope.

Example:
     always @(a) begin
        x = 1;
        begin          // unmblk1
           int y;
	  begin          // unmblk1
              int z;
           end
        end
        begin
           x = 2;
        end
        begin         // unmblk2
           int y;
        end
     end
     initial begin    // unmblk3
        int x;
        for (int i = 0; i < 5; i++)         // unmblk1
          x++;
        for (int i = 0; i < 5; i++)         // unmblk2
        begin                                  // unmblk1
          int y;
          x++;
        end
     end

Steven, does this match what you would expect?

Gord.
-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com


-- 
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 Oct 31 07:11:45 2007

This archive was generated by hypermail 2.1.8 : Wed Oct 31 2007 - 07:12:09 PDT