{"id":13487,"date":"2019-01-17T16:05:22","date_gmt":"2019-01-17T23:05:22","guid":{"rendered":"https:\/\/blogs.mentor.com\/verificationhorizons\/?p=13487"},"modified":"2026-03-27T08:39:21","modified_gmt":"2026-03-27T12:39:21","slug":"better-virtual-sequences-with-portable-stimulus","status":"publish","type":"post","link":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/2019\/01\/17\/better-virtual-sequences-with-portable-stimulus\/","title":{"rendered":"Better Virtual Sequences with Portable Stimulus"},"content":{"rendered":"<p>If you\u2019ve used UVM for verification, you\u2019ve almost certainly worked with virtual sequences. Once our needs for verification stimulus go beyond exercising a single interface, or even beyond exercising a single interface with a defined sequence of operations, we need a virtual sequence.<\/p>\n<p>Because virtual sequences need to deal with test scenarios \u2013 multi-step behaviors \u2013 they are written using directed test or directed-random test techniques.<\/p>\n<p><strong>How Does Portable Stimulus Help?<\/strong><\/p>\n<p>Think about a UVM sequence to test a DMA engine, like that shown below.<\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2019\/01\/DMA_Block_Diagram.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-13488 aligncenter\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2019\/01\/DMA_Block_Diagram-520x318.png\" alt=\"\" width=\"520\" height=\"318\" \/><\/a><\/p>\n<p>Describing simple test sequences is pretty easy to do with a simple UVM sequence. However, when we need to run scenarios \u2013 for example, multiple transfers in parallel \u2013 our UVM code gets a bit more complex. We can certainly implement UVM sequences that test these types of scenarios, but the directed-random sequence that we would write to manage these conflicts gets complicated in a hurry, and isn\u2019t very flexible or customizable.<\/p>\n<p>With PSS, we provide a bit more information about the relationships between the elements of our scenarios. For example, below are graphical depictions of three operations (PSS <em>actions<\/em>) that we might perform with our DMA engine, along with the data required for each to execute, and the data produced by that operation.<\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2019\/01\/PSS_Actions.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-13489 aligncenter\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2019\/01\/PSS_Actions.png\" alt=\"\" width=\"425\" height=\"204\" \/><\/a><\/p>\n<p>This small amount of additional modeling makes our PSS scenario more transparent, and allows us to customize the <em>rules<\/em> under which our scenario operates instead of modifying the <em>implementation<\/em> of our scenario.<\/p>\n<p>Consider a typical directed-random sequence to run parallel transfers on different channels of a DMA engine:<\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2019\/01\/UVM_Sequence_Code.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-13490 aligncenter\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2019\/01\/UVM_Sequence_Code-520x281.png\" alt=\"\" width=\"520\" height=\"281\" \/><\/a><\/p>\n<p>This is perfectly functional, and uses a queue to ensure that the parallel transfers are on different channels, but how would we constrain this from outside to force the transfer sizes to be different? With UVM, we\u2019d probably have to rewrite the sequence because we can\u2019t place constraints on procedural code.<\/p>\n<p>With PSS, we can place constraints on the behavior (the <em>activity<\/em>) from outside the action. In the code below, <em>parallel_xfer_a<\/em> is the PSS <em>action<\/em> that implements our parallel transfer scenario. Creating a specialized scenario to ensure that the transfer sizes are different on the two parallel transfers is as simple as the code shown below.<\/p>\n<p><a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2019\/01\/PSS_Sequence_Code.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-13491 aligncenter\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/54\/2019\/01\/PSS_Sequence_Code-520x77.png\" alt=\"\" width=\"520\" height=\"77\" \/><\/a><\/p>\n<p>More reusable, more concise, more powerful!<\/p>\n<p><strong>Learn More<\/strong><\/p>\n<p>Like what you see? <em><a href=\"https:\/\/verificationacademy.com\/verification-horizons\/november-2018-volume-14-issue-3\/building-a-better-virtual-sequence-with-portable-stimulus\" target=\"_blank\" rel=\"noopener\">Building a Better Virtual sequence with Portable Stimulus<\/a><\/em><em>,<\/em> my most recent article for Verification Horizons, provides a detailed explanation of how Portable Stimulus simplifies and enhances the modeling process for UVM virtual sequences. Portable Stimulus enables the test intent that drives your UVM environment via virtual sequences to be more flexible, customizable, and reusable \u2013 all without requiring any more code (and quite possible less) than you\u2019re currently writing!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019ve used UVM for verification, you\u2019ve almost certainly worked with virtual sequences. Once our needs for verification stimulus go&#8230;<\/p>\n","protected":false},"author":71642,"featured_media":0,"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":[1],"tags":[],"industry":[],"product":[],"coauthors":[],"class_list":["post-13487","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/posts\/13487","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\/71642"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/comments?post=13487"}],"version-history":[{"count":1,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/posts\/13487\/revisions"}],"predecessor-version":[{"id":19873,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/posts\/13487\/revisions\/19873"}],"wp:attachment":[{"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/media?parent=13487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/categories?post=13487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/tags?post=13487"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/industry?post=13487"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/product?post=13487"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/verificationhorizons\/wp-json\/wp\/v2\/coauthors?post=13487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}