<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Team Specman Blog</title><link>http://www.cadence.com/Community/search/SearchResults.aspx?&amp;u=37305&amp;un=teamspecman&amp;Scope=Blogs</link><description>Search results by user ID 37305</description><dc:language>en-US</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/cadence/community/blogs/37305" /><feedburner:info uri="cadence/community/blogs/37305" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Mode Support for SimVision “Stop Simulation” Button</title><link>http://feedproxy.google.com/~r/cadence/community/blogs/37305/~3/oyOk-ut8YMU/mode-support-for-simvision-stop-simulation-button.aspx</link><pubDate>Wed, 08 May 2013 13:32:00 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:1319900</guid><dc:creator>teamspecman</dc:creator><description>&lt;p&gt;Prior to Incisive Enterprise Simulator (IES) 12.1, clicking the SimVision &amp;quot;Stop Simulation&amp;quot; button would stop the simulation both in an HDL context and in a Specman context if Specman was present in the simulation. To provide&amp;nbsp;better flexibility in the exact place where you want to pause, the &amp;quot;Stop in Specman only&amp;quot; functionality has been introduced. &amp;nbsp;&lt;/p&gt;&lt;p&gt;As of IES 12.1,whenever Specman is present in the simulation, the SimVision &amp;quot;Stop Simulation&amp;quot; button provides a drop-down menu that lets you choose between two switchable modes: &amp;quot;Stop Simulation&amp;quot; (wherever the simulation is now), and &amp;quot;Stop in Specman&amp;quot; (see the following figure).&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/s1.png"&gt;&lt;img src="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/s1.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;SimVision will immediately perform the &amp;quot;Stop&amp;quot; operation in the mode you select, and keep that mode persistent. It will also indicate the selected mode in the button icon and tooltip (see the following figure).&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/s2.png"&gt;&lt;img height="37" width="112" src="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/s2.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Note the &amp;quot;&lt;b&gt;e&lt;/b&gt;&amp;quot; over the button. The &amp;quot;&lt;b&gt;e&lt;/b&gt;&amp;quot; indicates that you selected &amp;quot;Stop Specman&amp;quot; mode. (Had you chosen Stop Simulation, no indicator would appear over the button.)&lt;/p&gt;&lt;p&gt;When you click the &amp;quot;Stop&amp;quot; button while SimVision operates in &amp;quot;Stop Specman&amp;quot; mode, the simulation will stop only when it is in Specman, not before. &lt;/p&gt;&lt;p&gt;To toggle between the Stop Simulation modes, just make your new choice in the dropdown menu.&lt;/p&gt;&lt;p&gt;Note that if you run the simulation without Specman, or invoke standalone Specman, the drop-down menu is absent and the &amp;quot;Stop&amp;quot; button works in &amp;quot;Stop Simulation&amp;quot; mode (see the following figure).&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/s3.png"&gt;&lt;img src="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/s3.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;&amp;nbsp;Alex Chudnovsky&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/cadence/community/blogs/37305/~4/oyOk-ut8YMU" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cadence.com/Community/blogs/fv/archive/2013/05/08/mode-support-for-simvision-stop-simulation-button.aspx</feedburner:origLink></item><item><title>Develop For Debugability – Part II</title><link>http://feedproxy.google.com/~r/cadence/community/blogs/37305/~3/H9KSMFjceHc/develop-for-debugability-part-ii.aspx</link><pubDate>Tue, 23 Apr 2013 13:00:00 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:1319712</guid><dc:creator>teamspecman</dc:creator><description>&lt;b&gt;Looking at Coding Styles for Debug&lt;/b&gt; &lt;p&gt;In this blog post we are going to discuss 3 different cases where&amp;nbsp;coding style can help you debug easier: &lt;/p&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Declarative vs. Sequential Coding &lt;p&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method Call Depth &lt;/p&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Calculating if-else Conditions &lt;h4&gt;&lt;/h4&gt;&lt;p&gt;&lt;b&gt;Declarative vs. Sequential Coding&lt;/b&gt; &lt;/p&gt;&lt;p&gt;When modeling your testbench you will need to write code that describes time-consuming or&amp;nbsp;complex steps of some intended behavior. This will be considered sequential code. &lt;/p&gt;&lt;p&gt;You will also most likely need code that keeps the current state of your object accessible to other objects, as well as tracking these object states over time. This will be considered declarative code.&lt;/p&gt;&lt;p&gt;While developing your testbench you will find yourself asking quite often: &amp;quot;Should I make this declarative or sequential?&amp;quot; As a general guideline, reducing the number of sequential lines of code and keeping as much information as possible in the declarative code will help you to debug a lot quicker.&lt;/p&gt;&lt;p&gt;Specman has a superb data-browser and step-debugger and it is important to keep this in mind. When debugging code you usually want to see where the testbench and the RTL go out of sync. The common approach would be to fire up your failing simulation and set the breakpoints:&lt;/p&gt;&lt;p&gt;Specman&amp;gt; break on error&lt;/p&gt;&lt;p&gt;Specman&amp;gt; break on gen err&lt;/p&gt;&lt;p&gt;This will make your simulation stop on an error and open up the debugger, highlighting the precise line where the error occurred. In an ideal case, you can already tell from your error description what went wrong. This however is rather rare and you should get acquainted with the current state of your testbench and gather all declarative information you can get through Specman&amp;#39;s data browser. This will give you an understanding of where the simulation has headed, and chances that you will understand the error are pretty good if you tracked enough information in your declarative code. If you are fortunate enough you can already resolve the error or at least have a conversation with the person that might have to fix this scenario.&lt;/p&gt;&lt;p&gt;However, there are still quite a few cases where you need to rerun the simulation. Here you will have to dive into the remaining sequential code and do a step-by-step debugging session. Step-debugging is very tedious and will get more cumbersome the more sequential code you have to examine. It gets even more cumbersome if you are relying on a lot of temporary variables inside your methods. &lt;/p&gt;&lt;p&gt;&lt;strong&gt;Method Call Depth&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;While developing sequential code you will be defining and implement a bunch of methods. Crafting methods is usually a straightforward process. In verification you need to think aboiut whether you need a time-consuming method (TCM) or a timeless method. As a general rule, if you are modeling event-based models or checks, then you need a TCM -- otherwise try to stick with a regular, timeless method. &lt;/p&gt;&lt;p&gt;Mostly you will be developing methods for:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Interface and Virtual Sequences&lt;/li&gt;&lt;li&gt;Interface Monitors (not block-level monitors)&lt;/li&gt;&lt;li&gt;Bus-Functional Models (BFMs)&lt;/li&gt;&lt;li&gt;Reference Models&lt;/li&gt;&lt;li&gt;Scoreboards&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Due to this separation of functionality, given by the UVM-&lt;b&gt;&lt;i&gt;e&lt;/i&gt;&lt;/b&gt;, there is already a given blueprint for how to integrate these methods with each other. &lt;/p&gt;&lt;p&gt;One issue that may come from developing methods is that one may feel tempted to create methods for reusability and hence encapsulate even trivial steps in a method and have that method called, instead of typing out these steps. The problem with debugging code that relies heavily on method calls is that you always step into a new method and lose the scope of your method&amp;#39;s callee. &lt;/p&gt;&lt;p&gt;The opposite problem of creating too many methods&amp;nbsp;implements mega-monolithic methods. These kinds of methods are hard to debug and understand as well, since they usually not only carry the context of one specific modeled aspect.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Pre-Calculating if-else Conditions&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The essence of code execution is handling conditional branching constructs. Generally there is nothing wrong about simply writing a condition into your if-else actions. However, complex Boolean expressions should be evaluated before entering the expression query. By creating a temporary variable and assigning a Boolean evaluation to it, you will gain two advantages:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Create a meaningful variable name&lt;/li&gt;&lt;li&gt;Break on the if-execution with the condition already evaluated&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;To read part 1 of this blog series, &lt;a href="http://www.cadence.com/Community/blogs/fv/archive/2013/04/08/develop-for-debugability-part-1.aspx?postID=1319710"&gt;click here.&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;Daniel Bayer&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/cadence/community/blogs/37305/~4/H9KSMFjceHc" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cadence.com/Community/blogs/fv/archive/2013/04/23/develop-for-debugability-part-ii.aspx</feedburner:origLink></item><item><title>Develop for Debugability – Part 1</title><link>http://feedproxy.google.com/~r/cadence/community/blogs/37305/~3/4Zh0tY0DB1E/develop-for-debugability-part-1.aspx</link><pubDate>Mon, 08 Apr 2013 14:00:00 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:1319710</guid><dc:creator>teamspecman</dc:creator><description>&lt;p class="MsoNormal"&gt;Debugging is the most time-critical activity of any verification engineer. Finding a bug is very often a combination of having a good hunch, experience, and the quality of testbench code that you need to analyze. Since having a good hunch and experience is something everyone needs to acquire for themselves, I am going to focus on potential code optimizations that help reduce debug time.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;i&gt;Encapsulate your Aspects&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;As in any other object-oriented language, modeling should be a planned rather than an ad-hoc process. However, as a verification engineer you are heavily reliant on others to help you in the planning process to develop your testbench. As such, you will quite often be forced to do ad-hoc programming to model a new requirement, or rewrite already existing code to meet a slight change in an already existing requirement. The UVM-&lt;b&gt;&lt;i&gt;e&lt;/i&gt;&lt;/b&gt; guidelines already provide a very solid basis; however even within those guidelines, your scoreboard can be very prone to becoming a dumpster for anything that you have to do on an ad-hoc basis.&lt;/p&gt;&lt;p&gt;You might be fine with just using your scoreboard for modeling all the RTL-to-testbench output checking. However, your testbench might have to handle more complex input-to-output transformations to provide the testbench output. This is where using the scoreboard as a dumpster for anything you can think of is a bad idea, and you should think about using a dedicated reference model to provide a well encapsulated input-to-output transformation or even an input predictor, based on the output you received.&lt;/p&gt;&lt;p&gt;As an &lt;b&gt;&lt;i&gt;e&lt;/i&gt;&lt;/b&gt; user you are in luck, because it is very easy to perform ad-hoc programming in &lt;b&gt;&lt;i&gt;e&lt;/i&gt;&lt;/b&gt; and avoid &amp;quot;the dumpster.&amp;quot; In a series of steps, I am going to guide you through how to integrate your reference model into your block-level monitor unit. &lt;/p&gt;&lt;ol&gt;&lt;li&gt;Declare your scoreboard&lt;/li&gt;&lt;/ol&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&amp;lt;&amp;rsquo;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:gray;font-size:8pt;"&gt;// This is just a place-holder for your scoreboard&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;unit&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt; my_scbd_u &lt;b&gt;like&lt;/b&gt; uvm_base_unit {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:gray;"&gt;// Place-holder method for input-to-output transformation&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;transform_received_to_expected( src_tr: src_prot_tr_s ): target_prot_tr_s is &lt;b&gt;empty&lt;/b&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&amp;lsquo;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;2.&lt;span style="font:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;Instantiate your scoreboard in the Block-Level Monitor&lt;/p&gt;&lt;/blockquote&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&amp;lt;&amp;rsquo;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;unit&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt; my_block_monitor_u &lt;b&gt;like&lt;/b&gt; uvm_base_unit {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:gray;"&gt;// the scoreboard instance&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;scbd: my_scbd_u &lt;b&gt;is instance&lt;/b&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;extend&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt; my_scbd_u {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:gray;"&gt;// reference, do not generate&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;!p_block_mon: my_block_monitor_u;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;connect_pointers() is also&lt;/b&gt; {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;p_block_mon = &lt;b&gt;get_enclosing_unit&lt;/b&gt;( my_block_monitor_u );&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&amp;lsquo;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;3.&lt;span style="font:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;Create your reference model aspect feature and instantiate it in the monitor&lt;/p&gt;&lt;/blockquote&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&amp;lt;&amp;rsquo;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;unit&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt; my_model_aspect_a_u &lt;b&gt;like&lt;/b&gt; uvm_base_unit {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:gray;"&gt;// reference to your monitor unit&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;!p_block_mon:&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;my_block_monitor_u;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color:gray;"&gt;// All your fields, events, methods etc go in here&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;color:gray;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// ... &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;my_transformation_algorithm( src_tr: src_prot_tr_s ): target_prot_tr_s &lt;b&gt;is&lt;/b&gt; {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:gray;"&gt;// algorithm that models the transformation from input to output&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;connect_pointers() is also&lt;/b&gt; {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;p_block_mon = get_enclosing_unit( my_block_monitor_u );&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:gray;"&gt;// Add a name for your model&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;short_name(): string is also&lt;/b&gt; {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;result&lt;/b&gt; = &lt;i&gt;&lt;span style="color:#0070c0;"&gt;&amp;rdquo;ASPECT_A&amp;rdquo;&lt;/span&gt;&lt;/i&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;extend&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt; my_block_monitor_u {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;model_aspect_a: my_model_aspect_a_u &lt;b&gt;is instance&lt;/b&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&amp;lsquo;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span&gt;4.&lt;span style="font:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;Integrate the first model aspect into the scoreboard&lt;/p&gt;&lt;/blockquote&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&amp;lt;&amp;rsquo;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;extend&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt; my_scbd_u {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:gray;"&gt;// Reference the aspect&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;!p_model_aspect_a: my_model_aspect_a_u;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:gray;"&gt;// Add the transformation hook&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;transform_received_to_expected( src_tr: src_prot_tr ): target_prot_tr &lt;b&gt;is&lt;/b&gt; {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;result&lt;/b&gt; = p_model_aspect_a.my_transformation_algorithm( src_tr );&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;connect_pointers() is also&lt;/b&gt; {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;p_model_aspect_a = p_block_mon.model_aspect_a;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&amp;lsquo;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span&gt;5.&lt;span style="font:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; Adding more aspects to the verification environment. &lt;/p&gt;&lt;/blockquote&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&amp;lt;&amp;rsquo;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;extend&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt; my_scbd_u {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:gray;"&gt;// Reference another aspect&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;!p_model_aspect_b: my_model_aspect_b_u;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:gray;"&gt;// Add the transformation hook for another model aspect&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;transform_received_to_expected( src_tr: src_prot_tr ): target_prot_tr &lt;b&gt;is&lt;/b&gt; &lt;b&gt;also&lt;/b&gt; {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color:gray;"&gt;// This could be an example of a filter that alters or removes transactions&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;result&lt;/b&gt; = p_model_aspect_b.apply_filters(&lt;span&gt;&amp;nbsp; &lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;connect_pointers() is also&lt;/b&gt; {&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;p_model_aspect_b = p_block_mon.model_aspect_b;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;};&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNoSpacing"&gt;&lt;span style="font-family:&amp;#39;Courier New&amp;#39;;font-size:8pt;"&gt;&amp;lsquo;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;In this flow, steps 1 through 4 have to be done once, and step 5 is simply just extending your transformation hook method with any additional algorithms you need to add to your scoreboard.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal"&gt;By following these steps as a guideline, you can quickly change reference model aspects to your scoreboard without creating a dumpster and this will help you debug any issues tremendously. Don&amp;rsquo;t forget to extend the short_name() method in your units for your messaging! &lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:11pt;"&gt;Daniel Bayer&lt;/span&gt;&lt;/i&gt;&lt;/b&gt; &lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/cadence/community/blogs/37305/~4/4Zh0tY0DB1E" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cadence.com/Community/blogs/fv/archive/2013/04/08/develop-for-debugability-part-1.aspx</feedburner:origLink></item><item><title>Specman: Getting Source Information on Macros</title><link>http://feedproxy.google.com/~r/cadence/community/blogs/37305/~3/sIMnakJ5yYc/getting-source-information-on-macros.aspx</link><pubDate>Tue, 12 Mar 2013 23:31:00 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:1318984</guid><dc:creator>teamspecman</dc:creator><description>&lt;p&gt;When you write a &lt;b&gt;define-as&lt;/b&gt; or &lt;b&gt;define-as-computed&lt;/b&gt; &lt;i&gt;e&lt;/i&gt; macro, you sometimes need the replacement code to contain or to depend on the source information regarding the specific macro call, including the source module and the source line number. &lt;/p&gt;&lt;p&gt;For example, a macro may need to print source information, or it may need to create different code when used in one module than it needs to create when used in other modules. &lt;/p&gt;&lt;p&gt;You can achieve this as follows.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Define-as macro&lt;/b&gt;&lt;/p&gt;&lt;p&gt;In a &lt;b&gt;define-as&lt;/b&gt; macro, you can use the following two special kinds of replacement terms inside the replacement block:&lt;/p&gt;&lt;table cellpadding="0" cellspacing="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;p&gt;&lt;b&gt;&amp;lt;current_line_num&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;This is replaced with the decimal numeric representation of the source line number in which the macro is called.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;p&gt;&lt;b&gt;&amp;lt;current_module_name&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;This is replaced with the name of the module in which the macro is called.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;For example, the following macro modifies the given left hand side expression (such as a field or a variable) to the given value, and prints an informational message reporting this change.&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;lt;&amp;#39;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;define &amp;lt;my&amp;#39;action&amp;gt; &amp;quot;modify_and_print &amp;lt;field&amp;#39;exp&amp;gt; &amp;lt;value&amp;#39;exp&amp;gt;&amp;quot; as {&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;field&amp;#39;exp&amp;gt; = &amp;lt;value&amp;#39;exp&amp;gt;;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; out(&amp;quot;*** The value of &amp;lt;field&amp;#39;exp&amp;gt; was changed to &amp;quot;, &amp;lt;value&amp;#39;exp&amp;gt;,&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot; at line &amp;lt;current_line_num&amp;gt; in @&amp;lt;current_module_name&amp;gt;&amp;quot;);&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;};&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&amp;lsquo;&amp;gt;&lt;/p&gt;&lt;p&gt;Assume the following code is then written in a module called my_module.e:&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;lt;&amp;#39;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;extend sys {&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; !x: int;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run() is also {&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; modify_and_print x 10;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;};&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;lsquo;&amp;gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;This code will assign the value 10 to the field x, and will print the following output:&lt;/p&gt;&lt;p&gt;*** The value of x was changed to 10 at line 5 in @my_module&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Define-as-computed macro&lt;/b&gt;&lt;/p&gt;&lt;p&gt;In a &lt;b&gt;define-as-computed&lt;/b&gt; macro, the following two pre-defined routines can be used to query the current source line number and the current module.&lt;/p&gt;&lt;table cellpadding="0" cellspacing="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;p&gt;&lt;b&gt;get_current_line_num(): int&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;This routine returns the source line number in which the macro is called.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;p&gt;&lt;b&gt;get_current_module(): rf_module&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;This routine returns the reflection representation of the module in which the macro is called.&lt;b&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;To get the module name string, similarly to &amp;lt;current_module_name&amp;gt; in define-as macros, use the get_name() method of rf_module.&lt;/p&gt;&lt;p&gt;For example, the following macro adds a new field of type int to the struct in the context of which it is called. The field name is constructed from the current module name and line number. However, if the module name has the &amp;quot;_xxx&amp;quot; suffix, no field is added.&lt;/p&gt;&lt;p&gt;&amp;lt;&amp;#39;&lt;/p&gt;&lt;p&gt;&lt;em&gt;define &amp;lt;my_field&amp;#39;struct_member&amp;gt; &amp;quot;special_field&amp;quot; as computed {&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var m_name: string = get_current_module().get_name();&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if m_name !~ &amp;quot;/_xxx$/&amp;quot; then {&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = append(&amp;quot;f_&amp;quot;, m_name, &amp;quot;_&amp;quot;,&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get_current_line_num(), &amp;quot;: int&amp;quot;);&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;};&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&amp;lsquo;&amp;gt;&lt;/p&gt;&lt;p&gt;The following code, if written in a module called some_module.e, adds two integer fields to sys: f_some_module_3 and f_some_module_4:&lt;/p&gt;&lt;p&gt;&amp;lt;&amp;#39;&lt;/p&gt;&lt;p&gt;&lt;em&gt;extend sys {&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; special_field;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; special_field;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;};&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;lsquo;&amp;gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Note however that if the same code is written in a module called some_module_xxx.e, nothing is done.&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Yuri Tsoglin&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;e Language team, Specman R&amp;amp;D&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/cadence/community/blogs/37305/~4/sIMnakJ5yYc" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cadence.com/Community/blogs/fv/archive/2013/03/12/getting-source-information-on-macros.aspx</feedburner:origLink></item><item><title>Using the ‘restore -append_logs' Feature</title><link>http://feedproxy.google.com/~r/cadence/community/blogs/37305/~3/2SLtkqGnBuU/using-the-restore-append-logs-feature.aspx</link><pubDate>Tue, 12 Feb 2013 14:00:00 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:1318987</guid><dc:creator>teamspecman</dc:creator><description>&lt;p&gt;As described in &lt;a target="_blank" href="http://www.cadence.com/Community/blogs/fv/archive/2011/03/01/specman-advanced-option-application-note.aspx"&gt;Specman Advanced Option appnote&lt;/a&gt;, Specman Elite supports dynamic load and reseeding. This allows the user to run the simulation up to a certain point (often&amp;nbsp;until right after reset) and save the simulation. The user can then restore the simulation and run many different tests either by changing the random seed (reseeding) or by loading additional &lt;b&gt;&lt;i&gt;e&lt;/i&gt;&lt;/b&gt; files which will change the test, e.g., adding constraints (dynamic load).&lt;/p&gt;&lt;p&gt;But many customers who use this new methodology have come across a problem. If a DUT error occurs in one of the new runs, and there is a need to debug the failure, usually the first step is to check the various log files. However, with this methodology we only have log files from the restore point and later; anything written to the log file from the original run until the save is lost. So we don&amp;#39;t actually have the full log file, and this can make debugging more difficult.&lt;/p&gt;&lt;p&gt;To avoid this problem and be able to see the full log file, the user must first save the simulation with the log files (do not worry about the size, the file is compressed). Then, when restoring the simulation, the user must add a switch the tell Specman to append the current log files to the previously saved ones. &lt;/p&gt;&lt;p&gt;To support this capability, the following switches were added:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Specman: &lt;ul&gt;&lt;li&gt;The save command will have an additional switch: -with_logs&lt;/li&gt;&lt;li&gt;The restore command will have an additional switch: -append_logs&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Ncsim: &lt;ul&gt;&lt;li&gt;The save command will have an additional switch: -snwithlogs&lt;/li&gt;&lt;li&gt;The restart command will have an additional switch: -snlogappend&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Irun: &lt;ul&gt;&lt;li&gt;The command line will have an additional switch: -snlogappend&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;So, how do you use this feature? We will show you, using the basic xor example which we shortened to 2 operations. If we run using the command:&lt;/p&gt;&lt;p&gt;&lt;em&gt;irun xor.v -snload xor_verify.e -exit&lt;/em&gt;&lt;/p&gt;&lt;p&gt;the Specman log file will look like this:&lt;/p&gt;&lt;p&gt;&lt;em&gt;Starting the test ...&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Running the test ...&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Running should now be initiated from the simulator side&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; it = operation-@7: operation&amp;nbsp;&amp;nbsp; of unit: sys &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------------------------------------------&amp;nbsp; @xor_verify&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %a:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %b:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !result_from_dut:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; p_out$ = 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; (it.a ^ it.b) = 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; sys.time = 150&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; it = operation-@8: operation&amp;nbsp;&amp;nbsp; of unit: sys &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------------------------------------------&amp;nbsp; @xor_verify&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %a:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %b:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !result_from_dut:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; p_out$ = 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; (it.a ^ it.b) = 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; sys.time = 350&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Calling stop_run() from at line 45 in @xor_verify.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Last specman tick - stop_run() was called&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Normal stop - stop_run() is completed&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Checking the test ...&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Checking is complete - 0 DUT errors, 0 DUT warnings.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Now let&amp;#39;s run the example with save and restore. First we&amp;#39;ll do the save:&lt;/p&gt;&lt;p&gt;&lt;em&gt;irun xor.v -snload xor_verify.e -tcl&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;ncsim&amp;gt; run 200ns&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;ncsim&amp;gt; save foo -snwithlogs&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;ncsim&amp;gt; exit&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Now, if we run using the command:&lt;/p&gt;&lt;p&gt;&lt;em&gt;irun -r foo -exit&lt;/em&gt;&lt;/p&gt;&lt;p&gt;the Specman log will contain:&lt;/p&gt;&lt;p&gt;&lt;em&gt;Restored Specman state INCA_libs/worklib/foo/v/savedir/sn_save.esv&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; it = operation-@8: operation&amp;nbsp;&amp;nbsp; of unit: sys &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------------------------------------------&amp;nbsp; @xor_verify&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %a:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %b:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !result_from_dut:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; p_out$ = 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; (it.a ^ it.b) = 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; sys.time = 350&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Calling stop_run() from at line 45 in @xor_verify.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Last specman tick - stop_run() was called&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Normal stop - stop_run() is completed&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Checking the test ...&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Checking is complete - 0 DUT errors, 0 DUT warnings.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;However, if we run using the command:&lt;/p&gt;&lt;p&gt;irun -r foo -snlogappend -exit&lt;/p&gt;&lt;p&gt;The Specman log will contain:&lt;/p&gt;&lt;p&gt;&lt;em&gt;Starting the test ...&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Running the test ...&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Running should now be initiated from the simulator side&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; it = operation-@7: operation&amp;nbsp;&amp;nbsp; of unit: sys &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------------------------------------------&amp;nbsp; @xor_verify&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %a:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %b:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !result_from_dut:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; p_out$ = 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; (it.a ^ it.b) = 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; sys.time = 150&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Restored Specman state INCA_libs/worklib/foo/v/savedir/sn_save.esv&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; it = operation-@8: operation&amp;nbsp;&amp;nbsp; of unit: sys &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------------------------------------------&amp;nbsp; @xor_verify&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %a:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %b:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !result_from_dut:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; p_out$ = 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; (it.a ^ it.b) = 0&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp; sys.time = 350&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Calling stop_run() from at line 45 in @xor_verify.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Last specman tick - stop_run() was called&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Normal stop - stop_run() is completed&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Checking the test ...&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Checking is complete - 0 DUT errors, 0 DUT warnings.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;We see that in this latest run the log file was appended to the log file of the run of the save command.&lt;/p&gt;&lt;p&gt;It is important to note that only Specman log files are affected by this switch; irun and ncsim log files are not affected.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Avraham Bloch&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Specman R&amp;amp;D &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;span style="font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:10pt;"&gt;P.S. Reminder: To discuss this feature, Specman in general, and the new Incisive Debug Analyzer, R&amp;amp;D&amp;rsquo;s Nadav Chazan will be at DVCon Feb. 26-28, 2013.&amp;nbsp; Ask for him by name in the booth, or sign-up for his tutorial on Thursday February 28 on &amp;ldquo;Fast Track Your UVM Debug Productivity with Simulation and Acceleration&amp;rdquo;.&amp;nbsp; More info: &lt;a href="http://dvcon.org/2013_event_details?id=144-5-T"&gt;&lt;font color="#0000ff"&gt;http://dvcon.org/2013_event_details?id=144-5-T&lt;/font&gt;&lt;/a&gt;&lt;/span&gt;&lt;img src="http://feeds.feedburner.com/~r/cadence/community/blogs/37305/~4/2SLtkqGnBuU" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cadence.com/Community/blogs/fv/archive/2013/02/12/using-the-restore-append-logs-feature.aspx</feedburner:origLink></item><item><title>DVCon 2013 for the Specmaniac</title><link>http://feedproxy.google.com/~r/cadence/community/blogs/37305/~3/2bMpqeA0MuY/dvcon-2013-for-the-specmaniac.aspx</link><pubDate>Fri, 08 Feb 2013 00:09:00 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:1319579</guid><dc:creator>teamspecman</dc:creator><description>&lt;p&gt;At the upcoming&amp;nbsp;&lt;a href="http://www.dvcon.org/"&gt;DVCon (in San Jose, CA February 25-28)&lt;/a&gt;, Cadence will cover all aspects of our verification technologies and methodologies (full list of Cadence-sponsored events is&amp;nbsp;&lt;a href="http://www.cadence.com/cadence/events/Pages/event.aspx?eventid=744"&gt;here&lt;/a&gt;).&amp;nbsp; Of course, Team Specman cannot resist drawing your attention to the many activities that will feature Specman and &lt;em&gt;&lt;strong&gt;e&lt;/strong&gt;&lt;/em&gt; language-related content, or be of general relevance to Specmaniacs.&amp;nbsp; Hence, if you are going to the conference, please consider printing out the following &amp;quot;DVCon 2013 Guide for the Specmaniac&amp;quot;.&lt;/p&gt;&lt;p&gt;&lt;b&gt;* Specman-centric posters at the poster session on Tuesday from 10:30-11:30am&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/Joe_Hupcey_III/JH3_020813_1X250.jpg"&gt;&lt;img height="167" width="250" src="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/Joe_Hupcey_III/JH3_020813_1X250.jpg" align="left" hspace="10" border="0" alt="" /&gt;&lt;/a&gt;1P.21&amp;nbsp;&amp;nbsp; &amp;quot;Taming the Beast: A Smart Generation of Design Attributes (Parameters) for Verification Closure using Specman&amp;quot;, presented by Meirav Nitzan of Xilinx, Inc., with co-authors Yael Kinderman and Efrat Gavish of Cadence R&amp;amp;D.&lt;/p&gt;&lt;p&gt;1P.25&amp;nbsp;&amp;nbsp; &amp;quot;Maximize Vertical Reuse, Building Module to System Verification Environments with UVM e&amp;quot;, presented by Horace Chan of PMC-Sierra, Inc., with co-authors Brian Vandegriend and &amp;nbsp;Deepali Joshi also of PMC-Sierra, Inc., and Corey Goss, a Solutions Architect in Cadence R&amp;amp;D.&lt;/p&gt;&lt;p&gt;The best part about the poster session is you can easily interact with the authors - asking them questions on the fly in a way that would be awkward if they were presenting the paper in a lecture format.&lt;/p&gt;&lt;p&gt;&lt;b&gt;* The Cadence booth at the free expo on Tuesday &amp;amp; Wednesday Feb. 26-27, 3:30- 6:30pm each day&lt;/b&gt;&lt;/p&gt;&lt;p&gt;As always, Specman technology is directly or indirectly a cornerstone of the various demos -- UVM, Verification IP, metric-driven verification &amp;amp; Enterprise Manager updates, ESL &amp;amp; TLM updates, etc.&amp;nbsp; This year we will be showcasing new automated debug technology - the Incisive Debug Analyzer - that works great with e/Specman testbenches. Even better: R&amp;amp;D leader Nadav Chazan will be present to walk through the tool with you and answer your questions.&amp;nbsp; Of course, at a relatively small show like DVCon there is often the opportunity to digress from the primary demo(s) and discuss Specman technology updates in specific - Nadav and other members of Team Specman will be happy to give you the highlights of the new capabilities release in Specman 12.2 and more.&lt;/p&gt;&lt;p&gt;&lt;b&gt;* Thursday morning Feb. 28 tutorial (8:30am-Noon), &amp;quot;Fast Track Your UVM Debug Productivity with Simulation and Acceleration&amp;quot;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;In this comprehensive tutorial, Specman R&amp;amp;D&amp;#39;s Nadav Chazan along with hardware assisted verification expert Devinder Gill will show how you can reduce debug turnaround time of class-based, software-like environments (i.e. like an e/AOP testbench).&amp;nbsp; Specifically, they will show how to leverage low latency interactive debug techniques to improve debug efficiency, where the user has a much broader range of capabilities at their disposal.&amp;nbsp; This includes interactive features such as forward and backward source code single-stepping, searching for arbitrary values and types, and automated go-to-cause analysis.&amp;nbsp;Come prepared to take plenty of notes because Nadav and Devinder will walk through many detailed examples.&lt;/p&gt;&lt;p&gt;&lt;b&gt;* Bonus: A free lunch on &amp;quot;Best Practices in Verification Planning&amp;quot; Wednesday Feb. 27!&lt;/b&gt;&lt;/p&gt;&lt;p&gt;On the Wednesday of DVCon Cadence is hosting an&amp;nbsp;&lt;a href="http://dvcon.org/2013_event_details?id=144-252"&gt;expert panel on &amp;quot;Best Practices in Verification Planning&amp;quot;&lt;/a&gt;.&amp;nbsp; Panel moderator, R&amp;amp;D Fellow Mike Stellfox (yes - *that* Mike Stellfox who&amp;#39;s been with the team since Verisity days), will kickoff this important discussion on how creating and executing effective verification plans can be a challenging mix of art and science that can go sideways despite the best efforts of engineers and managers.&amp;nbsp; Note that this won&amp;#39;t be confined to RTL verification planning only -- the panel also includes experts on analog-mixed signal verification and formal analysis.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/Joe_Hupcey_III/JH3_020813_2.jpg"&gt;&lt;img src="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/Joe_Hupcey_III/JH3_020813_2.jpg" border="0" alt="" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Panel discussion at DVCon 2012&lt;/em&gt;&lt;/p&gt;&lt;p&gt;We look forward to seeing you in-person soon!&lt;/p&gt;&lt;p&gt;Team Specman&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Reference Links&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.dvcon.org/"&gt;The official DVCon website&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.cadence.com/cadence/events/Pages/event.aspx?eventid=744"&gt;Comprehensive list of Cadence-sponsored events &amp;amp; papers&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.flickr.com/photos/24605532@N08/sets/72157629185535384/"&gt;Images from last year&amp;#39;s show to give you an idea of what it&amp;#39;s like, in case you have never been to a DVCon before.&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.youtube.com/playlist?list=PL66DB89BCDB6E841A"&gt;DVCon 2012 video playlist&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://youtu.be/qEzIUX9VvOc"&gt;60 second highlights video from DVCon 2012&lt;/a&gt;&lt;/p&gt;&lt;p&gt;On Twitter:&amp;nbsp;&lt;a href="http://twitter.com/teamspecman"&gt;http://twitter.com/teamspecman&lt;/a&gt;, @teamspecman&lt;/p&gt;&lt;p&gt;And on Facebook: &lt;a href="http://www.facebook.com/teamspecman"&gt;http://www.facebook.com/teamspecman&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/cadence/community/blogs/37305/~4/2bMpqeA0MuY" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cadence.com/Community/blogs/fv/archive/2013/02/07/dvcon-2013-for-the-specmaniac.aspx</feedburner:origLink></item><item><title>Specman: An Assumed Generation Issue and its Real Root Cause</title><link>http://feedproxy.google.com/~r/cadence/community/blogs/37305/~3/kg0GHmv7Vw4/an-assumed-generation-issue-and-its-real-root-cause.aspx</link><pubDate>Mon, 21 Jan 2013 16:00:00 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:1318763</guid><dc:creator>teamspecman</dc:creator><description>&lt;p&gt;&lt;a href="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/Hans_code.jpg"&gt;&lt;/a&gt;Random generation is always a complex task, and differences in results are usually very hard to debug. Besides, generation misbehavior always rings many bells in R&amp;amp;D :-)&lt;/p&gt;&lt;p&gt;A customer reported a random stability issue, explaining that the generator (IntelliGen) generated different values with the same seed. One simulation was started from vManager, the other in a Unix shell, and they ran in different run modes (compiled vs. interpreted).&lt;/p&gt;&lt;p&gt;Looking into the (quite complex) environment, it turned out that the beginning of the simulation was identical, but as time advanced the results started to differ. I assume some of you have experienced similar behavior in the past.&lt;/p&gt;&lt;p&gt;A first look revealed that complex list manipulations were performed in many levels of nested method calls. Each list -- a list of units -- was manipulated by several list methods (sort, add, unique, etc.). The results were printed out to the screen where, after a while, the lists started to differ.&lt;/p&gt;&lt;p&gt;So an idea came to mind: The problem is probably not a generation issue, as the static generation was identical in all cases; rather it is a runtime issue, most likely caused by list manipulation. But how could the way the simulation was launched or the run-mode be responsible for the differences? &lt;/p&gt;&lt;p&gt;With no alternative, we proceeded to debug through the source code step by step, and examined the list after every manipulation. The complexity and deep nesting of the code (there were even recursive methods that touched those lists), resulted in about&amp;nbsp;two days of painstaking analysis without finding a difference. Then, we hit pay dirt -- we came across the construct where the lists began to differ. Below is the sample code:&lt;a href="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/Untitled.png"&gt;&lt;img src="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/Untitled.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;a href="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/Hans_code.jpg"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;So where is the problem? The code identified that the list of units that was sorted, but did not identify the specific field used for sorting -- the argument (it) referred to the unit itself. &lt;/p&gt;&lt;p&gt;Looking up the sort() method in the Incisive/Specman documentation, we found the following:&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/Hans_doc.png"&gt;&lt;img src="http://www.cadence.com/Community/CSSharedFiles/blogs/fv/Hans_doc.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The Note in the description seemed to suggest a possible clue.&lt;/p&gt;&lt;p&gt;A scan of the log files showed that the vManager run started a garbage collection at some point before the sorting action, and that the plain Specman simulation logs did not show this garbage collection. This difference in behavior was the result of different memory settings between different simulation runs.&lt;/p&gt;&lt;p&gt;The bottom line: Garbage collections can change the physical memory address of the units in the list, which can affect the sorting of these addresses before and after such a memory operation.&lt;/p&gt;&lt;p&gt;Summary:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&amp;nbsp;The root cause for the problem was that the sorting statement contained a bad argument (the result of a copy and paste error) -- the construct was taken from code where it worked perfectly fine with a list of strings. &lt;/li&gt;&lt;li&gt;&amp;nbsp;The problem was not generation-related, even if it looked that way in the first place.&lt;/li&gt;&lt;li&gt;&amp;nbsp;More importantly, we uncovered usage of a problematic construct: The user based the sort on the physical address. This should be avoided even if garbage collection is not performed (and all the more so when garbage collection is performed). &lt;/li&gt;&lt;li&gt;&amp;nbsp;Uncovering such an issue is a perfect task for the Specman Linter. Cadence intends to enhance the linter&amp;#39;s capabilities in that direction.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;em&gt;Hans Zander&lt;/em&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/cadence/community/blogs/37305/~4/kg0GHmv7Vw4" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cadence.com/Community/blogs/fv/archive/2013/01/21/an-assumed-generation-issue-and-its-real-root-cause.aspx</feedburner:origLink></item><item><title>Specman: Determining a Good Value for optimal_process_size</title><link>http://feedproxy.google.com/~r/cadence/community/blogs/37305/~3/v_5Ul0e3mS8/determining-a-good-value-for-optimal-process-size.aspx</link><pubDate>Tue, 01 Jan 2013 16:00:00 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:1317496</guid><dc:creator>teamspecman</dc:creator><description>&lt;p&gt;Specman&amp;#39;s Automatic GC Settings mechanism is aimed at eliminating the need for users to control the parameters which determine each Garbage Collection&amp;#39;s behavior. &lt;/p&gt;&lt;p&gt;Setting &lt;b&gt;config mem -automatic_gc_settings=STANDARD&lt;/b&gt; tells Specman to calculate all the parameters, to ensure that Specman&amp;#39;s memory management system works in an optimal way.&lt;/p&gt;&lt;p&gt;The only parameter that is left for the user to play with is &lt;b&gt;the -optimal_process_size&lt;/b&gt; (aka OPS). The importance of this parameter is that many of the other automatically calculated parameters are its derivatives. To set this parameter optimally, one should ask the following question:&lt;/p&gt;&lt;p align="center"&gt;&lt;b&gt;WHAT SIZE MEMORY IMAGE DO I WANT MY PROCESS TO HAVE&lt;/b&gt;?&lt;/p&gt;&lt;p&gt;Let&amp;#39;s say, for instance, that you have 20 GB free on your machine, and you have 2 simulations running in parallel. The optimal process size for each simulation would be 10GB, so you just assign OPS a value of 10GB.&lt;/p&gt;&lt;p&gt;Now, what if you don&amp;#39;t know? Or don&amp;#39;t care?&lt;/p&gt;&lt;p&gt;Specman then sets this value itself, based on the amount of available RAM on the machine on which the Specman process is to run on. Note - This can be quite a big number. It might make Specman run fast, (hardly perform GCs,) but it&amp;nbsp;consumes lots of memory. The reasoning is that if the user does not care about process size, Specman will use the maximum available memory in order to create a smooth run.&lt;/p&gt;&lt;p&gt;Realistically though, most users do care about their process size and would want to limit it on one hand, while giving it enough liberty to avoid memory issues on the other. So, is there a good way to calculate efficient OPS, one that will ensure that the machine only uses as much resources as needed?&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;Let&amp;#39;s start by saying it is not possible to know exactly how memory settings will affect a program run, if not already measured on EXACTLY the same run. Nevertheless, if we have such knowledge on similar runs, it may give us some hints. We can collect run information and analyze it in a way that can help us understand how efficiently the environment runs and if we need to take some actions to achieve fewer OOM (Out Of Memory) failures, better performance, more effective memory utilization, etc. However, when dealing with batch tests, choosing a specific test &amp;quot;as representative&amp;quot; for purposes of measurement can be as difficult as choosing specific memory settings, so the information must be collected on a representative group of runs, or on all the batch runs.&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;So what exactly do we need to search for in our log file, in order to calculate the optimal size for our environment? Let&amp;#39;s first introduce three concepts:&lt;/p&gt;&lt;p&gt;1)&amp;nbsp; &amp;quot;Static&amp;quot; (Live) Specman heap - this is the basic size of Specman dynamic memory that mostly belongs to persistent objects and generally remains stable during the simulation &lt;/p&gt;&lt;p&gt;2) &amp;quot;Static&amp;quot; non-Specman heap - Same as 1) but for all the rest of the players in the process&lt;/p&gt;&lt;p&gt;3) We would also like to define the memory requirement for the process during copy GC (since whilst Copy GC is operating, we are most likely to hit the peak of the memory consumption, as Specman might double its memory to perform the GC.&lt;/p&gt;&lt;p align="center"&gt;&amp;nbsp;&lt;b&gt;(2 X Maximum SN live heap) + (Garbage) + (Maximum non-SN heap)&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;Collecting the Relevant Data&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Now in order to sample these values, we will need to collect the relevant memory and garbage collection related information. To collect this information, we need to set the following configuration parameters in our pilot simulation:&lt;/p&gt;&lt;ul class="unIndentedList"&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;print_process_size=TRUE &lt;/i&gt;&lt;/b&gt;- Prints the entire process size in three stages for every GC: Before, At peak time, and After&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;show_mem_raw=TRUE &lt;/i&gt;&lt;/b&gt;- Prints Specman memory consumption, including top consumers&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;print_debug_msgs=TRUE&lt;/i&gt;&lt;/b&gt; - Prints messages, including the exact phases of GC&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;setenv SPECMAN_MEMORY_ACCOUNTING&lt;/i&gt;&lt;/b&gt; - Gives us information about Specman&amp;#39;s Dynamic allocation.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;Finding a value for Specman Live heap&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Analyzing the result log, let&amp;#39;s estimate the static Specman heap first. There are three printouts that can help us determine this value:&lt;/p&gt;&lt;p&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last line in Copy (or disk based) GC printout; which is the new process size &amp;quot;after GC&amp;quot;: &lt;/p&gt;&lt;p&gt;&amp;quot;Done - new size is nnn bytes&amp;quot;&lt;/p&gt;&lt;p&gt;For example:&lt;/p&gt;&lt;p&gt;MEMORY_DEBUG: process size after GC:&lt;/p&gt;&lt;p&gt;MEMORY_DEBUG:&amp;nbsp;&amp;nbsp; VSIZE = 1990940, RSS = 1792688&lt;/p&gt;&lt;p&gt;&lt;b&gt;Done - new size is 1804478256 bytes.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;Total size of reachable data&amp;quot; line in show mem &amp;quot;Process sizes&amp;quot; table&lt;/p&gt;&lt;p&gt;For example:&lt;/p&gt;&lt;p&gt;Total allocated size of numerics:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12176 +&lt;/p&gt;&lt;p&gt;Total allocated size of structs:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 34568K&lt;/p&gt;&lt;p&gt;&lt;b&gt;Total size of reachable data:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1719M +&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Total size in free blocks:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 343K +&lt;/p&gt;&lt;p&gt;Total size of unreachable data:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 375M&lt;/p&gt;&lt;p&gt;Heap size:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2096M&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last line in OTF GC printout: &amp;quot;Done - total size of reachable data is nnn...&amp;quot;&lt;/p&gt;&lt;p&gt;For example:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;p&gt;MEMORY_DEBUG: process size at the peak memory usage:&lt;/p&gt;&lt;p&gt;MEMORY_DEBUG:&amp;nbsp;&amp;nbsp; VSIZE = 3653716, RSS = 3514240&lt;/p&gt;&lt;p&gt;&lt;b&gt;Done - total size of reachable data is 1,096,707,344 bytes (plus 2,417,146,640 free). &lt;/b&gt;&lt;/p&gt;&lt;p&gt;There will be several instances of those printings (the same number of GCs that you had in the simulation), and we need to choose the highest value that was printed. Printout no. 1 above should be most correct, and we should take the value from it, but the others should also be considered (if show mem is used and OTF GC is encountered).&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;Finding a value for Static non-SN heap&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;To estimate static non-SN heap, you need to take VSIZE after copy (or disk based) GC and subtract from it the &amp;quot;Done - new size is nnn bytes&amp;quot; value from the line below it (values obtained from OTF GC prints are not good).&lt;/p&gt;&lt;p&gt;MEMORY_DEBUG: process size after GC:&lt;/p&gt;&lt;p&gt;&lt;b&gt;MEMORY_DEBUG:&amp;nbsp;&amp;nbsp; VSIZE = 1990940, RSS = 1792688&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Done - new size is 1804478256 bytes.&lt;/p&gt;&lt;p&gt;In this case: 1990940K - 1804478256.&lt;/p&gt;&lt;p&gt;So the maximum of VSIZE after copy GC, which supposed to be &amp;quot;static SN heap&amp;quot; + &amp;quot;static non-SN heap&amp;quot;, is an estimation of what is the minimum requirement for the environment.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;Finding a value for Dynamic allocation (Garbage)&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;There is one more thing to be estimated -- the amount of memory used for dynamic allocations collected during GC. It will depend on the environment and how fast it allocates &amp;quot;transient&amp;quot; objects. If it happens fast, you need to have a large buffer so that GC is not triggered too often; if there are few dynamic allocations, it can be relatively small. &lt;b&gt;In most cases, it&amp;#39;s the same order of magnitude as static SN heap&lt;/b&gt;. &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;Example Calculation&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Let&amp;#39;s look at an example on how you could come up with some numbers for OPS on a typical simulation run. &lt;/p&gt;&lt;p&gt;As per the above example:&lt;/p&gt;&lt;p&gt;&amp;quot;process size after GC&amp;quot; : VSIZE = 1990940 (~1944M)&lt;/p&gt;&lt;p&gt;&amp;quot;Done - new size is&amp;quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : &amp;nbsp;1804478256 bytes (~1721M)&lt;/p&gt;&lt;p&gt;Static non-SN heap&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 1944 - 1721 = 223M&lt;/p&gt;&lt;p&gt;Live SN heap&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 1721M&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;Recommended Optimal Process Size = (Static non-SN heap) + 2 X (Live SN heap) + Dynamic allocation&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;&lt;/span&gt;Or&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;&lt;/span&gt;*OPS= (Static non-SN heap) + ~3X (Live SN heap)&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-tab-span" style="white-space:pre;"&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp;OPS= (223) + (3 * 1721) = 5386M&lt;/p&gt;&lt;p&gt;*&lt;i&gt;Since we estimated Dynamic allocation to be of the same magnitude as Live SN heap, we used 3 times the value of Live SN heap. In most cases the dynamic allocation value would be lower so we can round down the result we got.&amp;nbsp; For instance, in the above example&lt;/i&gt; &lt;/p&gt;&lt;p align="center"&gt;&lt;b&gt;&lt;i&gt;OPS = 5386M =~ 5G.&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Notes: &lt;/p&gt;&lt;ul class="unIndentedList"&gt;&lt;li&gt;The result recommended OPS will not be effective if we&amp;nbsp;notice &lt;b&gt;&lt;i&gt;disk-based GC&lt;/i&gt;&lt;/b&gt; occurrences in that pilot simulation. In this case we would want to give a higher value than the result OPS we calculated, in order to avoid disk-based GC, and re-calculate the OPS in the same manner, if we were successful avoiding it.&lt;/li&gt;&lt;li&gt;If you know your environment does not use a lot of dynamic allocations (in such cases you will see that the difference between values of Live SN heap before and after GC are small), you can change the above formula to something closer to &lt;/li&gt;&lt;/ul&gt;&lt;p align="center"&gt;&lt;b&gt;&lt;i&gt;OPS= (Static non-SN heap) + 2X (Live SN heap)&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;And round it up. This way you won&amp;#39;t encounter a situation where you have a simulation which consumes a lot of memory, but performs no GCs.&lt;/p&gt;&lt;ul class="unIndentedList"&gt;&lt;li&gt;If you try setting the OPS to a very low value, Specman will automatically adjust it. Specman will notify you if it sets the optimal_process_size to a value other that what a user specifies, if you set the -notify_gc_settings option to TRUE. In that case, you will see a message as follows:&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;auto_gc_settings: Application too big, setting optimal_process_size to&lt;/p&gt;&lt;p&gt;760803328 which is sn_uintptr2ep(760803328)&amp;nbsp; &lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;Summary:&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Calculating the optimal OPS is a bit tricky. You want it to limit Specman usage while giving it enough space not to encounter memory issues. The above example calculation gives you no more than a recommendation, which is based on the previous run. To get a better, more realistic value, you should run several pilot simulations, and perform the above analysis on the average of those runs.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;* From SPMN 12.10s4 and forward this calculation is done automatically when you apply the config memory -print_process_size&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;Avi Farjoun&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&lt;i&gt;Muffadal Laila&lt;/i&gt;&lt;/b&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/cadence/community/blogs/37305/~4/v_5Ul0e3mS8" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cadence.com/Community/blogs/fv/archive/2013/01/01/determining-a-good-value-for-optimal-process-size.aspx</feedburner:origLink></item><item><title>Avoid Overly Long Expressions in Specman e Code</title><link>http://feedproxy.google.com/~r/cadence/community/blogs/37305/~3/d39BLyvmMpU/avoid-overly-long-expressions-in-e-code.aspx</link><pubDate>Tue, 11 Dec 2012 14:40:00 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:1317037</guid><dc:creator>teamspecman</dc:creator><description>&lt;p&gt;When you write your &lt;i&gt;&lt;strong&gt;e&lt;/strong&gt;&lt;/i&gt; code, a good practice is to avoid expressions that are &amp;quot;overly long&amp;quot; even though they are completely legal. While there is no hard definition of what constitutes an overly long expression, such long expressions can lead to human errors and parser processing errors.&lt;/p&gt;&lt;p&gt;Very long expressions are hard to read and understand. This also makes them error prone, as an accidental syntax error in the middle of such an expression is hard to notice.&lt;/p&gt;&lt;p&gt;Furthermore, such an expression can lead to undesirable results from the Specman parser. It can take it long time to parse, and in some cases (especially if you use a 32-bit platform) it can eventually run out of memory resources and crash. This is all the more likely to happen if the expression contains a real syntax error (which in a shorter expression would normally lead to a syntax error message). Thus, by avoiding expressions that are too long, you benefit twice: &lt;/p&gt;&lt;p&gt;1.&amp;nbsp; You better avoid introducing accidental syntax errors in the first place.&lt;/p&gt;&lt;p&gt;2.&amp;nbsp;&amp;nbsp;You help the Specman parser to detect such errors faster in the event that they do occur.&lt;/p&gt;&lt;p&gt;On top of that, it is a good habit to use parentheses in long expressions where appropriate. This not only makes the code more readable, it can actually, in certain cases, make parsing faster.&lt;/p&gt;&lt;p&gt;One last recommendation is to break a long expression into several smaller ones. To illustrate the above recommendations, let&amp;#39;s take a look at the following code:&lt;/p&gt;&lt;p&gt;print x == 0 or x == 1 or x == 2 or x == 3 or x == 4 or x == 5 or x == 6 or x == 7 or x == 8 or x == 9 or x == 10 or x == 11 or x == 12 or x == 13 or x == 14 or x == 15 or x == 16 or x == 17 or x == 18 or x == 19 or;&lt;/p&gt;&lt;p&gt;This expression contains a syntax error -- it has an extra &amp;quot;or&amp;quot; at the end. Because the expression is very long, the parser starts to perform a very long calculation, instead of immediately reporting the error. (In this case, the long calculation is avoided when the error is fixed.) Also, the long calculation might eventually lead to a crash.&lt;/p&gt;&lt;p&gt;If you add parentheses as follows, the expression becomes more readable, and you will likely not make the above syntax error in the first place:&lt;/p&gt;&lt;p&gt;print (x == 0) or (x == 1) or (x == 2) or (x == 3) or (x == 4) or (x == 5) or (x == 6) or (x == 7) or (x == 8) or (x == 9) or (x == 10) or (x == 11) or (x == 12) or (x == 13) or (x == 14) or (x == 15) or (x == 16) or (x == 17) or (x == 18) or (x == 19);&lt;/p&gt;&lt;p&gt;You can also break the expression into two smaller ones:&lt;/p&gt;&lt;p&gt;var tmp1 := (x == 0) or (x == 1) or (x == 2) or (x == 3) or (x == 4) or (x == 5) or (x == 6) or (x == 7) or (x == 8) or (x == 9);&lt;/p&gt;&lt;p&gt;var tmp2 := (x == 10) or (x == 11) or (x == 12) or (x == 13) or (x == 14) or (x == 15) or (x == 16) or (x == 17) or (x == 18) or (x == 19);&lt;/p&gt;&lt;p&gt;print tmp1 or tmp2;&lt;/p&gt;&lt;p&gt;In order to improve usability, and ease the pain of this limitation, Specman will automatically issue a warning message, where possible, when parsing an expression actually starts taking too long. This warning will not refer to an exact syntax error, even if there is one; it will, however, refer to the source line in which the problematic expression resides. You will then be able to stop parsing by pressing Control/C, and then examine your code and correct it if needed. This warning will be added in the coming HF releases of Specman, starting from 10.2.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;Yuri Tsoglin&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;e Language team, Specman R&amp;amp;D&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/cadence/community/blogs/37305/~4/d39BLyvmMpU" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cadence.com/Community/blogs/fv/archive/2012/12/11/avoid-overly-long-expressions-in-e-code.aspx</feedburner:origLink></item><item><title>UVM e vr_ad -- Specman Read/Write Register Enhancements</title><link>http://feedproxy.google.com/~r/cadence/community/blogs/37305/~3/ZffrAVCqFMw/d.aspx</link><pubDate>Sat, 24 Nov 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:1316646</guid><dc:creator>teamspecman</dc:creator><description>&lt;p&gt;If you are a Specman vr_ad user, you probably know that register access is implemented&amp;nbsp; using the &lt;b&gt;read_reg&lt;/b&gt; / &lt;b&gt;write_reg. &lt;/b&gt;For reading/writing a register, you have to &lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;1. Extend a &lt;b&gt;vr_ad_sequence&lt;/b&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;p&gt;2. Add a field of the type of the register you want to access&lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;p&gt;3. In the &lt;b&gt;body()&lt;/b&gt; , call the &lt;b&gt;read/write_reg&lt;/b&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;For example:&lt;/p&gt;&lt;p&gt;extend MAIN vr_ad_sequence {&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; !tx_data_reg : VR_AD_TX_DATA&amp;nbsp; vr_ad_reg;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; !tx_mode_reg : VR_AD_TX_MODE&amp;nbsp; vr_ad_reg;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; body() @driver.clock is only {&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; read_reg {.driver == reg_driver} tx_data_reg;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; read_reg {.driver == reg_driver} tx_mode_reg;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;};&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;};&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;For simplifying test writing, starting Specman 12.1 the read/write_reg actions can:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Be called from any TCM, not only from within a sequence &lt;/li&gt;&lt;li&gt;Access not only a local field, but also a variable, or a reference to a field within the &lt;em&gt;&lt;strong&gt;e&lt;/strong&gt;&lt;/em&gt; registers model&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;One of the nice capabilities achieved with these enhancements is that you can embed access to registers among other activities. For example -- in a system level sequence, as in this code example :&lt;/p&gt;&lt;p&gt;extend SEND_AND_CHECK system_seq {&lt;/p&gt;&lt;p&gt;&amp;nbsp; !serial_frame : LEGAL frame;&lt;/p&gt;&lt;p&gt;&amp;nbsp; body() @driver.clock is {&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Perform activity on serial interface, via the i/f driver&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do serial_frame on driver.serial_driver;&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Local variable of a register, read it and check the value&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var status_reg : STS vr_ad_reg;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; read_reg {.driver == driver.reg_driver} status_reg;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; check that status_reg.get_cur_value() == 0x37;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Access registers without defining fields nor variables&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; write_reg {.driver == driver.reg_driver} driver.reg_model.reg0 val 0x12; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; write_reg {.driver == driver.reg_driver} driver.reg_model.reg1 val 0xFA; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; write_reg {.driver == driver.reg_driver} driver.reg_model.reg2 val 0x3; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; write_reg {.driver == driver.reg_driver} driver.reg_model.reg3 val 0x0; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/p&gt;&lt;p&gt;};&lt;/p&gt;&lt;p&gt;Note that register accesses are handled by the vr_ad_driver. So, when accessing a register from a TCM which is not a vr_ad sequence, you have to specify the vr_ad_driver to handle this operation.&lt;/p&gt;&lt;p&gt;We encourage you to check out the latest UVM &lt;em&gt;&lt;strong&gt;e&lt;/strong&gt;&lt;/em&gt; reference manual and user guide for details (both are part of Cadence Help).&lt;/p&gt;&lt;p&gt;Enjoy verification &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Efrat Shneydor &amp;amp; Reuven Naveh,&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;UVM e&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/cadence/community/blogs/37305/~4/ZffrAVCqFMw" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.cadence.com/Community/blogs/fv/archive/2012/11/23/d.aspx</feedburner:origLink></item></channel></rss>
