Unable to access dimensions of multidimensional array - DPI-C

I have a multidimensional dynamic unpacked array in my SystemVerilog testbench and am passing this into C code as an argument using DPI-C. I am using Questasim 10.4b. Following the flow of Questa, I ran -dpiheader to generate the header file and included it in my C code.

SystemVerilog:


// C function declaration
import "DPI-C" function void modulate_my_frame (input byte data[][]);

// multidimensional array
byte unsigned frame_packed[][];

// assume this is randomized in my testbench
int num_frames = 5;

// init 1st dimension
frame_packed = new[num_frames];

// iterate through num_frames
for (int num_frame = 0; num_frame < num_frames; num_frame++) begin

  // item
  noob_frame fr = noob_frame::type_id::create("noob_frame");

  // randomize
  if (!noob_frame.randomize()) `uvm_error(get_name(), "Cannot randomize noob_frame");

  // pack noob_frame
  // I am casting this to void to simplify this example
  // This can return a variable sized array for frame_packed[num_frame]
  void'(fr.pack_bytes(frame_packed[num_frame]);

end

// fr[][] now contains all 5 noob_frames packed into byte arrays

// call DPI-C function
modulate_my_frame( frame_packed );

C:

void modulate_my_frame (const svOpenArrayHandle data)
{
  printf( "svLeft1       = %0d\n", svLeft      ( data, 1));
  printf( "svRight1      = %0d\n", svRight     ( data, 1));
  printf( "svLow1        = %0d\n", svLow       ( data, 1));
  printf( "svHigh1       = %0d\n", svHigh      ( data, 1));
  printf( "svIncrement1  = %0d\n", svIncrement ( data, 1));
  printf( "svSize1       = %0d\n", svSize      ( data, 1));

  printf( "svLeft2       = %0d\n", svLeft      ( data, 2));
  printf( "svRight2      = %0d\n", svRight     ( data, 2));
  printf( "svLow2        = %0d\n", svLow       ( data, 2));
  printf( "svHigh2       = %0d\n", svHigh      ( data, 2));
  printf( "svIncrement2  = %0d\n", svIncrement ( data, 2));
  printf( "svSize2       = %0d\n", svSize      ( data, 2));

  printf( "svDimensions  = %0d\n", svDimensions( data   ));
}

The printout that I get:

svLeft1 = 0

svRight1 = 4

svLow1 = 0

svHigh1 = 4

svIncrement1 = -1

svSize1 = 5

svLeft2 = -1

svRight2 = -1

svLow2 = -1

svHigh2 = -1

svIncrement2 = 0

svSize2 = -2

svDimensions = 2

I don’t understand how to possibly get the dimensions of my subarrays?

I tried casting my subarrays to svOpenArrayHandle and seeing if I can get the dimensions in this manner:

svOpenArrayHandle* sub_array = (svOpenArrayHandle*) svGetArrElemPtr(data, 0);
printf( "sub_array size = %0d\n", svSize(sub_array, 1));

The strange part is, I can use svGetArrElemPtr2 to access elements of my entire array. I just dont know what the dimensions are. At this point, my workaround is to pass another int array into the C code that contains the dimensions of the subarray.