[sv-bc] $root and separate compilation


Subject: [sv-bc] $root and separate compilation
From: Peter Flake (Peter.Flake@synopsys.com)
Date: Wed Feb 26 2003 - 18:23:15 PST


All,

This proposal has been generated with Arturo in response to requests from the committee.

Peter.
-------------------------------------------------------------------------------------------------------------------------------------------------------
The language should allow for compiling each compilation unit (i.e. one or more files) as a separate entity.

The paradigm chosen for this follows C.

Each global name (data type or localparam) that is used in more than one compilation unit should be declared in a header file.

The header file should be conditionally included:
        `ifndef myhead
        `include "myhead.h"
        `define myhead
        `endif

Note that a gcc extension could be adapted to abbreviate this:
        `import "myhead.h"

While the above method is adequate for constants and types, which do not require to be present in the compiled object, it is inadequate for variables, functions and classes.

Here the proposal is to allow a prototype to be specified using the extern keyword.
        extern int mymod_i;
        extern function int func1(int I);

The variable mymod_i and the function func1 have to be declared in some compilation unit in the root namespace, otherwise there is an elaboration error.



This archive was generated by hypermail 2b28 : Wed Feb 26 2003 - 18:29:42 PST