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

From: Michael McNamara <mcnamara_at_.....>
Date: Thu Aug 11 2005 - 10:53:17 PDT
Unnamed blocks were reportedly introduced soley in order to allow creation of "hidden" variables (they can not be referenced hierarchically). As I stated before, this is an overly cumbersome way to get this effect.  Much better would be introducing a qualifier like static or scalared as part of the variable declaration.

That would allow hidden variables at module scope.

That would allow declaring together three variables that are related, while hiding one of them from external influence.

As it stands today, one can not refer hierarchially to scopes created under an unnamed block.

Does this apply to unnamed blocks that do NOT contain a declaration?

EG:

Module a;
  Integer R;
  Always @( posedge k ) begin
     R = b.c;  // legal in 1364, not in P1800
  End

  Always @(negedge k)  begin
     Begin : b
       Integer c;
       C = $random;
      
    End
  End
Endmodule

 -----Original Message-----
From: 	Brad Pierce [mailto:Brad.Pierce@synopsys.com]
Sent:	Thu Aug 11 09:00:18 2005
To:	sv-bc@eda.org
Subject:	Re: [sv-bc] Is an unnamed block with declarations a scope?

Most programming languages don't even have named blocks.  If designers
want to declare their variables in the local scope that uses them,
instead of declaring global variables, why would you force them to make
up block names?

-- Brad

>I go back to my point that we should remove unnamed blocks.  
>They add no value and only break things; and as you point out the 
>problem is even worse than first surmised.
Received on Thu Aug 11 10:53:20 2005

This archive was generated by hypermail 2.1.8 : Thu Aug 11 2005 - 10:53:34 PDT