RE: [sv-bc] Text Macro namespace confined by package scope

From: Rich, Dave <Dave_Rich@mentor.com>
Date: Mon Sep 06 2010 - 21:52:06 PDT

LRM 3.13 d) is explicit that "text macro name space is global within the
compilation unit". Macros do not exist in any other scope.

And that is because all compiler directives like `define, `include, and
`ifdef are processed before any other language syntax.

Dave

> -----Original Message-----
> From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
Surya
> Pratik Saha
> Sent: Saturday, September 04, 2010 12:19 AM
> To: sv-bc@eda.org
> Cc: Adhip Das
> Subject: [sv-bc] Text Macro namespace confined by package scope
>
>
> Hi,
> I have encountered an RTL design, where it is assumed that a macro
> defined outside the package is not visible inside it, as if macro is
> part of CU and no CU item is visible inside package. For e.g.:
>
> `define MAC
> package p;
> `ifndef MAC
> `define MAC
> int x;
> `endif
> endpackage
>
> As per the LRM, macro name space is different from CU name space. So
> 'int x;' should not be declared inside package. All the standard tools
> also work as per LRM. But our customer wants 'int x;' to be declared
> because as per their opinion the macro 'MAC' should not be visible
> inside the package. I am not sure any tools support this feature or
not.
> I just want to understand whether there is any LRM enhancement request
> regarding this, and what will be the consequences if this happens.
>
> --
> Regards
> Surya
>
>
>
>
> --
> 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 Mon Sep 6 21:52:28 2010

This archive was generated by hypermail 2.1.8 : Mon Sep 06 2010 - 21:55:22 PDT