how should I define system Verilog DPI function for this ?
//cpp function
void getdata(double* a, double* b, double* c, double* d,
const char* 1_file, const char* 2_file,
const char* 2_file, const char* 4_file)
where (double a[16779264], double b[49152],double c[50176], double d[576])
I am getting issues when I assign this huge arrays in system Verilog… any efficient way to do this ?
double
in C corresponds to real
in SystemVerilog.
import "DPI-C" pure function void getdata
(input real a[16779264],
output real b[49152],
inout real c[50176],
input real d[576]);
Would be the following in C
void
getdata(
const double* a,
double* b,
double* c,
const double* d);
Thanks Dave.
I did change double to real but my confusion was on size of array since its huge size should I put it in definition or use dynamic array and assign it afterwards ?
Changing the array declaration from fixed-sized to dynamically sized won’t change the size of the array you need. What issues are you facing?
See The XY Problem.