In reply to dave_59:
I have further question on this topic.
If I coded as below in SV side.
always @ (posedge clk) begin
time1 <= $realtime;
time2 <= time1;
export "DPI-C" function get_period;
function void get_period(output realtime rt);
rt = (time1 - time2);
And in Cplusplus side, how can I get the value rt ?
I coded as below but failed at compilation.
extern "C" void get_period(double &t);