RE: [sv-bc] FW: [sv-ec] Question on compilation units & compiler directives

From: Steven Sharp <sharp_at_.....>
Date: Tue Jan 24 2006 - 16:51:58 PST
>From: "Symons, Tom H" <tom.h.symons@intel.com>

>module1.sv
>`include "foo1.svh"
>`include "foo2.svh"
>
>module2.sv
>`include "foo1.svh"
>`include "foo2.svh"
>
>The above code will fail unless module1 and module2 are compiled such
>that the compiler directives are independent within each module.

If the compiler directives are inherited only when the modules are in
the same compilation unit, I am not clear on why you expect this code
to fail.  Yes, the includes in module2 will not end up pulling in
bar.svh because _include_foo1_ is still defined.  But in that situation
module2 has access to the contents of bar.svh anyway, because they were
already included into its compilation unit.

Having the scope of compiler directives match compilation units
appears to work reasonably well.

>One solution to this problem is to use packages instead of include
>files.  That would work, but it seems more a methodology choice.  I
>would think the language should support inclusion of a class object
>hierarchy as well.

If packages already provide a better solution to the problem, it is
hard to see why much effort should go into supporting a worse one.

Steven Sharp
sharp@cadence.com
Received on Tue Jan 24 16:52:29 2006

This archive was generated by hypermail 2.1.8 : Tue Jan 24 2006 - 16:54:23 PST