RE: [sv-cc] Multidimensional dynamic array in DPI-C

From: Jim Vellenga <vellenga@cadence.com>
Date: Thu Apr 05 2012 - 08:13:02 PDT

Unfortunately, at the moment two things are true, as far as I know:

1) The IEEE no longer allows working groups to provide "interpretations".

2) The SV-CC committee is not continuing to meet, and will probably not resume until the next round of updates.

3) I can't even file this as a question for the future, because the working group data base appears to be closed to new issues.

I agree with you that these are reasonable questions, but I suspect that the answer is up to you and your VPI provider or providers - unless someone else sees a specific answer in the standard.

From: owner-sv-cc@eda.org [mailto:owner-sv-cc@eda.org] On Behalf Of Radoslaw Nawrot
Sent: Thursday, 5 Apr 2012 2:31 AM
To: sv-cc@eda.org
Cc: 'Oleg Demchenko'; 'Daniel Mlynek'
Subject: [sv-cc] Multidimensional dynamic array in DPI-C

Hello,

I have two interpretation problems:

1.) array querying functions for multidimensional dynamic array

Example code:
module top;
import "DPI-C" function a(int i [][]);
int y [][];
 initial
 begin
 y=new[4];
 y[0] = new[1];
 y[1] = new[2];
 y[2] = new[3];
 y[3] = new[4];
 a(y);
 end
 initial #1000 $finish;
endmodule

What should be returned on c side by svSize:

extern "C" int a(svOpenArrayHandle hnd) {

file<<"Size d2: "<<svSize(hnd,2)<<std::endl;

return 0;

}

?

Should be 0 ($high - $low + 1)? Or maybe simulation error would be better in that case?

LRM says:

$left shall return the left bound of the dimension. For a packed dimension, this is the index of the

most significant element. For a queue or dynamic array dimension, $left shall return 0.

- $right shall return the right bound of the dimension. For a packed dimension, this is the index of

the least significant element. For a queue or dynamic array dimension whose current size is zero,

$right shall return -1.

- For a fixed-size dimension, $increment shall return 1 if $left is greater than or equal to $right

and -1 if $left is less than $right. For a queue or dynamic array dimension, $increment shall

return -1.

- $low shall return the same value as $left if $increment returns -1, and the same value as

$right if $increment returns 1.

- $high shall return the same value as $right if $increment returns -1, and the same value as

$left if $increment returns 1.

So all dynamic arrays should have size =0 ??

 If yes than how user can get information to hull data by index if he(she) doesn't know how many index;es array have?

2.) If I use svGetArrElemPtr1(hnd, 0) should it return another svOpenArrayHandle ?

    If not then how user can get number of second dimension elements to use svGetArrElemPtr2 ??

    The same question about svGetArrayPtr

Thanks in advance ,

Radek

--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>, and is
believed to be clean.
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Apr 5 08:15:16 2012

This archive was generated by hypermail 2.1.8 : Thu Apr 05 2012 - 08:15:25 PDT