# Issues with do\_print() method?

**URL:** <https://verificationacademy.com/forums/t/issues-with-do-print-method/34289>\
**Category:** UVM\
**Tags:** UVM\
**Created:** [April 3, 2018, 10:19am UTC](https://verificationacademy.com/forums/t/issues-with-do-print-method/34289 "2018-04-03T10:19:25Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![npratt](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/n/b38774/32.png) [@npratt](https://verificationacademy.com/forums/u/npratt)\
**Post date:** [March 20, 2019, 1:39pm UTC](https://verificationacademy.com/forums/t/issues-with-do-print-method/34289/5 "2019-03-20T13:39:43Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/issues-with-do-print-method/34289/4):_

Do you also define convert2print in ALL your sequence items? Do you use the field macros for printing in ALL, NONE, or SOME of your sequence items? I’m trying to pinpoint what we are doing differently.

I only define do\_print (same as your example) for a fail\_inject transaction which also has convert2string defined. The other sequence items in our testbench only use the field macro for printing (no do\_print or convert2string). If ALL my sequence items defined the same do\_print (as in your example), I probably wouldn’t have the problem because m\_string would be updated for each sprint call. If I really need to put that code in ALL sequence items, even when I just want to use the field macros, why isn’t it in the uvm base class?

I have faced this issue in numerous projects. It always comes back to having the sequence item with do\_print/convert2string mistakenly inserted into a message that is using sprint on a transaction where only the field macros were used (no do\_print or convert2print). Years ago, I also had problems when using the field macros and also adding more details with do\_print, so I don’t mix-and-match those approaches anymore.

---

_[View the full topic](https://verificationacademy.com/forums/t/issues-with-do-print-method/34289)._
