Closed ZhouXiaoLiu closed 10 months ago
array_pkg:
`ifndef PYSV_DEMO
`define PYSV_DEMO
package demo;
import "DPI-C" function chandle Array_pysv_init();
import "DPI-C" function void Array_add_element(input chandle self,
input int i);
import "DPI-C" function void Array_destroy(input chandle self);
import "DPI-C" function bit Array_exists(input chandle self,
input int value);
import "DPI-C" function int Array_get_array(input chandle self);
import "DPI-C" function int Array_min(input chandle self);
import "DPI-C" function void pysv_finalize();
class PySVObject;
chandle pysv_ptr;
endclass
class Array extends PySVObject;
function new();
pysv_ptr = Array_pysv_init();
endfunction
function void add_element(input int i);
Array_add_element(pysv_ptr, i);
endfunction
function void destroy();
Array_destroy(pysv_ptr);
endfunction
function bit exists(input int value);
return Array_exists(pysv_ptr, value);
endfunction
function int get_array();
return Array_get_array(pysv_ptr);
endfunction
function int min();
return Array_min(pysv_ptr);
endfunction
endclass
endpackage
`endif // PYSV_DEMO
error report:
py code:
sv code: