Subject: Re: vote on the direct C api
From: Andrzej Litwiniuk (Andrzej.Litwiniuk@synopsys.com)
Date: Mon Jan 20 2003 - 09:42:38 PST
> FRANCOISE:
> I would like to pull out the open arrays access outside of the direct C api
> for voting. We can do the voting in 2 parts.
> My principal argument is that SV has no open arrays today, so I don't
> see why we have to define the directC for it.
Francoise,
We do this for the sake of the sheer convenience and the flexibility of
the interface.
DirectC interface does =not= introduce whatsoever open arrays to the SV language.
It merely relaxes the rules for argument passing for external functions.
The syntax for open arrays, i.e. "[]", may occur only within the external
declarations, and it's sole meanining is that the actual arguments of different
ranges will be deemed compatible for the formal argument specified as unsized
(aka open array).
This will allow to write a general C code that may handle SV arrays of
different sizes.
Otherwise each size will require a separate code in C, what seems very
impractical. Even worse: if the user decides to change the size of an array passed
to C, (s)he should at the same time modify her or his C code.
Consider also generic modules, that contain arrays of sizes parametrized by whatever
means (parameters, defparams, generated modules). How would you pass such an array
thru the DirectC interface, if the actual objects may have different sizes depending
on a module instance, and hence some of those arrays will match the size of the formal
argument while some others will not?
Let me restate it again: so called open arrays used throughout DirectC
are not the new constructs introduced to SV, rather than, they are merely and solely
a mean to relax the compatibility rules for passing SV arrays to C.
The introduction of the notion of unsized formal argument (i.e. an open array)
was strictly driven by practical considerations and practical needs.
It does not change SV per se. Whatever are the kinds of arrays in SV and whatever
are the rules for defining the sizes of arrays in SV, statically or dynamically,
DirectC does not affect it whatsoever.
> Why would we want to
> open arrays to systemVerilog? In an open array, the actual ranges of the arrays are only determined at runtime by the Verilog simulator, correct?
No, They are determined in compile time on per-call basis.
> This is the similar concept as to VHDL unconstrained arrays. If there is a need and request from Verilog users for it, there should be first a clear language definition for it. On the other hand, the extension committee is adding dynamic arrays and associative arrays, I don't think we have looked at the directC access for these and whether the access to open arrays we have defined would work for either dynamic or associative
> arrays.
You are right that DirectC as it is today, does not support the newly introduced
constructs like the dynamic or associative arrays. We can support them in the next
round.
Francoise, I believe that it was only a misunderstanding that made you to oppose
the open arrays in the specifications of formal arguments of external functions,
wasn't it?
Regards,
Andrzej
This archive was generated by hypermail 2b28 : Mon Jan 20 2003 - 09:43:19 PST