Re: DirectC: C layer


Subject: Re: DirectC: C layer
From: Andrzej Litwiniuk (Andrzej.Litwiniuk@synopsys.com)
Date: Wed Dec 11 2002 - 17:55:05 PST


> > > e) Since arrays are always starting at 0, it might be possible to map a
> > > function with a parameter logic [15:8] and a second function with a
> > parameter
> > > logic [7:0] to a single C function
> > > (althought the extern definitions on the SV side are _intentionally_
> > different
> > > here). Do we want to have this, is this O.K., and what would be the
> > > implications ?
> >
> >
> >The syntax that we agreed upon allows for aliasing. We haven't specified
> >that two different external functions must not use the same C function name.
> >So, at the same time, we may map two formally different functions on the same
> >C function where it makes sense, and allow for user's mistakes.
> >
> >Example:
> > extern "foo_8" void foo_15_8(logic [15:8]); // ok
> > extern "foo_8" void foo_7_0(logic [7:0]); // ok
> >
> > extern "foo" void f1(int,int,int); // undetected conflict!!!
> > extern "foo" void f2(real,string); // undetected conflict!!!

Francoise wrote:

> we could have the SV compiler checks all the externs and warn/error about
> these conflicts

Sure. But this requires adding a new restriction that the same C name
must not be aliased to two different external functions.
[in the above example C name "foo" is used as an alias for 'f1' and 'f2'.]

I don't mind such restriction. Should we add it to LRM?

Andrzej



This archive was generated by hypermail 2b28 : Wed Dec 11 2002 - 18:35:19 PST