How to export the dpi function between c and sv

In reply to zz8318:
It would help to show a minimal, complete example. Where are the DPI import/export statements in relation to where the call to get_all_reg()?