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

From: Greg Jaxon <Greg.Jaxon@synopsys.com>
Date: Sat Sep 04 2010 - 16:48:40 PDT

Consider

`define MAC
typedef struct {
     `ifndef MAC
     `define MAC
         int x;
     `endif
     int y;
} endstruct;

If the PRE processor and its namespace supported scopes, the description of it
in section 22 would mention certain keywords (e.g. package, struct, ....?) to open and
close these scopes. In the long tradition of preprocessors, few if any have offered
a scoped namespace, let alone one integrated with any of the preprocessor's subject
languages.

On 9/4/2010 2:18 AM, Surya Pratik Saha wrote:
> 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.
>

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sat Sep 4 16:49:05 2010

This archive was generated by hypermail 2.1.8 : Sat Sep 04 2010 - 16:51:05 PDT