In reply to chr_sue:
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.