How can I use a DPI C function within a class

Thanks a lot for the reply Dave!

I have now imported the C function outside the class with:

import “DPI-C” context function CCRC32_crcbitbybit();

I am calling the C function by calling a function within the System Verilog class

function imp_func(byte data);

 longint crc_ret = 0;

$display("Importing C Function");
crc_ret = CCRC32_crcbitbybit();
$display("Return Vaule of CCRC32: %h",crc_ret);

endfunction

I have another question regarding datatypes between SV and C:

The CRC C function uses an unsigned char* which compares to be a string in SV, but I am using a byte as Parameter for the SV function.

Is there any possibility to convert a byte to a string in SV?

Thanks a lot,
René

In reply to dave_59: