DPI import from array of systemC module

Hello,

I have done DPI importing function from a systemC module.
But now I want to take an array of systemC modules. So how import of systemc functions works?
How can I import the functions as all the array of modules contain same function names?

systemC module array instantiated as below.
//SystemC model Instance
genvar s;
generate
for (s=0; s <`DIES ; s++) begin : Die
MEMDie Die (

connections

);

end
endgenerate

This MEMDie contains functions. So how can I import the same for an array?

Thanks,
Smit

In reply to smitgovani:
You cannot import methods of C++ classes. What you can do in import a static C++ method that has been extern’ed to C, and pass an instance number as argument to the function. Then the function can look up the class method in the array based in the index and call the proper C++ method.

I have imported systemC function for single instance of model and its working as expected.
import “DPI-SC” function void BFM_SetClockPeriod(real);

I am running the same on questasim and its able to find function for single instance.
The issue happens while instantiation with array. Receiving following error while calling the function.
“SystemC scope has not been set before calling SystemVerilog DPI-SC import BFM_SetClockPeriod”

I have tried with calling “Die[0].BFM_SetClockPeriod(5);” but still failing.
So it seems that need to provide scope properly while import/calling of function.

In reply to smitgovani:
Since DPI into SystemC code is not part of the standard, you will need to contact your tool vendor for support.