Use the output of a module inside a class (including task (generator)

In reply to saketa:

Sorry this was my mistake. The compile command is
vlog sine.sv dpi_sin.c -dpiheader sin.h