{"id":18346,"date":"2023-05-24T20:02:20","date_gmt":"2023-05-25T00:02:20","guid":{"rendered":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/?p=18346"},"modified":"2026-03-27T08:51:39","modified_gmt":"2026-03-27T12:51:39","slug":"bent-tools-and-other-horrors-from-the-garden-and-uvm-debug-or-are-you-still-debugging-with-display","status":"publish","type":"post","link":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/2023\/05\/24\/bent-tools-and-other-horrors-from-the-garden-and-uvm-debug-or-are-you-still-debugging-with-display\/","title":{"rendered":"Bent Tools and other Horrors From the Garden and UVM Debug &#8211; or Are You Still Debugging with $display?"},"content":{"rendered":"\n<p>I can&#8217;t take credit for the great flowers in the garden. It&#8217;s the tremendous rain we&#8217;ve had in California this year &#8211; and anyhow, my wife is the gardener in the house.<\/p>\n\n\n\n<p>But it&#8217;s my job to do some weeding. While meditative, it is disagreeable to me.<\/p>\n\n\n\n<p>But back to UVM Debug and Visualizer.<\/p>\n\n\n\n<p>I was using my &#8220;weeding tool&#8221; to get between some bricks and I needed a pry bar, push, push, got it! Oops. Bent the weeding tool. I got it unbent, but it has a kink in it which tells everyone who sees it &#8211; &#8220;my owner used the wrong tool&#8221;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">UVM Debug<\/h2>\n\n\n\n<p>For the UVM, I can&#8217;t tell you how many people I&#8217;ve heard say they use $display for their debug. &#8220;Too hard to bring up the GUI&#8221;. &#8220;I just have a couple things to debug&#8221;. &#8220;Real engineers don&#8217;t use GUIs&#8221;. &#8220;I&#8217;ve been working on this block or derivatives for many years &#8211; I know where the bugs are&#8221;.<\/p>\n\n\n\n<p>But really.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">It&#8217;s Better In the Waves<\/h2>\n\n\n\n<p>The waveform window in a GUI allows you to correlate things. You can even find causality. $display can&#8217;t do that. Just line after line after line of text and text and text.<\/p>\n\n\n\n<p>Why would I use anything except $display or `uvm_info? I&#8217;ve been doing that forever&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"922\" height=\"773\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Code-That-Flips-A-Coin.jpg\" alt=\"\" class=\"wp-image-18385\" srcset=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Code-That-Flips-A-Coin.jpg 922w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Code-That-Flips-A-Coin-600x503.jpg 600w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Code-That-Flips-A-Coin-768x644.jpg 768w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Code-That-Flips-A-Coin-900x755.jpg 900w\" sizes=\"auto, (max-width: 922px) 100vw, 922px\" \/><figcaption class=\"wp-element-caption\">Code that flips a coin to construct 1 of 3 types &#8211; polymorphism working for you<\/figcaption><\/figure>\n\n\n\n<p>Use $display or `uvm_info&#8230;<\/p>\n\n\n\n<pre class=\"wp-block-code has-background\" style=\"background-color:#6b757d30\"><code>    $display(\"DEBUG INFO: t=%p\", t);\n    `uvm_info({\"DEBUG INFO: \", get_type_name()}, t.convert2string(), UVM_MEDIUM)<\/code><\/pre>\n\n\n\n<p>Get useful? information? Sort of useful. Sort of information.<\/p>\n\n\n\n<pre class=\"wp-block-code has-background\" style=\"background-color:#6b757d30\"><code>    # DEBUG INFO: t='{m_leaf_name:\"t1\", m_inst_id:3458, use_uvm_seeding:1,    m_inst_count:3462, __m_uvm_status_container:@uvm_status_container@1, events:@uvm_object_string_pool__3@392, begin_event:@uvm_event@179, end_event:@uvm_event@180, m_transaction_id:-1, begin_time:18446744073709551615, end_time:18446744073709551615, accept_time:18446744073709551615, initiator:null, stream_handle:0, tr_handle:0, record_enable:0, m_recorder:null, m_sequence_id:-1, m_use_sequence_info:0, m_depth:-1, m_sequencer:null, m_parent_sequence:null, print_sequence_info:0, m_client_str:\"\", m_client:null, m_rh:null, issued1:0, issued2:0, rw:0, addr:0, data:0, bits:'{a:0, b:0, c:1}, sstruct:'{a:0, d:0}, id:33, delay:5, loop_count:0, static_array:'{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, dynamic_array:'{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, queue:'{}, color:\"\", type_name:\"sequence_item_A\", g_id:34}\n\n    # UVM_INFO vip_a\/agentA.sv(486) @ 2601: uvm_test_top.i2_agentA.sequencer@@ggp_seq_A2.gp_seq.p_seq.A_seq &#91;DEBUG INFO: sequence_A] id=33:: WRITE(0, 0) &lt;'{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},'{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},'{}&gt;\n<\/code><\/pre>\n\n\n\n<p>Pretty, huh!?<\/p>\n\n\n\n<p>What about hovering over values and exploring other variables? What about seeing all the values of &#8216;t&#8217; throughout this loop (Hint: put it in the wave window)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Classes in the Waves<\/h2>\n\n\n\n<p>What if you wanted to know more? Go add more $display. What if you wanted to see this variable &#8216;t&#8217; from that sequence in the wave window? What if you could put the variable &#8216;t&#8217; &#8211; a class handle in the wave window?<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"565\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-of-Transaction-T-2-1024x565.jpg\" alt=\"\" class=\"wp-image-18388\" srcset=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-of-Transaction-T-2-1024x565.jpg 1024w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-of-Transaction-T-2-600x331.jpg 600w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-of-Transaction-T-2-768x424.jpg 768w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-of-Transaction-T-2-1536x848.jpg 1536w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-of-Transaction-T-2-900x497.jpg 900w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-of-Transaction-T-2.jpg 1601w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Put the &#8216;t&#8217; from a sequence object in the wave window<\/figcaption><\/figure>\n\n\n\n<p>What if you wanted to put a handful of sequence objects in the wave window? They have a lifetime. They don&#8217;t exist. Then they are constructed. Then later, they are garbage collected.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"183\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-Of-Sequences-1024x183.png\" alt=\"\" class=\"wp-image-18383\" srcset=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-Of-Sequences-1024x183.png 1024w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-Of-Sequences-600x107.png 600w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-Of-Sequences-768x138.png 768w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-Of-Sequences-1536x275.png 1536w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-Of-Sequences-900x161.png 900w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-Of-Sequences.png 1686w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Handful of &#8220;interesting&#8221; sequence objects in the wave window<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Got Queues? Associative Arrays? Dynamic Arrays?<\/h2>\n\n\n\n<p>Simple code. A transaction class with an &#8216;id&#8217; field. A container class &#8216;C&#8217; which has a variety of dynamic structures &#8211; &#8216;incoming&#8217; &#8211; an associative array; &#8216;output&#8217; &#8211; a dynamic array; and &#8216;q&#8217; &#8211; a queue.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"388\" height=\"314\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/DynamicArraysAssociativeArraysQueues.png\" alt=\"\" class=\"wp-image-18381\"\/><\/figure>\n\n\n\n<p>Click, click, click. Add to Wave. See the Associative array filling and changing. Same for the Dynamic array. And the Queue. Pushing and popping.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"639\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-Of-DynamicArraysAssociativeArraysQueues-1024x639.png\" alt=\"\" class=\"wp-image-18382\" srcset=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-Of-DynamicArraysAssociativeArraysQueues-1024x639.png 1024w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-Of-DynamicArraysAssociativeArraysQueues-600x374.png 600w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-Of-DynamicArraysAssociativeArraysQueues-768x479.png 768w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-Of-DynamicArraysAssociativeArraysQueues-1536x958.png 1536w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-Of-DynamicArraysAssociativeArraysQueues-900x561.png 900w, https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/Wave-Of-DynamicArraysAssociativeArraysQueues.png 1733w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Associative array, Dynamic Array and A queue in a class in the wave window<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">End<\/h2>\n\n\n\n<p>And did I mention? This is all postsim. You can do it in livesim too. But postsim. Yes.<\/p>\n\n\n\n<p>What can $display do for you? It&#8217;s like that bent garden tool. Use the right tools and be more productive.<\/p>\n\n\n\n<p>Try Visualizer. It won&#8217;t bite. You might even find that bug faster.<\/p>\n\n\n\n<p>What tools have you bent in the garden? Or better &#8211; what have you invented to give you the visibility that you need for debug?<\/p>\n\n\n\n<p>Safe debugging.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"449\" height=\"597\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/PXL_20230416_201010009.MP_-edited.jpg\" alt=\"UVM Debug? Just nature doing what it does\" class=\"wp-image-18391\"\/><figcaption class=\"wp-element-caption\"><a href=\"https:\/\/calscape.org\/Ceanothus-Dark-Star-(Dark-Star-Mountain-Lilac)?srchcr=sc574ab5af4ac4b\" target=\"_blank\" rel=\"noopener\">Ceonothus &#8216;Dark Star&#8217; (California Lilac)<\/a> &#8211; In my front yard, never subject to any of my bent garden tools<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>I can&#8217;t take credit for the great flowers in the garden. It&#8217;s the tremendous rain we&#8217;ve had in California this&#8230;<\/p>\n","protected":false},"author":71540,"featured_media":18347,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spanish_translation":"","french_translation":"","german_translation":"","italian_translation":"","polish_translation":"","japanese_translation":"","chinese_translation":"","footnotes":""},"categories":[983,1,982,10],"tags":[419,506,718,751,787],"industry":[53],"product":[205,1124],"coauthors":[961],"class_list":["post-18346","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uvm","category-news","category-systemverilog","category-tips-tricks","tag-debug","tag-functional-verification","tag-simulation","tag-systemverilog","tag-uvm","industry-electronics-semiconductors","product-questa","product-visualizer"],"featured_image_url":"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2023\/05\/PXL_20230416_201010009.MP_-scaled-e1684968385671.jpg","_links":{"self":[{"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/posts\/18346","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/users\/71540"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/comments?post=18346"}],"version-history":[{"count":5,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/posts\/18346\/revisions"}],"predecessor-version":[{"id":18395,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/posts\/18346\/revisions\/18395"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/media\/18347"}],"wp:attachment":[{"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/media?parent=18346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/categories?post=18346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/tags?post=18346"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/industry?post=18346"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/product?post=18346"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/coauthors?post=18346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}