Re: pointers & handles


Subject: Re: pointers & handles
From: Andrzej Litwiniuk (Andrzej.Litwiniuk@synopsys.com)
Date: Tue Jan 07 2003 - 12:34:22 PST


Kevin wrote:
> I have no objection to individual implementations using pointers if they
> can, however an interface that depends on it won't work in general.

Why do you think so? What's wrong with the pointers?

> If the interface is specified such that all calls can be macro-definintions
> then it should work either way.

> Indirect:
>
> #define svcGetArrElemPtr2(my_value,MyType,h,i,j)\
> NSCsvGetArrElemPtr2(&(my_value), h, i, j);

Kevin,

The interface may provide functions for the predefined types
(int, shortreal, etc.) or predefined classes of types (packed bit/logic arrays),
but =not= for all the possible user-defined types!

Although it is possible to generate an access function for each user defined
type, such approach seems impractical.
Therefore no simulator can provide a function "NSCsvGetArrElemPtr2"
for your private type "MyType".

I don't see how it could be possible to provide access to an array element of arbitrary a type without resorting to pointers, if a predefined library
is to be used.

> NB: Macro definitions generally don't take "..." arguments.

Right. So, macros won't do the trick either, will they?

Andrzej



This archive was generated by hypermail 2b28 : Tue Jan 07 2003 - 12:35:21 PST