Hi Andrzej,
Thanks for the feedback.
Please check in the "Description" field of this Mantis item.
In there I explicitly state that the directly-C-compatible
small value types (longint, int, shortint, and byte) are still
to be passed by value rather than by svBitPackedArrRef.
I totally agree with you that it's vital to continue to do so.
The case I'm talking about here is for non-C-compatible type
of dimensioned, packed bit arrays "bit [y:x]".
Regards,
Doug
> -----Original Message-----
> From: Andrzej I. Litwiniuk [mailto:Andrzej.Litwiniuk@synopsys.com] 
> Sent: Wednesday, October 27, 2004 7:18 AM
> To: Warmke, Doug
> Cc: sv-cc@eda.org
> Subject: Re: [sv-cc] New Mantis item (274) on DPI's 
> svBitVec32 --> open arrays 27.1.2
> 
> > We discovered another minor difficulty in DPI.
> > The crux of the matter involves the "small" packed 2-state type
> > modeled with svBitVec32.  When a 2-state vector is <= 32 bits,
> > it is no longer passed by reference, but rather by value.
> > This makes it impossible for a DPI user to create a single
> > imported function that accepts an arbitrary width 2-state
> > vector as an argument.
> 
> Doug,
> 
> I believe that open arrays were intended exactly for what you 
> want to achieve, 
> i.e. to "make it possible for a DPI user to create a single 
> imported function 
> that accepts an arbitrary width 2-state vector as an argument."
> 
> LRM 27.1.2: "Formal arguments of an imported function can be 
> specified as open arrays. 
> A formal argument is an open array when a range of one or 
> more of its dimensions, packed 
> or unpacked, is unspecified. [...] An actual argument shall 
> match the formal one regardless 
> of the range(s) for its cor-responding dimension(s), which 
> facilitates writing generalized 
> code that can handle SystemVerilog arrays of different sizes."
> 
> So in my opinion we have both; generality and efficiency for 
> "typical" cases.
> Pls. also note, that passing small values 'by value' rather 
> than by a reference is consistent 
> with C. If small values, like int, were not passed by value, 
> then it will be impossible 
> to call standard C library functions from SV.
> 
> 
> Thanks,
> Andrzej
> 
> 
> > Details are located at
> >    http://www.eda.org/svdb/bug_view_page.php?bug_id=0000274
> > 
> > Charles,
> > 
> > Can you please assign me to be the owner of this item?
> > I will upload a proposal that basically simplifies DPI by
> > eliminating the exception for bit vectors <= 32 bits in width.
> > 
> > Thanks and regards,
> > Doug
> > 
> > 
> 
> 
Received on Wed Oct 27 07:24:13 2004
This archive was generated by hypermail 2.1.8 : Wed Oct 27 2004 - 07:24:15 PDT