# How to access a DUT signal from a UVM test case class?

**URL:** <https://verificationacademy.com/forums/t/how-to-access-a-dut-signal-from-a-uvm-test-case-class/29099>\
**Category:** UVM\
**Tags:** UVM, reference, DUT, hierarchical\
**Created:** [January 22, 2014, 7:16pm UTC](https://verificationacademy.com/forums/t/how-to-access-a-dut-signal-from-a-uvm-test-case-class/29099 "2014-01-22T19:16:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tfitz](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/tfitz/32/3025_2.png) [@tfitz](https://verificationacademy.com/forums/u/tfitz)\
**Post date:** [January 22, 2014, 7:25pm UTC](https://verificationacademy.com/forums/t/how-to-access-a-dut-signal-from-a-uvm-test-case-class/29099/2 "2014-01-22T19:25:40Z")

</div>

First of all, you should be using run\_phase() and not main\_phase().

Second of all, why would you possibly want to hard-code a hierarchical path to the DUT in your UVM? You are completely sacrificing the ability to reuse anything when you do that. Instead, you should create an interface that includes the signal(s) you want to access (the interface could include the hierarchical reference), and then you could pass that interface as a virtual interface via the config\_db to your test/env and access it that way.

Good luck,  
-Tom

---

_[View the full topic](https://verificationacademy.com/forums/t/how-to-access-a-dut-signal-from-a-uvm-test-case-class/29099)._
