# implement a reference counter 

**URL:** <https://verificationacademy.com/forums/t/implement-a-reference-counter/51683>\
**Category:** UVM\
**Tags:** UVM\
**Created:** [June 23, 2026, 5:56pm UTC](https://verificationacademy.com/forums/t/implement-a-reference-counter/51683 "2026-06-23T17:56:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hasi](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/h/cab0a1/32.png) [@hasi](https://verificationacademy.com/forums/u/hasi)\
**Post date:** [June 23, 2026, 5:56pm UTC](https://verificationacademy.com/forums/t/implement-a-reference-counter/51683/1 "2026-06-23T17:56:22Z")

</div>

Hi,

I want to implement a reference counter for the duct in UVM environment. I do not know where to aadd this counter. This reference counter needs to track the dut counter whenever I call it, meaning I will be doing a comparison between them to see if they are in sync. I start the dut counter by sending a transaction to the driver, which will assert a start signal in the dut, so it can start.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [June 24, 2026, 2:44pm UTC](https://verificationacademy.com/forums/t/implement-a-reference-counter/51683/2 "2026-06-24T14:44:47Z")

</div>

You can easily implement a uvm\_component object as your reference model in the environment and feed ist with the retrieved transaction.

---

<div class="post-metadata">

**Author:** ![hasi](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/h/cab0a1/32.png) [@hasi](https://verificationacademy.com/forums/u/hasi)\
**Post date:** [June 24, 2026, 7:16pm UTC](https://verificationacademy.com/forums/t/implement-a-reference-counter/51683/3 "2026-06-24T19:16:33Z")

</div>

Can I implement the counter using object? and then i can add a reference counter their. then how do i run the counter ? like do i have to use the same clk from dut counter clk or use $reslrime() to do the count computation.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [June 25, 2026, 3:56pm UTC](https://verificationacademy.com/forums/t/implement-a-reference-counter/51683/4 "2026-06-25T15:56:25Z")

</div>

Your counter reference model belongs to the TB architecture. It should be of type uvm\_component.

You can feed it with tansactions.
