# How to connect DPI systemverilog to class member

**URL:** <https://verificationacademy.com/forums/t/how-to-connect-dpi-systemverilog-to-class-member/39816>\
**Category:** UVM\
**Tags:** UVM, DPI\
**Created:** [November 15, 2021, 12:35pm UTC](https://verificationacademy.com/forums/t/how-to-connect-dpi-systemverilog-to-class-member/39816 "2021-11-15T12:35:31Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![cgales](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/c/ccd318/32.png) [@cgales](https://verificationacademy.com/forums/u/cgales)\
**Post date:** [November 15, 2021, 3:19pm UTC](https://verificationacademy.com/forums/t/how-to-connect-dpi-systemverilog-to-class-member/39816/5 "2021-11-15T15:19:29Z")

</div>

_In reply to [eranv](https://verificationacademy.com/forums/t/how-to-connect-dpi-systemverilog-to-class-member/39816/4):_

Similar to standard C function calls, the lifetime of the function and local variables is just during the function call. You can create global variables that can be shared as required, and use the context to determine the caller.

---

_[View the full topic](https://verificationacademy.com/forums/t/how-to-connect-dpi-systemverilog-to-class-member/39816)._
