Imported C-DPI task(which internally calls exported SV tasks) getting disabled.Please help

Hello everyone,

I have imported following C subroutine(RunTestCase) to SV as follows.

import “DPI-C” context RunTestCase = task RunTestCase(int TestcaseId);

Inside the C code , it calls the SV tasks exported from SV domain to C domain.

C code looks like this…

extern “C” int RunTestCase (int TestId) {

…some code
…some code…
WriteField(“something”,“REG_something”,“something”,255); //This is exported from SV


}

WriteField is declared as follows in SV file

export “DPI-C” WriteField = task WriteField;

task WriteField (input string block_name, input string reg_name, input string field_name, input int Data);
…some code

endtask

Everything looks correct here.

But I am getting following error.

xmsim: *F,DISEXP: The export subroutine WriteField cannot be called from disabled import subroutine RunTestCase.

The question is , why subroutine “RunTestCase” is getting disabled. I never did that manually in code.!!

Please help. Its urgent.

Thanks,
Suyog
+91 9845696897

In reply to suyog_asic:

Hard to say without seeing more code. Did you follow the protocol for DPI exports in section 35.9 Disabling DPI tasks and functions in the 1800-2017 LRM?

Hi Suyog,

I am facing the same issue currently. Could you post the solution for the problem if you were able to fix it?

Thank you.

In reply to SrikarChoppakatla:

Hi ,

The C-dpi task was actually getting disabled due to all objections getting dropped.
Even whenever I saw this issue with some of my collegues, the reason was imported task(task consumes non zero time as u know) was getting called from SV domain and there was no objection raised , so imported task was getting disabled.

Basically as the error says, the C-DPI task was actually getting disabled( due to some reason…one reason may be objections dropped).

Thanks,
Suyog