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

**URL:** <https://verificationacademy.com/forums/t/imported-c-dpi-task-which-internally-calls-exported-sv-tasks-getting-disabled-please-help/34249>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, UVM, DPI\
**Created:** [March 24, 2018, 7:22pm UTC](https://verificationacademy.com/forums/t/imported-c-dpi-task-which-internally-calls-exported-sv-tasks-getting-disabled-please-help/34249 "2018-03-24T19:22:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![suyog\_asic](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@suyog\_asic](https://verificationacademy.com/forums/u/suyog_asic)\
**Post date:** [March 24, 2018, 7:22pm UTC](https://verificationacademy.com/forums/t/imported-c-dpi-task-which-internally-calls-exported-sv-tasks-getting-disabled-please-help/34249/1 "2018-03-24T19:22:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [March 26, 2018, 1:06am UTC](https://verificationacademy.com/forums/t/imported-c-dpi-task-which-internally-calls-exported-sv-tasks-getting-disabled-please-help/34249/2 "2018-03-26T01:06:49Z")

</div>

_In reply to [suyog\_asic](https://verificationacademy.com/forums/t/imported-c-dpi-task-which-internally-calls-exported-sv-tasks-getting-disabled-please-help/34249):_

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?

---

<div class="post-metadata">

**Author:** ![SrikarChoppakatla](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/d78d45/32.png) [@SrikarChoppakatla](https://verificationacademy.com/forums/u/SrikarChoppakatla)\
**Post date:** [June 15, 2018, 9:46pm UTC](https://verificationacademy.com/forums/t/imported-c-dpi-task-which-internally-calls-exported-sv-tasks-getting-disabled-please-help/34249/3 "2018-06-15T21:46:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![suyog\_asic](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@suyog\_asic](https://verificationacademy.com/forums/u/suyog_asic)\
**Post date:** [October 25, 2018, 7:09am UTC](https://verificationacademy.com/forums/t/imported-c-dpi-task-which-internally-calls-exported-sv-tasks-getting-disabled-please-help/34249/4 "2018-10-25T07:09:52Z")

</div>

_In reply to [SrikarChoppakatla](https://verificationacademy.com/forums/t/imported-c-dpi-task-which-internally-calls-exported-sv-tasks-getting-disabled-please-help/34249/3):_

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
