How to connect DPI systemverilog to class member

,

In reply to cgales:

In reply to eranv:
It’s not clear what you want to achieve, but the DPI C layer has the concept of ‘context’ so that the C code can determine which SV component is doing the calling. You can also set the ‘context’ on the C side so you can target a specific SV component.
Annex H section H.9 of the LRM discusses this implementation.

Hi,
If I understand the problem correctly, he’s looking for a way to instantiate a c++ object that would be accessible via the DPI functions but would be instantiated outside the scope of these functions.

Eran - is this what you’re trying to achieve?