<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1724087381158100807</id><updated>2024-09-06T08:27:32.463+05:30</updated><category term="Sample Codes"/><category term="News"/><category term="Coverage"/><category term="Interview"/><category term="Jobs"/><category term="Example"/><category term="OVM"/><category term="Utility"/><category term="Debugging"/><category term="Did You Know"/><category term="IEEE"/><category term="TechToons"/><category term="UVM"/><category term="Accellera"/><category term="Bidirectional Ports"/><category term="Books"/><category term="Companies"/><category term="Functional Verification"/><category term="Implementation"/><category term="IntelliGen"/><category term="Online Course"/><category term="PSWG"/><category term="Papers"/><category term="Perspec"/><category term="Portable Stimulus"/><category term="Puzzle"/><category term="Riddle"/><category term="Specman Commands"/><category term="System Verilog"/><category term="UVM-ML"/><category term="eBooks"/><title type='text'>Verification Blog</title><subtitle type='html'>This blog is all about verification of Digital Designs.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>43</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-5443498309054682787</id><published>2016-08-20T21:37:00.000+05:30</published><updated>2016-08-20T21:37:06.663+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Accellera"/><category scheme="http://www.blogger.com/atom/ns#" term="Perspec"/><category scheme="http://www.blogger.com/atom/ns#" term="Portable Stimulus"/><category scheme="http://www.blogger.com/atom/ns#" term="PSWG"/><title type='text'>Tutorial on Portable Stimulus for SoC and System Verification/Validation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Portable Stimulus is one of the latest initiative by Accelerate to address stimulus reusability across the different axis like across different users (e.g. Architects, Design Engineer, Verification Engineer, Firmware development engineer), across different platforms (Simulation, Emulation, FPGA, Board) and across multiple integration level (IP, Subsystem, SoC, Firmware, OS). As the industry is adopting shift-left approach (i.e. bringing software development and testing early in the product cycle), portability of the stimulus id becoming more relevant and this is the need of an hour. If you are interested in knowing more about what&#39;s Cadence offerings in this exciting space, satay tuned for more as I am planning to write more on this in coming weeks.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
DVCon India is here on 15-16 September, 2016 and I am going to talk about it in one of the tutorial &quot;&lt;a href=&quot;https://dvcon-india.org/content/event-details?id=205-64&quot; target=&quot;_blank&quot;&gt;Using Portable Stimulus for SoC Verification as Applied on Mobile, Networking, and Server Designs&lt;/a&gt;&quot;. You can also explore Accellera tutorial &quot;&lt;a href=&quot;https://dvcon-india.org/content/event-details?id=205-57&quot; target=&quot;_blank&quot;&gt;How Portable&amp;nbsp;Stimulus Addresses Key Verification, Test Reuse, and Portability Challenges&lt;/a&gt;&quot; for more on portable stimulus.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/5443498309054682787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/5443498309054682787?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/5443498309054682787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/5443498309054682787'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2016/08/tutorial-on-portable-stimulus-for-soc.html' title='Tutorial on Portable Stimulus for SoC and System Verification/Validation'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-8154900051126276575</id><published>2015-10-27T11:15:00.001+05:30</published><updated>2015-10-27T11:15:27.041+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Example"/><category scheme="http://www.blogger.com/atom/ns#" term="Puzzle"/><category scheme="http://www.blogger.com/atom/ns#" term="Riddle"/><category scheme="http://www.blogger.com/atom/ns#" term="Sample Codes"/><title type='text'>Einstein’s Five House Riddle - Solution in &#39;e&#39;</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:TrackMoves/&gt;
  &lt;w:TrackFormatting/&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:DoNotPromoteQF/&gt;
  &lt;w:LidThemeOther&gt;EN-US&lt;/w:LidThemeOther&gt;
  &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;
  &lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
   &lt;w:SplitPgBreakAndParaMark/&gt;
   &lt;w:EnableOpenTypeKerning/&gt;
   &lt;w:DontFlipMirrorIndents/&gt;
   &lt;w:OverrideTableStyleHps/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
  &lt;m:mathPr&gt;
   &lt;m:mathFont m:val=&quot;Cambria Math&quot;/&gt;
   &lt;m:brkBin m:val=&quot;before&quot;/&gt;
   &lt;m:brkBinSub m:val=&quot;&amp;#45;-&quot;/&gt;
   &lt;m:smallFrac m:val=&quot;off&quot;/&gt;
   &lt;m:dispDef/&gt;
   &lt;m:lMargin m:val=&quot;0&quot;/&gt;
   &lt;m:rMargin m:val=&quot;0&quot;/&gt;
   &lt;m:defJc m:val=&quot;centerGroup&quot;/&gt;
   &lt;m:wrapIndent m:val=&quot;1440&quot;/&gt;
   &lt;m:intLim m:val=&quot;subSup&quot;/&gt;
   &lt;m:naryLim m:val=&quot;undOvr&quot;/&gt;
  &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;

&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Over
the weekend, I came across this riddle and thought of solving it using ‘e’.
Later on I challenged our team members over the WhatsApp and they took up the
challenge. They came up with their version of solution in SV and SVA. I thought of sharing this solution to show how constraints solver
engine can solve these kind of riddles. During the course of
solution, I observed specifics about constraint solving technology of Specman. But before that, let’s
look at the riddle. It is called with different names like Zebra Riddle or
Einstein’s Riddle. This riddle has different version of stories and none of it
has any solid proof to prove its origin. I’ve taken this riddle from one of the
student’s &lt;a href=&quot;https://web.stanford.edu/~laurik/fsmbook/examples/Einstein&#39;sPuzzle.html&quot;&gt;home
page&lt;/a&gt; from Stanford University website. Here is his version of the riddle
which we tried to solve.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Let
us assume that there are five houses of different colors next to each other on
the same road. In each house lives a man of a different nationality. Every man
has his different favorite drink, his different favorite brand of cigarettes,
and keeps different pets of a particular kind. &lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     Englishman lives in the red house.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     Swede keeps dogs.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     Dane drinks tea.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     green house is just to the left of the white one.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     owner of the green house drinks coffee.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     Pall Mall smoker keeps birds.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     owner of the yellow house smokes Dunhills.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     man in the center house drinks milk.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     Norwegian lives in the first house.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     Blend smoker has a neighbor who keeps cats.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     man who smokes Blue Masters drinks bier.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     man who keeps horses lives next to the Dunhill smoker.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     German smokes Prince.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     Norwegian lives next to the blue house.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     Blend smoker has a neighbor who drinks water.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;The question to
be answered is: &lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Who keeps fish?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Now to solve this riddle, I started thinking these clues as
constraints in ‘e’. Let’s go step by step how I approached this problem.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Here, we have 5 men who has different characteristics like
they live in specific house number which has specific color. Each one has
unique nationality, favorite drink, favorite brand of cigarettes and pet. So,
based on these attributes, we can create a struct which can have these 5
attributes. These five attributes can be enumerated and ‘man’ struct can be
defined as shown below.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;type nationality_t : [english, swede, dane,
norweigian, german];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;type house_color_t : [red, green, yellow, blue,
white];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;type cigarette_t : [dunhill, blend, blue_masters,
prince, pall_mall];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;type pet_t : [dog, bird, cat, horse, fish];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;type drink_t : [tea, coffee, milk, bier, water];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;struct man {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; nationality : nationality_t;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; house_color : house_color_t;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; cigarette&amp;nbsp;&amp;nbsp; : cigarette_t;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;
pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : pet_t;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;
drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : drink_t;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Here, I’ve not captured the house number as an attribute
since I thought I can create list of struct which automatically will fix the
house number of each object.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Now, I’ve categorized the clues in 2 category. One category
which does not have house number order dependency and the other category which
has house number dependency. Like, clue number 1 “The Englishman lives in red
house” does not have any reference to the number of house, whereas clue no. 4
“The gree house is just to the left of the white one” has reference to the
house number order. Since I have not captured the house number as an attribute,
I’ve to split the clues into two different categories of constraints. One
without the reference of the house number can be part of the original struct
definition. One with the house number dependency can go to the place where list
of struct is created so that we have notion of the house orders using index
number of the list.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Let’s first capture the clues without house number ordering
as global constraints as part of struct declaration. Here is what I’ve
captured.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;extend man {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Englishman lives in
the red house&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keep nationality ==
english&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; house_color == red;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Swede keeps dog&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keep nationality ==
swede&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt;
pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == dog;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //dane drinks tea&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keep nationality ==
dane&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt;
drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == tea;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //owner of the green
house drinks coffee&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keep house_color ==
green&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt;
drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == coffee;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Pall Mall smoker
keeps bird&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keep
cigarette&amp;nbsp;&amp;nbsp; == pall_mall&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt;
pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == bird;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //owner of the yellow
house smokes dunhill&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keep house_color ==
yellow&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; cigarette&amp;nbsp;&amp;nbsp; ==
dunhill;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Man who smokes Blue
Masters drinks bier&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keep
cigarette&amp;nbsp;&amp;nbsp; == blue_masters =&amp;gt;
drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == bier;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //German smokes
prince&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;keep nationality ==
german&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; cigarette&amp;nbsp;&amp;nbsp; ==
prince;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Now let’s move on to declaring this struct as 5 objects as
shown below.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;extend sys&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; men : list of man;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keep men.size() == 5;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Now over here, we can capture the clues with house number
ordering as different constraints involving different objects. Here, we’ll go
by clues.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Let’s look at the first constraint which has dependency on
the house number ordering. This clue is clue number 4 “The green house is just
to the left of the white one”. This can be captured as shown below. Here I’ve
assumed house numbers starts from 0 to 4 runs from left to right. Due to this
assumption, house number 0 does not have any house on left side of it.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;extend sys {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; //The green house is just to the left
of the white one.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[1].house_color == white =&amp;gt;
men[0].house_color == green;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[2].house_color == white =&amp;gt;
men[1].house_color == green;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[3].house_color == white =&amp;gt;
men[2].house_color == green;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[4].house_color == white =&amp;gt;
men[3].house_color == green;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Next clue which has dependency on the house number ordering
is clue number 8 “The man in the center house drinks milk”. This can be
captured easily as we know the house number 2 is in center.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;extend sys {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; //The man in the center house drinks
milk.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[2].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == milk;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Next such clue is clue number 9 “The Norwegian lives in the
first house”. Again it is simple to capture.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;extend sys {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; //Norweigian lives in the first house&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].nationality == norweigian;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Next such clue is clue number 10 “The Blend smoker has a
neighbor who keeps cats”. This is how I captured it. It is obvious that man
staying in house 0 or 4 have only one neighbor and rest men have 2 neighbour.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;extend sys {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; //The Blend smoker has a neighbor who
keeps cats.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[0].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == cat&amp;nbsp;&amp;nbsp;
=&amp;gt; men[1].cigarette == blend;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[1].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == cat =&amp;gt; men[0].cigarette
== blend or men[2].cigarette == blend;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[2].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == cat =&amp;gt;
men[1].cigarette == blend or men[3].cigarette == blend;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[3].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == cat =&amp;gt;
men[2].cigarette == blend or men[4].cigarette == blend;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[4].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
== cat =&amp;gt; men[3].cigarette == blend;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Next clue is clue number 12 “The man who keeps horses lives
next to the Dunhill smoker”. Again it is captured just like the above
constraints for clue number 10.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;extend sys {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; //The man who keeps horses lives next
to the Dunhill smoker.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[0].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == horse =&amp;gt;
men[1].cigarette == dunhill;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[1].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == horse =&amp;gt;
men[0].cigarette == dunhill or men[2].cigarette == dunhill;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[2].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == horse =&amp;gt;
men[1].cigarette == dunhill or men[3].cigarette == dunhill;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[3].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == horse =&amp;gt;
men[2].cigarette == dunhill or men[4].cigarette == dunhill;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[4].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; == horse =&amp;gt;
men[3].cigarette == dunhill;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Next clue in this category is clue number 14 “The Norwegian
lives next to the blue house”. &amp;nbsp;Since it is already declared in clue
number 9 “The Norwegian lives in the first house”, it is obvious that the blue
house is house number 1. The Here is how I’ve captured it.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;extend sys {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; //The Norwegian lives next to the blue
house.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[1].house_color == blue;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
If we do not want to capture it by interpreting it by
ourselves and want tool to interpret for us, we can capture it just like we
captured clue number 10 and 12. Here is how clue number 14 can be captured in
alternate way.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;extend sys {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; //The Norwegian lives next to the blue
house.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].nationality == norweigian
=&amp;gt; men[1].house_color == blue;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[1].nationality == norweigian
=&amp;gt; men[0].house_color == blue or men[2].house_color == blue;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[2].nationality == norweigian
=&amp;gt; men[1].house_color == blue or men[3].house_color == blue;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[3].nationality == norweigian
=&amp;gt; men[2].house_color == blue or men[4].house_color == blue;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[4].nationality == norweigian
=&amp;gt; men[2].house_color == blue or men[4].house_color == blue;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Last clue that is clue number 15 “The Blend smoker has a
neighbor who drinks water” is again captured the way we have captured clue
number 10 and 12.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;extend sys {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; //The Blend smoker has a neighbor who
drinks water.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].cigarette&amp;nbsp;&amp;nbsp; ==
blend =&amp;gt; men[1].drink == water;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[1].cigarette&amp;nbsp;&amp;nbsp; ==
blend =&amp;gt; men[0].drink == water or men[2].drink == water;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[2].cigarette&amp;nbsp;&amp;nbsp; ==
blend =&amp;gt; men[1].drink == water or men[3].drink == water;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[3].cigarette&amp;nbsp;&amp;nbsp; ==
blend =&amp;gt; men[2].drink == water or men[4].drink == water;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[4].cigarette&amp;nbsp;&amp;nbsp; ==
blend =&amp;gt; men[3].drink == water;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Now we have captured all the clues as constraints. But when
we load this file into Specman and try to solve it, we get constraint error.
The reason is that we have not capture an important piece of information into
this solution, that is each man has unique values of each 5 attributes. Now
capturing this and informing Specman to generate uniq values for all 5 objects
of man struct is bit tricky in ‘e’. In system Verilog, randc operator helps us
capture it very easily, but in ‘e’ we have to do it with lot of codes. Here is
how I’ve done it.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;extend sys {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; //Let us assume that there are five
houses of different colors next to each other on the same road. In each house
lives a man of a different nationality. Every man has his favorite drink, his
favorite brand of cigarettes, and keeps pets of a particular kind.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; //Unique nationality, house_color,
cigarette, pet and drink&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].nationality !=
men[1].nationality;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].nationality !=
men[2].nationality;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].nationality !=
men[3].nationality;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].nationality !=
men[4].nationality;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].house_color !=
men[1].house_color;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].house_color !=
men[2].house_color;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].house_color !=
men[3].house_color;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].house_color !=
men[4].house_color;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].cigarette&amp;nbsp;&amp;nbsp; !=
men[1].cigarette;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].cigarette&amp;nbsp;&amp;nbsp; !=
men[2].cigarette;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].cigarette&amp;nbsp;&amp;nbsp; !=
men[3].cigarette;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[0].cigarette&amp;nbsp;&amp;nbsp; !=
men[4].cigarette;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[0].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[1].pet;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[0].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[2].pet;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[0].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[3].pet;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[0].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[4].pet;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[0].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[1].drink;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[0].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[2].drink;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[0].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[3].drink;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[0].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[4].drink;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[1].nationality !=
men[2].nationality;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[1].nationality !=
men[3].nationality;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[1].nationality !=
men[4].nationality;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[1].house_color !=
men[2].house_color;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[1].house_color !=
men[3].house_color;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[1].house_color !=
men[4].house_color;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[1].cigarette&amp;nbsp;&amp;nbsp; !=
men[2].cigarette;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[1].cigarette&amp;nbsp;&amp;nbsp; !=
men[3].cigarette;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[1].cigarette&amp;nbsp;&amp;nbsp; !=
men[4].cigarette;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[1].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[2].pet;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[1].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[3].pet;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[1].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[4].pet;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[1].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[2].drink;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[1].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[3].drink;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[1].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[4].drink;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[2].nationality !=
men[3].nationality;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[2].nationality != men[4].nationality;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[2].house_color !=
men[3].house_color;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[2].house_color !=
men[4].house_color;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[2].cigarette&amp;nbsp;&amp;nbsp; !=
men[3].cigarette;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[2].cigarette&amp;nbsp;&amp;nbsp; !=
men[4].cigarette;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[2].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[3].pet;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[2].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[4].pet;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[2].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[3].drink;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[2].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[4].drink;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[3].nationality !=
men[4].nationality;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[3].house_color !=
men[4].house_color;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep men[3].cigarette&amp;nbsp;&amp;nbsp; !=
men[4].cigarette;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[3].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[4].pet;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; keep
men[3].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; != men[4].drink;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Now we are ready to solve it. Let’s add some debug and
solution print statements.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;extend {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; post_generate() is also&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i from 0 to 4 {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
outf (&quot;\n&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
outf (&quot;men[%d].nationality = %s\n&quot;, i, men[i].nationality);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
outf (&quot;men[%d].house_color = %s\n&quot;, i, men[i].house_color);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
outf (&quot;men[%d].cigarette&amp;nbsp;&amp;nbsp; = %s\n&quot;, i,
men[i].cigarette&amp;nbsp; );&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
outf (&quot;men[%d].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =
%s\n&quot;, i, men[i].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
outf (&quot;men[%d].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = %s\n&quot;, i,
men[i].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outf
(&quot;===================================\n&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i from 0 to 4 {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if
(men[i].pet == fish)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
outf (&quot;\nAnswer to the quesiton &#39;Who keeps fish?&#39; is %s who lives in house
no %d with house color %s and smokes %s and drinks %s has %s as pet...\n&quot;,
men[i].nationality, i, men[i].house_color, men[i].cigarette, men[i].drink,
men[i].pet);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
outf (&quot;\n&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
outf (&quot;men[%d].nationality = %s\n&quot;, i, men[i].nationality);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
outf (&quot;men[%d].house_color = %s\n&quot;, i, men[i].house_color);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
outf (&quot;men[%d].cigarette&amp;nbsp;&amp;nbsp; = %s\n&quot;, i,
men[i].cigarette&amp;nbsp; );&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
outf (&quot;men[%d].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =
%s\n&quot;, i, men[i].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
outf (&quot;men[%d].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = %s\n&quot;, i,
men[i].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp; }; //post_generate() is also&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;}; //extend sys&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
After loading it into Specman and solving it, we get
following output.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;Loading einsteins_puzle.e ...&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;Doing setup ...&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;Generating the test with IntelliGen using seed
1966611192...&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[0].nationality = norweigian&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[0].house_color = yellow&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[0].cigarette&amp;nbsp;&amp;nbsp; = dunhill&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[0].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
= cat&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[0].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =
water&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[1].nationality = dane&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[1].house_color = blue&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[1].cigarette&amp;nbsp;&amp;nbsp; = blend&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[1].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
= horse&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[1].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =
tea&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[2].nationality = english&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[2].house_color = red&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[2].cigarette&amp;nbsp;&amp;nbsp; = pall_mall&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[2].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
= bird&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[2].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =
milk&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[3].nationality = german&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[3].house_color = green&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[3].cigarette&amp;nbsp;&amp;nbsp; = prince&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[3].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
= fish&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[3].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =
coffee&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[4].nationality = swede&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[4].house_color = white&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[4].cigarette&amp;nbsp;&amp;nbsp; = blue_masters&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[4].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
= dog&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[4].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =
bier&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;===================================&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;Answer to the quesiton &#39;Who keeps fish?&#39; is german
who lives in house no 3 with house color green and smokes prince and drinks
coffee has fish as pet...&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[3].nationality = german&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[3].house_color = green&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[3].cigarette&amp;nbsp;&amp;nbsp; = prince&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[3].pet&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
= fish&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;men[3].drink&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =
coffee&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;Starting the test ...&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;Running the test ...&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;No actual running requested.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;Checking the test ...&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;Checking is complete - 0 DUT errors, 0 DUT warnings.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
So the answer is “&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;German keeps the Fish&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;”. Now try to solve
this solution multiple times with random seed and you will get the same answer.
That way we can be sure that the constraints we’ve captured are correct.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
One last observation I’ve made is that this solution can be
solved in IntelliGen Specman solver only. It does not work with PGen Specman
solver engine. The reason is quiet obvious. PGen depends on the order of
constraints declaration whereas IntelliGen is truly bi-directional constraints
solver which is natural way of solving all the constraints at the same time. &lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Hope you like this riddle and the solution. I am sure this
is not the optimal way of solving the problem, but it’s my lazy weekend stuff,
so I wrote whatever came to my mind first without thinking much about
optimizing it. If you have any suggestion to improve it, please do comment. If
you have solutions in other forms (XLS, Perl, tcl, python, C, C++, VB, PHP or
any other your favorite language) then please do post it in the comment.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/8154900051126276575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/8154900051126276575?isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/8154900051126276575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/8154900051126276575'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2015/10/einsteins-five-house-riddle-solution-in.html' title='Einstein’s Five House Riddle - Solution in &#39;e&#39;'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-7821341164604092099</id><published>2015-01-13T11:52:00.000+05:30</published><updated>2015-01-13T11:52:50.908+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Functional Verification"/><category scheme="http://www.blogger.com/atom/ns#" term="Online Course"/><title type='text'>A Basic Course on &quot;Functional Hardware Verification&quot; from Udacity</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
If you are new to Functional Verification and interested to learn about it, &lt;a href=&quot;https://www.udacity.com/&quot; target=&quot;_blank&quot;&gt;Udacity &lt;/a&gt;has a self paced online course available titled as &quot;Functional Hardware Verification&quot;. Here is the &lt;a href=&quot;https://www.udacity.com/course/cs348&quot; target=&quot;_blank&quot;&gt;link&lt;/a&gt; for the course.&lt;br /&gt;
&lt;br /&gt;
Instructor Axel Scherer is a senior engineer and manager at Cadence Design Systems. Instructor Hannes Fröhlich is Member of Product Expert Team in Functional Verification R&amp;amp;D group of Cadence Design Systems.&lt;br /&gt;
&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/7821341164604092099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/7821341164604092099?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/7821341164604092099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/7821341164604092099'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2015/01/a-basic-course-on-functional-hardware.html' title='A Basic Course on &quot;Functional Hardware Verification&quot; from Udacity'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-156723559974917064</id><published>2013-09-26T18:43:00.000+05:30</published><updated>2013-09-26T18:43:14.873+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Example"/><category scheme="http://www.blogger.com/atom/ns#" term="UVM"/><category scheme="http://www.blogger.com/atom/ns#" term="UVM-ML"/><title type='text'>UVM-Multi Language solution from Cadence</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Today&#39;s complex SoC level verification environment are based on advanced verification methodology standards. But these standards usually meant for single language domain. But fact of the life is that the these SoC level testbenches are made of mix of language domains like legacy Specman/e environment along with newly developed UVM-SV and SystemC or C++. Usually, when these scenario arrives, verification teams typically comes up with their own solutions which is mainly short term solution keeping existing needs in to the consideration. To develop this kind of inter operable solutions, there are quite a few challenges involved. Few are listed below.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;1) Connecting different components of different domains&lt;br /&gt;2) Transferring data/events from different domains&lt;br /&gt;3) Synchronizations of major phases&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Having said that, industry standard solution is the need of an hour. Cadence&#39;s Multi Language solution also known as UVM-ML addresses the above mentioned multi language integration challenges. UVM-ML is in existence for quite a sometime but least known. It was initially developed to take care of e-SV and e-SC integrations. UVM-ML is based on a back-plane library responsible for connecting two or more domains. Different language domain connect to back-plane library via language specific adapter layer. Currenty this solution supports integration of SystemC, UVM-SV, UVM-e.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Here is an example of how UVM-SV based producer can communicate to SystemC based consumer. You can refere more examples in the Incisiv installation area at $CDNS_HOME/tools/uvm/uvm_lib/uvm_ml/examples/sc/ and $CDNS_HOME/tools/uvm/uvm_lib/additions/uvm_ml_examples/ex_e_sv_sc_tlm/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//-----------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//File : producer.sv&lt;br /&gt;//System Verilog Producer&lt;br /&gt;//-----------------------------------------&lt;/span&gt; &lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;module &lt;span style=&quot;color: black;&quot;&gt;topmodule;&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;import &lt;/span&gt;uvm_pkg::*;&lt;br /&gt;&lt;span style=&quot;color: #8e7cc3;&quot;&gt;`include&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;&quot;uvm_macros.svh&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;//Declare basic packet which will be passed to SC consumer&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: red;&quot;&gt;class &lt;/span&gt;packet &lt;span style=&quot;color: red;&quot;&gt;extends &lt;/span&gt;uvm_object;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;rand int &lt;/span&gt;data;&lt;br /&gt;&lt;span style=&quot;color: red;&quot;&gt;endclass&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;//Declare SV producer which will communicate with SC consumer through out port&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: red;&quot;&gt;class &lt;/span&gt;producer &lt;span style=&quot;color: red;&quot;&gt;extends &lt;/span&gt;uvm_component;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt; //Declare out port. This port will be connected to SC consumer&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; uvm_analysis_port #(packet) out;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt; //constructor&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;function new&lt;/span&gt;(&lt;span style=&quot;color: red;&quot;&gt;string &lt;/span&gt;name&lt;span style=&quot;color: magenta;&quot;&gt;&quot;producer&quot;&lt;/span&gt;, uvm_component parent=&lt;span style=&quot;color: red;&quot;&gt;null&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;super&lt;/span&gt;.&lt;span style=&quot;color: red;&quot;&gt;new&lt;/span&gt;(name, parent);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out = &lt;span style=&quot;color: red;&quot;&gt;new&lt;/span&gt;(&lt;span style=&quot;color: magenta;&quot;&gt;&quot;out&quot;&lt;/span&gt;, &lt;span style=&quot;color: red;&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//Register out port with UVM-ML&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ml_uvm::extnernal_if(out, &lt;span style=&quot;color: magenta;&quot;&gt;&quot;packet&quot;&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;endfunction &lt;/span&gt;: &lt;span style=&quot;color: red;&quot;&gt;new&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//Generate dummy packet and pass it to out port&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;task &lt;/span&gt;run_phase (uvm_phase phase);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; packet pkt = packet::type_id::create(&lt;span style=&quot;color: magenta;&quot;&gt;&quot;pkt&quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; phase.raise_objection(&lt;span style=&quot;color: red;&quot;&gt;this&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;for &lt;/span&gt;(&lt;span style=&quot;color: red;&quot;&gt;int &lt;/span&gt;i=0; i&lt;5 br=&quot;&quot; i=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;bit &lt;/span&gt;res = pkt.randomize();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #8e7cc3;&quot;&gt; `uvm_info&lt;/span&gt;(&quot;TEST&quot;, &lt;span style=&quot;color: #8e7cc3;&quot;&gt;$sformatf&lt;/span&gt;(&lt;span style=&quot;color: magenta;&quot;&gt;&quot;producer.pkt.data=&#39;h%h&quot;&lt;/span&gt;, pkt.data), UVM_LOW)&lt;/5&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//Send the generated packet to out port&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.write(pkt);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;10&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; phase.drop_objection(this);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;endtask &lt;/span&gt;: run_phase&lt;br /&gt;&lt;span style=&quot;color: red;&quot;&gt;endclass &lt;/span&gt;: producer&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;endmodule &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//-----------------------------------------&lt;br /&gt;//File : consumer.cpp&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//SystemC Consumer&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//-----------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #8e7cc3;&quot;&gt;#include&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;&quot;ml_uvm.h&quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #8e7cc3;&quot;&gt;#include&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;&quot;uvm.h&quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: red;&quot;&gt;using &lt;/span&gt;&lt;span style=&quot;color: lime;&quot;&gt;namespace &lt;/span&gt;tlm;&lt;br /&gt;&lt;span style=&quot;color: red;&quot;&gt;using &lt;/span&gt;&lt;span style=&quot;color: lime;&quot;&gt;namespace &lt;/span&gt;uvm;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;span style=&quot;color: lime;&quot;&gt;class &lt;/span&gt;packet : &lt;span style=&quot;color: red;&quot;&gt;public &lt;/span&gt;uvm_object&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; UVM_OBJECT_UTILS(packet)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;public&lt;/span&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;int &lt;/span&gt;data;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;UVM_OBJECT_REGISTER(packet)&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//System C Consumer with templated with data type T&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: lime;&quot;&gt;template &lt;/span&gt;&amp;lt;&lt;span style=&quot;color: lime;&quot;&gt;typename &lt;/span&gt;T&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: lime;&quot;&gt;class &lt;/span&gt;consumer : &lt;span style=&quot;color: red;&quot;&gt;public &lt;/span&gt;uvm_compnent, &lt;span style=&quot;color: red;&quot;&gt;public &lt;/span&gt;tlm_analysis_if&lt;t&gt;&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;public&lt;/span&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sc_export&lt;tlm::tlm_analysis_if&gt; &amp;gt; in;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//constructor&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; consumer(sc_module_name nm) : uvm_component(nm), in(&lt;span style=&quot;color: magenta;&quot;&gt;&quot;in&quot;&lt;/span&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in(*&lt;span style=&quot;color: red;&quot;&gt;this&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//Register the export for mixed language communication&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ml_uvm::ml_uvm_register(&amp;amp;in);&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; UVM_COMPONENT_UTILS(consumer)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//export implementation&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: lime;&quot;&gt;virtual void &lt;/span&gt;write( &lt;span style=&quot;color: lime;&quot;&gt;const &lt;/span&gt;T&amp;amp; t )&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cout &amp;lt;&amp;lt; sc_time_stamp() &amp;lt;&amp;lt; &lt;span style=&quot;color: magenta;&quot;&gt;&quot; SystemC consumer receive a packet with data &quot;&lt;/span&gt; &amp;lt;&amp;lt; t.data &amp;lt;&amp;lt; endl;&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;UVM_COMPONENT_REGISTER_T(consumer, packet)&lt;/tlm::tlm_analysis_if&gt;&lt;/t&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;//System C testbench&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
SC_MODULE(TB)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; consumer&lt;packet&gt; c;&lt;br /&gt;&amp;nbsp;&amp;nbsp; SC_CTOR(TB) : c(&lt;span style=&quot;color: magenta;&quot;&gt;&quot;consumer&quot;&lt;/span&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt; //Connect multi language port and export&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ml_uvm::ml_uvm_connect(&lt;span style=&quot;color: magenta;&quot;&gt;&quot;producer.out&quot;&lt;/span&gt;, cons.in.name());&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;};&lt;/packet&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;u&gt;&lt;b&gt;Output Log:&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
UVM_INFO producer.sv(55) @ 0: producer [TEST] producer.pkt.data=&#39;h00000008&lt;br /&gt;0 s SC consumer got a packet with data 8&lt;br /&gt;UVM_INFO producer.sv(55) @ 10: producer [TEST] producer.pkt.data=&#39;h00000008&lt;br /&gt;10 ns SC consumer got a packet with data 8&lt;br /&gt;UVM_INFO producer.sv(55) @ 20: producer [TEST] producer.pkt.data=&#39;h00000003&lt;br /&gt;20 ns SC consumer got a packet with data 3 &lt;br /&gt;UVM_INFO producer.sv(55) @ 30: producer [TEST] producer.pkt.data=&#39;h00000005&lt;br /&gt;30 ns SC consumer got a packet with data 5 &lt;br /&gt;UVM_INFO producer.sv(55) @ 40: producer [TEST] producer.pkt.data=&#39;h00000006&lt;br /&gt;40 ns SC consumer got a packet with data 6&lt;br /&gt;&lt;br /&gt;&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/156723559974917064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/156723559974917064?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/156723559974917064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/156723559974917064'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2013/09/uvm-multi-language-solution-from-cadence.html' title='UVM-Multi Language solution from Cadence'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-3718647516880762552</id><published>2013-09-25T15:35:00.000+05:30</published><updated>2013-09-25T17:46:16.530+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bidirectional Ports"/><category scheme="http://www.blogger.com/atom/ns#" term="Example"/><category scheme="http://www.blogger.com/atom/ns#" term="System Verilog"/><category scheme="http://www.blogger.com/atom/ns#" term="UVM"/><title type='text'>UVM bidirectional port example using uvm_tlm_b_initiator_socket and uvm_tlm_b_target_socket ports</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
In your System Verilog UVM environment, sometimes you want few components to communicate to each other in both ways. For example, a master component can request a memory component to pass over the memory content of specific address. So, how can you impelent such a communication channel between two components? Well, there are multiple ways. You can have two one-directional ports like uvm_get_ports and uvm_put_ports. Initator can send the address through output port and receives the data from another input port. Or it can be implemented through mailbox. The other way to implement is to use&lt;b&gt; &lt;a href=&quot;https://verificationacademy.com/verification-methodology-reference/uvm/docs_1.1a/html/files/tlm2/uvm_tlm2_sockets-svh.html&quot;&gt;uvm_tlm_b_initiator_socket&lt;/a&gt;&lt;/b&gt; and &lt;b&gt;&lt;a href=&quot;https://verificationacademy.com/verification-methodology-reference/uvm/docs_1.1a/html/files/tlm2/uvm_tlm2_sockets-svh.html&quot;&gt;uvm_tlm_b_target_socket&lt;/a&gt;&lt;/b&gt; ports. Using this port, you initiator can send a packet with specific address. Same packet can be updated with data by the memory element and later on can be read by initiator. Thus, by using single port and packet, two elements can communicate with each other in bidirectional way. Since this is a blocking port, request information and response information should come in a single shot. Here is an example to illustrate it. You can download the full examples by clicking &lt;a href=&quot;https://googledrive.com/host/0B3V8pFvS15vyb0swbU5QandycDA/uvm_bidirectional_port_example.tar.gz&quot;&gt;uvm_bidirectional_port_example.tar.gz&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//Memory cell definition&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;class &lt;/span&gt;mem_cell &lt;span style=&quot;color: red;&quot;&gt;extend &lt;/span&gt;umv_sequence_item;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;rand bit &lt;/span&gt;[1:0]&amp;nbsp; addr;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;rand bit &lt;/span&gt;[31:0] data;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;endclass&lt;/span&gt;: mem_cell&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//Memory component definition&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;class &lt;/span&gt;memory &lt;span style=&quot;color: red;&quot;&gt;extends &lt;/span&gt;uvm_component;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//Define local memory&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;local bit &lt;/span&gt;[31:0] mem [3:0];&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;function new&lt;/span&gt;(&lt;span style=&quot;color: red;&quot;&gt;string &lt;/span&gt;name = &quot;memory&quot;, uvm_component parent = &lt;span style=&quot;color: red;&quot;&gt;null&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;super&lt;/span&gt;.&lt;span style=&quot;color: red;&quot;&gt;new&lt;/span&gt;(name, parent);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; socket = &lt;span style=&quot;color: red;&quot;&gt;new&lt;/span&gt;(&quot;socket&quot;, &lt;span style=&quot;color: red;&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//Initialize the local memory&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mem[0] = 32&#39;h00000000;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mem[1] = 32&#39;h11111111;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mem[2] = 32&#39;h22222222;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mem[3] = 32&#39;h33333333;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;endfunction &lt;/span&gt;: &lt;span style=&quot;color: red;&quot;&gt;new&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//Declare blocking target socket port&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; uvm_tlm_b_target_socket #(memory, mem_cell) socket;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//Need to write implementation of b_transport() task&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;task &lt;/span&gt;b_transport(mem_cell req, uvm_tlm_time delay);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//Based on the req.addr, update the req.data which will be later read back by initiator&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;case &lt;/span&gt;(req.addr)&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&#39;h0 : &lt;span style=&quot;color: red;&quot;&gt;begin &lt;/span&gt;req.data = mem[0]; &lt;span style=&quot;color: red;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&#39;h1 : &lt;span style=&quot;color: red;&quot;&gt;begin &lt;/span&gt;req.data = mem[0]; &lt;span style=&quot;color: red;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&#39;h2 : &lt;span style=&quot;color: red;&quot;&gt;begin &lt;/span&gt;req.data = mem[0]; &lt;span style=&quot;color: red;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&#39;h3 : &lt;span style=&quot;color: red;&quot;&gt;begin &lt;/span&gt;req.data = mem[0]; &lt;span style=&quot;color: red;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;endcase&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;endtask &lt;/span&gt;: b_transport&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;endclasss &lt;/span&gt;: memory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;class &lt;/span&gt;initiator &lt;span style=&quot;color: red;&quot;&gt;extend &lt;/span&gt;uvm_component&#39;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//Declare blocking transport socket port&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; uvm_tlm_b_transport_socket #(mem_cell) socket;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;virtual task &lt;/span&gt;run_phase(uvm_phase phase);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//instantiate a mem_cell&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mem_cell req;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uvm_tlm_time delay = &lt;span style=&quot;color: red;&quot;&gt;new&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; phase.raise_objection(&lt;span style=&quot;color: red;&quot;&gt;this&lt;/span&gt;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//Create mem_cell&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; req = mem_cell::type_id::create(&quot;req&quot;, , get_full_name());&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//set address and sent it across to memory component&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; req.addr = 2&#39;h0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; socket.b_transport(req, delay);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//memory element has now updated the req.data accordingly. it can be used now&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;span style=&quot;background-color: #8e7cc3;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt; &lt;span style=&quot;color: #674ea7;&quot;&gt;`uvm_info&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;(&quot;TEST&quot;, &lt;span style=&quot;color: #674ea7;&quot;&gt;$sformat&lt;/span&gt;(f(&quot;For req.add=&#39;h%h, received req.data=&#39;h%h&quot;, req.addr, req.data), UVM_LOW);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//same object can be reused.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;//set address and sent it across to memory component&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; req.addr = 2&#39;h1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; socket.b_transport(req, delay);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt; //memory element has now updated the req.data accordingly. it can be used now&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #674ea7;&quot;&gt;`uvm_info&lt;/span&gt;(&quot;TEST&quot;, &lt;span style=&quot;color: #674ea7;&quot;&gt;$sformatf&lt;/span&gt;(&quot;For req.add=&#39;h%h, received req.data=&#39;h%h&quot;, req.addr, req.data), UVM_LOW);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; phase.drop_objection(this);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;endtask &lt;/span&gt;: run_phase&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;endclass &lt;/span&gt;: initator&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;class &lt;/span&gt;env &lt;span style=&quot;color: red;&quot;&gt;extends &lt;/span&gt;uvm_component;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; initiator init;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; memory &amp;nbsp; mem;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; //Connect two ports&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;function void &lt;/span&gt;connect_phase(uvm_phase phase)&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; init.socket.connect(mem.socket); &lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;endfunction&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;endclass&lt;/span&gt; : env&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;u&gt;&lt;b&gt;Log Output:&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
UVM_INFO initiator.sv(22) @ 10: env.init [TESTCASE] For req.add=&#39;h0 received&amp;nbsp; req.data=&#39;h00000000 &lt;br /&gt;
UVM_INFO initiator.sv(26) @ 20: env.init [TESTCASE] For req.add=&#39;h1 received&amp;nbsp; req.data=&#39;h11111111 &lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can refer &lt;a href=&quot;http://www.accellera.org/downloads/standards/uvm/uvm_users_guide_1.1.pdf&quot;&gt;UVM User Guide 1.1&lt;/a&gt;&lt;b&gt;&lt;a href=&quot;http://www.accellera.org/downloads/standards/uvm/uvm_users_guide_1.1.pdf&quot;&gt; &lt;/a&gt;&lt;/b&gt;from &lt;a href=&quot;http://www.accellera.org/community/uvm&quot;&gt;http://www.accellera.org/community/uvm&lt;/a&gt;&lt;b&gt; &lt;/b&gt;for more details about these ports.&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/3718647516880762552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/3718647516880762552?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/3718647516880762552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/3718647516880762552'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2013/09/uvm-bidirectional-port-example-using.html' title='UVM bidirectional port example using uvm_tlm_b_initiator_socket and uvm_tlm_b_target_socket ports'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-1886720101720840314</id><published>2012-02-29T16:25:00.007+05:30</published><updated>2012-02-29T17:44:31.762+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Coverage"/><category scheme="http://www.blogger.com/atom/ns#" term="Sample Codes"/><category scheme="http://www.blogger.com/atom/ns#" term="Utility"/><title type='text'>Automatic Coverage Weight Calculator Utility</title><content type='html'>&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } div.indent5      {text-indent:100px; } div.indent6      {text-indent:120px; } --&lt;/style&gt;If you want to get Specman coverage number in linear fashion (i.e. coverage numbers = (total buckets hit) / (total buckets in valid space) ), then you need to set the weight of individual items and coverage groups properly. Updating the code for proper weights to each item and cover group is tedious and error prone task. Maintaining the code is also a problem. What if you can do it automatically by using Coverage API? I hope people, who are looking such kind of solution will benefit from this post.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Specman overall coverage grade is calculated in hierarchical manner by default. It means that coverage is calculated from leaf level to the top level in following manner. I&#39;ve assumed that weight is not set manually and default weight value 1 is applied here.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;ol style=&quot;text-align: justify;&quot;&gt;&lt;li&gt;Individual item grade is calculated by dividing buckets hit by total bucket for that item.&lt;/li&gt;&lt;li&gt;Individual cover group grade is calculated by dividing total of all items grade by total number of items&lt;/li&gt;&lt;li&gt;Overall coverage grade is calculated by dividing total of all cover groups graade by total number of cover groups&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Take a look at the following example code.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;codefrag&quot;&gt; &lt;div class=&quot;indent1&quot;&gt;&amp;lt;&#39;&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;extend sys&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;config : config_s;&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;struct config_s&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;a : uint(bits: 3);&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;b : uint(bits: 3);&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;c : bool;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;event cov1_e;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;event cov2_e;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;cover cov1_e is&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;item a using ignore = (a in [0, 1, 7, 8]);&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;item b using ignore = (b in [0, 1, 7, 8]);&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;cross a, b using&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;ignore =&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;(a in [2] and b in [4]) or&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;(a in [4] and b in [2] );&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;cover cov2_e is&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;item a using ignore = (a in [0, 1, 7, 8]);&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;item c using ignore = (c == TRUE);&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;cross a, c;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;keep soft a == select&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;40 : 2;&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;10 : 3;&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;40 : 4;&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;10 : 5;&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;10 : 6;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;keep soft b == select&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;40 : 2;&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;10 : 3;&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;40 : 4;&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;10 : 5;&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;10 : 6;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;keep soft c == TRUE;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;run() is also&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;for i from 1 to 10&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;gen a; gen b; gen c;&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;emit cov1_e;&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;emit cov2_e;&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;outf (&quot;a=%d b=%d c=%s\n&quot;, a, b, c);&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;&#39;&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;When you run the above code with Intelligen with seed 1, Specman generates following combinations of a, b and c.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;a=4   b=4  c=TRUE&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;a=4   b=4  c=TRUE&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;a=4   b=3  c=TRUE&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;a=2   b=2  c=TRUE&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;a=6   b=2  c=TRUE&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br  style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;a=2   b=4  c=TRUE&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br  style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;a=2   b=2  c=TRUE&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br face=&quot;courier new&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;a=2   b=4  c=TRUE&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br face=&quot;courier new&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;a=2   b=2  c=TRUE&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br face=&quot;courier new&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;a=4   b=6  c=TRUE&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Let&#39;s analyze the coverage now.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width=&quot;15%&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Item&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;10%&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Hit&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;20%&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Valid Space&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Grade&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;a&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;60.00% (hit/valid space)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;b&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;4&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;80.00% (hit/valid space)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;cross_a_b&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;23&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;21.74% (hit/valid space)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;So, cov1_e cover group&#39;s grade = (grade of item a*weight + grade of item b*weight + grade of item cross_a_b*weight)/3 = 1.6174/3 = 53.91 %&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width=&quot;15%&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Item&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;10%&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Hit&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;20%&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Valid Space&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Grade&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;a&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;60.00% (hit/valid space)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;c&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;100.00% (hit/valid space)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;cross_a_c&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;60.00% (hit/valid space)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;So, cov2_e cover group&#39;s grade = (grade of item a + grade of item c + grade of item cross_a_c)/3 = 2.20/3 = 73.33 %&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;So, overall grade = (cov1_e grade + cov2_grade)/2 = 1.2725/2 = 63.62 %&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;But, if you need the linear coverage, it should be&lt;br /&gt;(Total number of hit buckets) / (Total number of buckets in valid space) = ((3+4+5) + (3+1+3))/((5+5+23) + (5+1+5)) =&lt;span style=&quot;font-weight: bold;&quot;&gt; 43.18 %&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;This can be achieved by adjusting the weitage of individual item and cover group. If you set the weight of each item equal to the total number of valid buckets, linear coverage is achieved. Let&#39;s see how it works.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width=&quot;15%&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Item&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;10%&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Hit&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;20%&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Valid Space&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;10%&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Weight&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Grade&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;a&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;60.00 % (hit/valid space)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;b&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;4&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;80.00 % (hit/valid space)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;cross_a_b&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;23&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;23&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;21.74 % (hit/valid space)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;br /&gt;So, cov1_e cover group&#39;s grade = (grade of item a*weight + grade of item b*weight + grade of item cross_a_b*weight)/(weight of a + weight of b + weight of cross_a_b) = (3 + 4 + 5) / (5 + 5 + 23) = 36.36 %&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width=&quot;15%&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Item&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;10%&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Hit&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;20%&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Valid Space&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;10%&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Weight&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;Grade&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;a&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;60.00 % (hit/valid space)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;c&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;80.00 % (hit/valid space)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;cross_a_c&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;21.74 % (hit/valid space)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;br /&gt;So, cov2_e cover group&#39;s grade = (grade of item a*weight + grade of item c*weight + grade of item cross_a_c*weight)/(weight of a + weight of c + weight of cross_a_c) = (3 + 1 + 3) / (5 + 1 + 5) = 63.64 %&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;So, overall grade = (cov1_e grade*weight + cov2_grade*weight)/(weight of cov1_e + weight of cov2_e) = (12+7)/(33+11) = 43.18%&lt;br /&gt;&lt;br /&gt;This number looks linear as we can see we&#39;ve calculated the coverage based on the number of buckets hit divided by total number of bucket for whole of the coverage space. So, setting the weight of the items based its number of buckets, it gives us the correct result.&lt;br /&gt;&lt;br /&gt;Setting the weight manually is tedious process as you need to check the exact number of valid buckets of each item and coverage groups by keeping ignores and ranges into the mind. And even you do that, if you want to change the coverage model again, you might need to calculate the valid space again which is tedious and error prone. So, why not automate it using Coverage API calls?&lt;br /&gt;&lt;br /&gt;You can use this small utility which uses coveage API to change the weight of all the items and cover group. It gives you the linear overall grade which is total number of buckets hit in valid coverage space divided by total number of buckets in valid coverage space. This utility can also be used in the post processing of coverage database. This utility uses coverage API to recursively parse the whole coverage space of a given unit which can be sys. It counts the total number of buckets of each item and coverage group and uses covers.set_weight() to set the weight of items and cover groups recursively.&lt;br /&gt;&lt;br /&gt;You can use it after loading the linear_coverage.e. It defines a specman command using &quot;define as&quot; macro. Example is given below&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Specman&amp;gt;load linear_coverage.e&lt;/span&gt;&lt;br face=&quot;courier new&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Specman&amp;gt;adjust weight sys (for whole coverage space)&lt;/span&gt;&lt;br face=&quot;courier new&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Specman&amp;gt;adjust weight config_s (for coverage space defined in config_s struct)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;I hope this will help you. Your comments and thoughts are welcome.&lt;br /&gt;&lt;/div&gt;&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;&lt;br /&gt;&lt;div class=&quot;indent1&quot;&gt;-------------------------------------------&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;liner_coverage.e&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;-------------------------------------------&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt; &lt;div class=&quot;indent1&quot;&gt;&amp;lt;&#39;&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;define &quot;adjust weight &quot; as {&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;sys.adjust_weight = new;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;sys.adjust_weight.main(&quot;&amp;lt;1&amp;gt;&quot;);&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;indent1&quot;&gt;struct cover_info&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;item_name : string;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;num_of_buckets: uint;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;weight : uint;&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;indent1&quot;&gt;struct bucket_cover_struct like user_cover_struct&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;collect: bool; // flag to skip specific item&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;cover_info : list (key: item_name) of cover_info;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;indent2&quot;&gt;main(items: string) is&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;if scan_cover(items) == 0 {&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;error(&quot;Adjust Weight Error: no cover items matching &quot;, items,&quot; exist&quot;);&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;};&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;indent2&quot;&gt;scan_bucket() is&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;if ((collect) and (cross_level == sub_items.size()-1)) then&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;var full_item_name := appendf (&quot;%s.%s.%s&quot;, struct_name, group_name, item_name);&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;if (status in [hole, normal])&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent5&quot;&gt;if cover_info.key_exists(full_item_name)&lt;/div&gt; &lt;div class=&quot;indent5&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent6&quot;&gt;cover_info.first(.item_name == full_item_name).num_of_buckets = cover_info.first(.item_name == full_item_name).num_of_buckets + 1;&lt;/div&gt; &lt;div class=&quot;indent5&quot;&gt;}&lt;/div&gt; &lt;div class=&quot;indent5&quot;&gt;else&lt;/div&gt; &lt;div class=&quot;indent5&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent6&quot;&gt;var temp_cov_info : cover_info = new;&lt;/div&gt; &lt;div class=&quot;indent6&quot;&gt;temp_cov_info.item_name = full_item_name;&lt;/div&gt; &lt;div class=&quot;indent6&quot;&gt;temp_cov_info.num_of_buckets = 1;&lt;/div&gt; &lt;div class=&quot;indent6&quot;&gt;cover_info.add(temp_cov_info);&lt;/div&gt; &lt;div class=&quot;indent5&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;};&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;indent2&quot;&gt;// Output a line of text for item:&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;end_item() is&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;if collect then&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;var full_item_name := appendf (&quot;%s.%s.%s&quot;, struct_name, group_name, item_name);&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;var num_of_buckets := cover_info.first(.item_name == full_item_name).num_of_buckets;&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;outf (&quot;%s - %d (weight=%d)\n&quot;, full_item_name, num_of_buckets, item_weight);&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;covers.set_weight(full_item_name, num_of_buckets, FALSE);&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;};&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;indent2&quot;&gt;start_group() is&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;collect = (struct_name != &quot;session&quot;);//skip session struct&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;if collect then&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;outf (&quot;\n------------------------------------\n&quot;);&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;};&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;indent2&quot;&gt;end_group() is&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;if collect then&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;var group_total : uint;&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;for each (cov_info) in (cover_info)&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent5&quot;&gt;group_total = group_total + cov_info.num_of_buckets;&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;outf (&quot;------------------------------------\n&quot;);&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;outf (&quot;Group and Total Buckets ---&amp;gt; %s - %d (weight=%d)\n&quot;, group_name, group_total, group_weight);&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;covers.set_weight(appendf(&quot;%s.%s&quot;, struct_name, group_name), group_total, FALSE);&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;outf (&quot;------------------------------------\n&quot;);&lt;/div&gt; &lt;div class=&quot;indent4&quot;&gt;cover_info.clear();&lt;/div&gt; &lt;div class=&quot;indent3&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;};&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;indent2&quot;&gt;// Define an instance of bucket_cover_struct:&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;extend sys&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;!adjust_weight: bucket_cover_struct;&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;init() is also { adjust_weight = new; };&lt;/div&gt; &lt;div class=&quot;indent2&quot;&gt;setup() is also { set_config(cover, show_sub_holes, TRUE); };&lt;/div&gt; &lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;indent1&quot;&gt;&#39;&amp;gt;&lt;/div&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/1886720101720840314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/1886720101720840314?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/1886720101720840314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/1886720101720840314'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2012/02/automatic-coverage-weight-calculator.html' title='Automatic Coverage Weight Calculator Utility'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-3783340436061093436</id><published>2010-06-24T22:35:00.002+05:30</published><updated>2010-06-24T22:39:17.367+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="News"/><title type='text'>Cadence&#39;s Labs on Cloud</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;Have you ever wanted to try out any Cadence tools or VIPs evaluation without going through the process of getting evaluation licenses, software download and installation and all that logistic stuff? Now you can do all that without all that hassles. Cadence has tied with Xuropa for their cloud computing platform so that all you need is high speed broadband for any Cadence tools/VIPs  evaluation.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Using &lt;a href=&quot;http://www.xuropa.com/company.php?comp_id=35&quot;&gt;Xuropa Online Labs&lt;/a&gt;, you can run an evaluation using the Incisive Enterprise simulator, following instructions for a self-paced demo. All the software runs on Xuropa servers, and there is nothing to purchase, license, install, download, or upload.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;You can read more about it at at &lt;a href=&quot;http://www.cadence.com/Community/blogs/ii/archive/2009/09/30/cadence-s-xuropa-experience-a-new-approach-to-ip-evaluation.aspx&quot;&gt;Cadence&#39;s Community Blog Post&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/3783340436061093436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/3783340436061093436?isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/3783340436061093436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/3783340436061093436'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2010/06/cadences-labs-on-cloud.html' title='Cadence&#39;s Labs on Cloud'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-8345174297886254782</id><published>2010-05-08T16:40:00.002+05:30</published><updated>2010-05-08T16:53:27.824+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Utility"/><title type='text'>Generic/Parameter support in Mixed HDL Hierarchy Code Generator</title><content type='html'>I hope this small utility is helpful. I&#39;ve thought one small enhancement to it. Now, you can select whether you need VHDL Generic or Verilog Parameterized examples code by selecting the checkbox. Please feel free to comment/enhancement. You can visit &lt;a href=&quot;http://www.sandipgor.com/hdl_gen.html&quot;&gt;http://www.sandipgor.com/hdl_gen.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/8345174297886254782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/8345174297886254782?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/8345174297886254782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/8345174297886254782'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2010/05/genericparameter-support-in-mixed-hdl.html' title='Generic/Parameter support in Mixed HDL Hierarchy Code Generator'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-8608532268498833469</id><published>2010-04-09T18:38:00.004+05:30</published><updated>2010-04-09T18:50:09.861+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Utility"/><title type='text'>Mixed HDL Hierarchy Code Generator</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;Sometime back, I wanted to experiment Specman environment with Mixed HDL (Verilog + VHDL) design. I wanted to have a simple 4 level hierarchical design with simple port connections. It took some time for me  to build it as I need to refer VHDL and Verilog syntax. That time one thought came to my mind to have simple utility which can build this env very quickly so that I don&#39;t need to invest time to clean up the compilation errors.&lt;br /&gt;&lt;br /&gt;Keeping this simple requirement in mind, I decided to build such a simple online tool which can be used by everybody.&lt;br /&gt;&lt;br /&gt;I&#39;ve created one Javascript based tool which can generate Mixed HDL Hierarchical design.Its link is &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.sandipgor.com/hdl_gen.html&quot;&gt;http://www.sandipgor.com/hdl_ gen.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I&#39;ve tried to keep it simple. You can use &quot;Add VHDL&quot; and &quot;Add Verilog&quot; buttons to add VHDL or Verilog instance into hierarchy. &quot;Level Up&quot; and &quot;Level Down&quot; buttons can be used to increase/decrease current level where you want to add instances. Finally &quot;Generate&quot; button can be used to dump the hierarchical HDL code into the two text box placed right side of the window. I&#39;ve also kept &quot;Clear Code&quot; and &quot;Clear Hierarchy&quot; buttons to clean up the relevent data. &quot;Undo&quot; button is useful  to undo the last change. Remember, there is no &quot;Redo&quot; button though.&lt;br /&gt;&lt;br /&gt;I hope you will find it useful. Please feel free to use it.&lt;br /&gt;&lt;br /&gt;Any  suggestion/feedback is welcome.&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/8608532268498833469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/8608532268498833469?isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/8608532268498833469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/8608532268498833469'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2010/04/mixed-hdl-hierarchy-code-generator.html' title='Mixed HDL Hierarchy Code Generator'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-3048179219006747098</id><published>2009-07-10T11:30:00.002+05:30</published><updated>2009-07-10T11:36:54.312+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="News"/><title type='text'>DigitalVerification Blog is noticed by Verification Community</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;I am glad and thankful to the verification community for appreciating my small contribution towards the verification world. This blog has been noticed by &lt;a href=&quot;http://www.cadence.com/Community/blogs/fv/archive/2009/07/03/another-new-blog-on-e-specman.aspx?postID=18901&quot;&gt;Cadence Team Specman&lt;/a&gt; and recoginized as useful resource.&lt;br /&gt;&lt;a href=&quot;http://chipdesignmag.com/sld/blog/2009/07/08/blog-review-july-8/&quot;&gt;ChipDesignMag.com&lt;/a&gt; also recognized this blog saying &quot;if you live and breathe in this world, here’s an additional resource&quot;&lt;br /&gt;I&#39;ll keep posting and contributing to the verification world.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/3048179219006747098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/3048179219006747098?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/3048179219006747098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/3048179219006747098'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2009/07/digitalverification-blog-is-noticed-by.html' title='DigitalVerification Blog is noticed by Verification Community'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-920170340464156012</id><published>2009-06-25T12:50:00.015+05:30</published><updated>2009-06-25T14:42:06.300+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="IntelliGen"/><title type='text'>IntelliGen - Introduction</title><content type='html'>&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;IntelliGen is around for quite a while, but I&#39;ve observed that most of the Specman users are less interested in/aware of it. Probably they are very comfortable with old generation engine known as PGen. Even I am quite comfortable with PGen and I am used to think generation in PGen way. But, when I went through IntelliGen, it also looked conviencing. But it will take some time to penetrate and Cadence has to push it hard so that people start thinking about generation IntelliGen way. :)&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;IntelliGen is a new generation engine introduced in Specman 6.1 version onwards. It is a new generation engine which uses different generation algorithm from Specman&#39;s original generation engine PGen. Though PGen remains default generation engine, user can switch to IntelliGen by setting a configuration flag before loading any code.&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;Specman&gt;config gen -default_generator=IntelliGen&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;IntelliGen is easier to use as there is no generation dependencies on the fields declaration order. In PGen, fields which are declared first are generated first unless there are specific generation order mentioned using &quot;keep gen before&quot; or &quot;readonly()&quot;. With a new and powerful debugger, its very easy to debug generation errors for IntelliGen. The messages which are displayed when any generation errors occur are more informative than whatever is displayed for PGen. Cadence also claims that performance can be increased by 2 to 5 times compared to PGen. IntelliGen solves some constraint more logically and intelligently compared to PGen. We will see all these in few examples.&lt;/div&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Generation Order Independence&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;In the code shown below, we want to generate &lt;i&gt;addr&lt;/i&gt; based on &lt;i&gt;addr_hi_lo&lt;/i&gt; value. So you put constraint over &lt;i&gt;addr_hi_lo&lt;/i&gt; and &lt;i&gt;addr&lt;/i&gt;. But since &lt;i&gt;addr&lt;/i&gt; is declared first, it will be generated first in PGen generation engine. Due to that, there are very little chance that it is either equal to &lt;i&gt;addr_hi&lt;/i&gt; or &lt;i&gt;addr_lo&lt;/i&gt;. So, either of the constraint on &lt;i&gt;addr_hi_lo&lt;/i&gt; does not satisfy and PGen will not be able to solve it. Though the constraint is bidirectional, since &lt;i&gt;addr&lt;/i&gt; is declared first, it is generated first and that makes constraint unidirectional.&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Same code will not cause any generation error if IntelliGen is used because, there is not generation dependency on declaration order.&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;&lt;&#39;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;define addr_hi 0xFF;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;define addr_lo 0x05;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;type addr_kind : [LO, HI];&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;extend sys&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     addr       : list of uint (bits: 8);&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     addr_hi_lo : addr_kind;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          keep addr.size() == 10;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          keep for each in (addr)&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          {&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent4&quot;&gt;               addr_hi_lo == HI =&gt; it == addr_hi;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent4&quot;&gt;               addr_hi_lo == LO =&gt; it == addr_lo;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          };&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     post_generate() is also { print addr; };&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;&#39;&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;u&gt;Results with PGen:&lt;/u&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;br /&gt;*** Error: Contradiction:&lt;br /&gt;A contradiction has occurred when generating sys-@0.addr_hi_lo :&lt;br /&gt;Previous constraints reduced its range of possible values,&lt;br /&gt; then the following constraint contradicted these values:&lt;br /&gt;   addr_hi_lo == LO =&gt; it == addr_lo;                 at line 20 in @temp&lt;br /&gt; Reduced: sys-@0.addr_hi_lo into []&lt;br /&gt;To see details, reload and rerun with &quot;collect gen&quot;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;u&gt;Results with IntelliGen:&lt;/u&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;br /&gt;addr =  (10 items, dec):&lt;br /&gt;           5   5    5   5   5   5    5   5   5   5   .0&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Better Solvability&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;Further to that, IntelliGen takes good care of &lt;i&gt;soft&lt;/i&gt; and &lt;i&gt;soft select&lt;/i&gt; constraints. When &lt;i&gt;soft select&lt;/i&gt; constraints are added for a field which already has &lt;i&gt;soft&lt;/i&gt; constraint defined previously, PGen will ignore all the previously defined &lt;i&gt;soft&lt;/i&gt; constraints even there are no contradiction between &lt;i&gt;soft&lt;/i&gt; and &lt;i&gt;soft select&lt;/i&gt; constraints. Whereas IntelliGen takes care of both constraints as long as they do not contradict. If they contradict, then IntelliGen ignores &lt;i&gt;soft&lt;/i&gt; constraint over &lt;i&gt;soft select&lt;/i&gt;. Take a look at the following example and results generated using PGen and IntelliGen.&lt;br /&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;&lt;&#39;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;type addr_kind : [LO, HI, OTHERS];&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;struct operation_s&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     addr_hi_lo : addr_kind;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          keep soft addr_hi_lo in [HI, LO];&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;extend operation_s&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     keep soft addr_hi_lo == select&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     {&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          10 : LO;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          80 : OTHERS;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          10 : HI;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     };&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;extend sys&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     op : list of operation_s;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          keep op.size() == 10;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     post_generate() is also { print op; };&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;u&gt;Results with PGen:&lt;/u&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;br /&gt;op =&lt;br /&gt;item   type        addr_hi_lo&lt;br /&gt;                                                             &lt;br /&gt;0.     operation*  OTHERS&lt;br /&gt;1.     operation*  OTHERS&lt;br /&gt;2.     operation*  OTHERS&lt;br /&gt;3.     operation*  OTHERS&lt;br /&gt;4.     operation*  HI&lt;br /&gt;5.     operation*  OTHERS&lt;br /&gt;6.     operation*  OTHERS&lt;br /&gt;7.     operation*  HI&lt;br /&gt;8.     operation*  HI&lt;br /&gt;9.     operation*  OTHERS&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;u&gt;Results with IntelliGen:&lt;/u&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;br /&gt;op =&lt;br /&gt;item   type        addr_hi_lo&lt;br /&gt;                                                             &lt;br /&gt;0.     operation*  LO&lt;br /&gt;1.     operation*  LO&lt;br /&gt;2.     operation*  HI&lt;br /&gt;3.     operation*  HI&lt;br /&gt;4.     operation*  LO&lt;br /&gt;5.     operation*  HI&lt;br /&gt;6.     operation*  HI&lt;br /&gt;7.     operation*  LO&lt;br /&gt;8.     operation*  LO&lt;br /&gt;9.     operation*  LO&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Better Distribution&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;Because of improved constraint solving ability, IntelliGen gives better distribution of generated values within the range.&lt;br /&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;&lt;&#39;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;define addr_hi 0xFF;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;define addr_lo 0x05;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;type op_kind : [LO, HI, OTHERS];&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;struct operation_s&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     addr     : uint (bits: 8);&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     op_hi_lo : op_kind;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          keep op_hi_lo == HI =&gt; addr == addr_hi;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          keep op_hi_lo == LO =&gt; addr == addr_lo;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          keep op_hi_lo == OTHERS =&gt; addr in [addr_lo+1..addr_hi-1];&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;extend sys&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     op : list of operation_s;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          keep op.size() == 10;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     post_generate() is also { print op; };&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;u&gt;Results with PGen:&lt;/u&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;br /&gt;op =&lt;br /&gt;item   type        addr        op_hi_lo&lt;br /&gt;                                                             &lt;br /&gt;0.     operation*  0x57        OTHERS&lt;br /&gt;1.     operation*  0x12        OTHERS&lt;br /&gt;2.     operation*  0x80        OTHERS&lt;br /&gt;3.     operation*  0xbe        OTHERS&lt;br /&gt;4.     operation*  0x7f        OTHERS&lt;br /&gt;5.     operation*  0x64        OTHERS&lt;br /&gt;6.     operation*  0x0f        OTHERS&lt;br /&gt;7.     operation*  0xab        OTHERS&lt;br /&gt;8.     operation*  0x6e        OTHERS&lt;br /&gt;9.     operation*  0xcd        OTHERS&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;u&gt;Results with IntelliGen:&lt;/u&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;br /&gt;op =&lt;br /&gt;item   type        addr        op_hi_lo&lt;br /&gt;                                                             &lt;br /&gt;0.     operation*  0xff        HI&lt;br /&gt;1.     operation*  0xc3        OTHERS&lt;br /&gt;2.     operation*  0xff        HI&lt;br /&gt;3.     operation*  0x05        LO&lt;br /&gt;4.     operation*  0x05        LO&lt;br /&gt;5.     operation*  0x05        LO&lt;br /&gt;6.     operation*  0x1d        OTHERS&lt;br /&gt;7.     operation*  0x6a        OTHERS&lt;br /&gt;8.     operation*  0x1a        OTHERS&lt;br /&gt;9.     operation*  0xff        HI&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Better Debug Information&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;When any generation error occurs, IntelliGen issues elaborated generation error message which is very useful to pin point the problematic area of the code. Look at the below code.&lt;br /&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;&lt;&#39;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;type addr_kind : [LO, HI, OTHERS];&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;struct operation_s&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     addr_hi_lo : addr_kind;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          keep addr_hi_lo in [HI, LO];&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;extend sys&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     op : list of operation_s;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          keep op.size() == 10;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     keep for each in (op)&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     {&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          index in [0]    =&gt; it.addr_hi_lo == LO;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          index in [1..8] =&gt; it.addr_hi_lo == OTHERS;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;          index in [9]    =&gt; it.addr_hi_lo == HI;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     };&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;     post_generate() is also { print op; };&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;&#39;&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;u&gt;Error Message with PGen:&lt;/u&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;br /&gt;*** Error: ERR_GEN_OR_WITH_NO_GEN_ALT: After static analysis, the following constraint&lt;br /&gt;consists of non-enforceable constraints only:&lt;br /&gt;   index in [1..8] =&gt; it.addr_hi_lo == OTHERS;      at line 19 in @temp&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;u&gt;Error Message with IntelliGen:&lt;/u&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;br /&gt;*** Error: Contradiction when generating sys&lt;br /&gt;&lt;br /&gt;No set of values exists for:&lt;br /&gt;op[0x0..0xffffffff].addr_hi_lo&lt;br /&gt;&lt;br /&gt;that obey the constraints:&lt;br /&gt;keep addr_hi_lo in [0x0..0x1]                   at line 7 in @temp ,&lt;br /&gt;index in [0x1..0x8] =&gt; it.addr_hi_lo == OTHERS    at line 19 in @temp&lt;br /&gt;&lt;br /&gt;with the input:&lt;br /&gt;index = 0x1&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;By now, you might have realized the improvement of IntelliGen over PGen. I hope this is useful basic information about IntelliGen. I&#39;ll cover IntelliGen Technical Concepts in my next post.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/920170340464156012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/920170340464156012?isPopup=true' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/920170340464156012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/920170340464156012'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2009/06/font-definitions-font-face-font.html' title='IntelliGen - Introduction'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-9165326051361480918</id><published>2009-06-15T10:57:00.009+05:30</published><updated>2009-06-15T11:26:20.672+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Books"/><title type='text'>Specman/Verification Books</title><content type='html'>&lt;style type=&quot;text/css&quot;&gt;&lt;!-- .Title    { background-color:#335577; color:white; text-align:center; font-size:28} .BookName { background-color:#558866; color:white; text-align:center; } .left     { background-color:#FFFFFF; color:black; text-align:left;   width:50} .right    { background-color:#FFFFFF; color:black; text-align:left} .RI       { background-color:#558866; color:white; text-align:center; font-size:10; font-family:courier} A.RI:link    {text-decoration: underline; color: white;} A.RI:visited {text-decoration: underline; color: white;} A.RI:active  {text-decoration: underline; color: white;} A.RI:hover   {text-decoration: underline; color: white;} --&gt;&lt;/style&gt; &lt;table border=1&gt;&lt;tr&gt;&lt;td class=&#39;Title&#39;&gt;&lt;h2&gt;Specman Books&lt;/h2&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt; &lt;table&gt; &lt;tr width=100&gt;&lt;td&gt;&lt;img border=1 src=&#39;http://sandipgor.googlepages.com/0131413090.jpg&#39; width=136 height=210&gt;&lt;/td&gt; &lt;td valign=&#39;top&#39; height=210 align=&#39;left&#39;&gt; &lt;table class=&#39;books_table&#39; width=230 height=210 border=0 cellpadding=1&gt; &lt;tr&gt;&lt;td class=&#39;BookName&#39; colspan=2&gt;&lt;b&gt;Design Verification with e&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Author :&lt;/b&gt;&lt;/td&gt;         &lt;td class=&#39;right&#39;&gt;Samir Palnitkar&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;ISBN&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;0131413090&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publisher&lt;/b&gt;&lt;/td&gt;        &lt;td class=&#39;right&#39;&gt;Prentice Hall Professional Technical Reference&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publish Date&lt;/b&gt;&lt;/td&gt;     &lt;td class=&#39;right&#39;&gt;Auguts, 2003&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Page&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;416&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;RI&#39;&gt;&lt;a target=_blank class=&#39;RI&#39; href=&#39;http://books.google.com.sg/books?id=Cr-t30K9vkwC&amp;printsec=frontcover&amp;dq=Design+Verification+with+e&#39;&gt;Preview&lt;/a&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &amp;nbsp; &lt;table&gt; &lt;tr width=100&gt;&lt;td&gt;&lt;img border=1 src=&#39;http://sandipgor.googlepages.com/1402080239.jpg&#39; width=136 height=210&gt;&lt;/td&gt; &lt;td valign=&#39;top&#39; height=210 align=&#39;left&#39;&gt; &lt;table class=&#39;books_table&#39; width=230 height=210 border=0 cellpadding=1&gt; &lt;tr&gt;&lt;td class=&#39;BookName&#39; colspan=2&gt;&lt;b&gt;The e-Hardware Verification Language&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Author :&lt;/b&gt;&lt;/td&gt;         &lt;td class=&#39;right&#39;&gt;Sasan Iman and Sunita Joshi&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;ISBN&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;1402080239&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publisher&lt;/b&gt;&lt;/td&gt;        &lt;td class=&#39;right&#39;&gt;Kluwer Academic Publishers&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publish Date&lt;/b&gt;&lt;/td&gt;     &lt;td class=&#39;right&#39;&gt;May, 2004&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Page&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;349&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;RI&#39;&gt;&lt;a target=_blank class=&#39;RI&#39; href=&#39;http://books.google.com.sg/books?id=YllldOOHB3AC&amp;printsec=frontcover&amp;dq=The+e-Hardware+Verification+Language&#39;&gt;Preview&lt;/a&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &amp;nbsp; &lt;table&gt; &lt;tr width=100&gt;&lt;td&gt;&lt;img border=1 src=&#39;http://sandipgor.googlepages.com/0123742102.jpg&#39; width=136 height=210&gt;&lt;/td&gt; &lt;td valign=&#39;top&#39; height=210 align=&#39;left&#39;&gt; &lt;table class=&#39;books_table&#39; width=230 height=210 border=0 cellpadding=1&gt; &lt;tr&gt;&lt;td class=&#39;BookName&#39; colspan=2&gt;&lt;b&gt;Aspect-Oriented Programming with the e Verification Language: A Pragmatic Guide for Testbench Developers&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Author :&lt;/b&gt;&lt;/td&gt;         &lt;td class=&#39;right&#39;&gt;David Robinson&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;ISBN&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;0123742102&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publisher&lt;/b&gt;&lt;/td&gt;        &lt;td class=&#39;right&#39;&gt;Morgan Kaufmann Publishers&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publish Date&lt;/b&gt;&lt;/td&gt;     &lt;td class=&#39;right&#39;&gt; August, 2007&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Page&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;244&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;RI&#39;&gt;&lt;a target=_blank class=&#39;RI&#39; href=&#39;http://books.google.com.sg/books?id=AnvXI-0d9hAC&amp;dq=Aspect-Oriented+Programming+with+the+e+Verification+Language:+A+Pragmatic+Guide+for+Testbench+Developers&#39;&gt;Preview&lt;/a&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &amp;nbsp; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;table border=1&gt;&lt;tr&gt;&lt;td class=&#39;Title&#39;&gt;&lt;h2&gt;Verification Books&lt;/h2&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt; &lt;table&gt; &lt;tr width=100&gt;&lt;td&gt;&lt;img border=1 src=&#39;http://sandipgor.googlepages.com/0387381511.jpg&#39; width=136 height=210&gt;&lt;/td&gt; &lt;td valign=&#39;top&#39; height=210 align=&#39;left&#39;&gt; &lt;table class=&#39;books_table&#39; width=230 height=210 border=0 cellpadding=1&gt; &lt;tr&gt;&lt;td class=&#39;BookName&#39; colspan=2&gt;&lt;b&gt;Metric Driven Design Verification: An Engineer&#39;s and Executive&#39;s Guide to First Pass Success&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Author :&lt;/b&gt;&lt;/td&gt;         &lt;td class=&#39;right&#39;&gt;Hamilton B. Carter; Shankar G. Hemmady&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;ISBN&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;0387381511&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publisher&lt;/b&gt;&lt;/td&gt;        &lt;td class=&#39;right&#39;&gt;Springer Verlag&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publish Date&lt;/b&gt;&lt;/td&gt;     &lt;td class=&#39;right&#39;&gt;May, 2007&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Page&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;361&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;RI&#39;&gt;&lt;a target=_blank class=&#39;RI&#39; href=&#39;http://books.google.com.sg/books?id=HgZWmY9TTVsC&amp;printsec=frontcover&amp;dq=Metric+Driven+Design+Verification:+An+Engineer%27s+and+Executive%27s+Guide+to+First+Pass+Success&#39;&gt;Preview&lt;/a&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &amp;nbsp; &lt;table&gt; &lt;tr width=100&gt;&lt;td&gt;&lt;img border=1 src=&#39;http://sandipgor.googlepages.com/1402074018.jpg&#39; width=136 height=210&gt;&lt;/td&gt; &lt;td valign=&#39;top&#39; height=210 align=&#39;left&#39;&gt; &lt;table class=&#39;books_table&#39; width=230 height=210 border=0 cellpadding=1&gt; &lt;tr&gt;&lt;td class=&#39;BookName&#39; colspan=2&gt;&lt;b&gt;Writing Testbenches: Functional Verification of HDL Models&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Author :&lt;/b&gt;&lt;/td&gt;         &lt;td class=&#39;right&#39;&gt;Janick Bergeron&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;ISBN&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;1402074018&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publisher&lt;/b&gt;&lt;/td&gt;        &lt;td class=&#39;right&#39;&gt;Kluwer Academic Publishers&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publish Date&lt;/b&gt;&lt;/td&gt;     &lt;td class=&#39;right&#39;&gt;February, 2003&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Page&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;512&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;RI&#39;&gt;&lt;a target=_blank class=&#39;RI&#39; href=&#39;http://books.google.com.sg/books?id=Fht_zBfoJQIC&amp;printsec=frontcover&amp;dq=Writing+Testbenches:+Functional+Verification+of+HDL+Models&#39;&gt;Preview&lt;/a&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &amp;nbsp; &lt;table&gt; &lt;tr width=100&gt;&lt;td&gt;&lt;img border=1 src=&#39;http://sandipgor.googlepages.com/0387286012.jpg&#39; width=136 height=210&gt;&lt;/td&gt; &lt;td valign=&#39;top&#39; height=210 align=&#39;left&#39;&gt; &lt;table class=&#39;books_table&#39; width=230 height=210 border=0 cellpadding=1&gt; &lt;tr&gt;&lt;td class=&#39;BookName&#39; colspan=2&gt;&lt;b&gt;Effective Functional Verification: Principles and Processes&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Author :&lt;/b&gt;&lt;/td&gt;         &lt;td class=&#39;right&#39;&gt;Srivatsa Vasudevan&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;ISBN&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;0387286012&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publisher&lt;/b&gt;&lt;/td&gt;        &lt;td class=&#39;right&#39;&gt;Springer Verlag&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publish Date&lt;/b&gt;&lt;/td&gt;     &lt;td class=&#39;right&#39;&gt;June, 2006&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Page&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;256&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;RI&#39;&gt;&lt;a target=_blank class=&#39;RI&#39; href=&#39;http://books.google.com.sg/books?id=wNWib4yqisUC&amp;printsec=frontcover&amp;dq=Effective+Functional+Verification:+Principles+and+Processes&#39;&gt;Preview&lt;/a&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &amp;nbsp; &lt;table&gt; &lt;tr width=100&gt;&lt;td&gt;&lt;img border=1 src=&#39;http://sandipgor.googlepages.com/0750676175.jpg&#39; width=136 height=210&gt;&lt;/td&gt; &lt;td valign=&#39;top&#39; height=210 align=&#39;left&#39;&gt; &lt;table class=&#39;books_table&#39; width=230 height=210 border=0 cellpadding=1&gt; &lt;tr&gt;&lt;td class=&#39;BookName&#39; colspan=2&gt;&lt;b&gt;Principles of Functional Verification&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Author :&lt;/b&gt;&lt;/td&gt;         &lt;td class=&#39;right&#39;&gt;Andrea S. Meyer&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;ISBN&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;0750676175&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publisher&lt;/b&gt;&lt;/td&gt;        &lt;td class=&#39;right&#39;&gt;Newnes&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publish Date&lt;/b&gt;&lt;/td&gt;     &lt;td class=&#39;right&#39;&gt;November, 2003&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Page&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;240&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;RI&#39;&gt;&lt;a target=_blank class=&#39;RI&#39; href=&#39;http://books.google.com.sg/books?id=qaIiX3hYWL4C&amp;pg=PP1&amp;dq=Principles+of+Functional+Verification&#39;&gt;Preview&lt;/a&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &amp;nbsp; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;table border=1&gt;&lt;tr&gt;&lt;td class=&#39;Title&#39;&gt;&lt;h2&gt;SystemVerilog Books&lt;/h2&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt; &lt;table&gt; &lt;tr width=100&gt;&lt;td&gt;&lt;img border=1 src=&#39;http://sandipgor.googlepages.com/0981656218.jpg&#39; width=136 height=210&gt;&lt;/td&gt; &lt;td valign=&#39;top&#39; height=210 align=&#39;left&#39;&gt; &lt;table class=&#39;books_table&#39; width=230 height=210 border=0 cellpadding=1&gt; &lt;tr&gt;&lt;td class=&#39;BookName&#39; colspan=2&gt;&lt;b&gt;Step-by-step Functional Verification with SystemVerilog and OVM&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Author :&lt;/b&gt;&lt;/td&gt;         &lt;td class=&#39;right&#39;&gt;Sasan Iman&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;ISBN&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;0981656218&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publisher&lt;/b&gt;&lt;/td&gt;        &lt;td class=&#39;right&#39;&gt;Hansen Brown Publishing&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publish Date&lt;/b&gt;&lt;/td&gt;     &lt;td class=&#39;right&#39;&gt;May, 2008&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Page&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;520&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;RI&#39;&gt;&lt;a target=_blank class=&#39;RI&#39; href=&#39;http://books.google.com.sg/books?id=uls5MQAACAAJ&amp;dq=Step-by-step+Functional+Verification+with+SystemVerilog+and+OVM&#39;&gt;Preview&lt;/a&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &amp;nbsp; &lt;table&gt; &lt;tr width=100&gt;&lt;td&gt;&lt;img border=1 src=&#39;http://sandipgor.googlepages.com/0387270361.jpg&#39; width=136 height=210&gt;&lt;/td&gt; &lt;td valign=&#39;top&#39; height=210 align=&#39;left&#39;&gt; &lt;table class=&#39;books_table&#39; width=230 height=210 border=0 cellpadding=1&gt; &lt;tr&gt;&lt;td class=&#39;BookName&#39; colspan=2&gt;&lt;b&gt;SystemVerilog for Verification: A Guide to Learning the Testbench Language Features&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Author :&lt;/b&gt;&lt;/td&gt;         &lt;td class=&#39;right&#39;&gt;Spear, Chris&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;ISBN&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;0387270361&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publisher&lt;/b&gt;&lt;/td&gt;        &lt;td class=&#39;right&#39;&gt;Springer&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publish Date&lt;/b&gt;&lt;/td&gt;     &lt;td class=&#39;right&#39;&gt;June, 2007&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Page&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;429&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;RI&#39;&gt;&lt;a target=_blank class=&#39;RI&#39; href=&#39;http://books.google.com.sg/books?id=tJYK-_-OV6QC&amp;pg=PR3&amp;dq=SystemVerilog+for+Verification:+A+Guide+to+Learning+the+Testbench+Language+Features&#39;&gt;Preview&lt;/a&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &amp;nbsp; &lt;table&gt; &lt;tr width=100&gt;&lt;td&gt;&lt;img border=1 src=&#39;http://sandipgor.googlepages.com/0387255389.jpg&#39; width=136 height=210&gt;&lt;/td&gt; &lt;td valign=&#39;top&#39; height=210 align=&#39;left&#39;&gt; &lt;table class=&#39;books_table&#39; width=230 height=210 border=0 cellpadding=1&gt; &lt;tr&gt;&lt;td class=&#39;BookName&#39; colspan=2&gt;&lt;b&gt;Verification Methodology Manual For Systerm Verilog&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Author :&lt;/b&gt;&lt;/td&gt;         &lt;td class=&#39;right&#39;&gt;Andy Nightingale, Alan Hunter, Eduard Cerny and Janick Bergeron&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;ISBN&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;0387255389&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publisher&lt;/b&gt;&lt;/td&gt;        &lt;td class=&#39;right&#39;&gt;Springer-Verlag New York Inc&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publish Date&lt;/b&gt;&lt;/td&gt;     &lt;td class=&#39;right&#39;&gt;2005&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Page&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;503&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;RI&#39;&gt;&lt;a target=_blank class=&#39;RI&#39; href=&#39;http://books.google.com.sg/books?id=dcET3kKtmH4C&amp;pg=PT1&amp;dq=Verification+Methodology+Manual+For+System+Verilog#PPP1,M1&#39;&gt;Preview&lt;/a&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &amp;nbsp; &lt;table&gt; &lt;tr width=100&gt;&lt;td&gt;&lt;img border=1 src=&#39;http://sandipgor.googlepages.com/0387292217.jpg&#39; width=136 height=210&gt;&lt;/td&gt; &lt;td valign=&#39;top&#39; height=210 align=&#39;left&#39;&gt; &lt;table class=&#39;books_table&#39; width=230 height=210 border=0 cellpadding=1&gt; &lt;tr&gt;&lt;td class=&#39;BookName&#39; colspan=2&gt;&lt;b&gt;Writing Testbenches Using SystemVerilog&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Author :&lt;/b&gt;&lt;/td&gt;         &lt;td class=&#39;right&#39;&gt;Janick Bergeron&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;ISBN&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;0387292217&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publisher&lt;/b&gt;&lt;/td&gt;        &lt;td class=&#39;right&#39;&gt;Springer-Verlag New York Inc&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publish Date&lt;/b&gt;&lt;/td&gt;     &lt;td class=&#39;right&#39;&gt;2006&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Page&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;412&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;RI&#39;&gt;&lt;a target=_blank class=&#39;RI&#39; href=&#39;http://books.google.com.sg/books?id=ZWZAkWkNy3cC&amp;printsec=frontcover&amp;dq=Writing+Testbenches+Using+SystemVerilog&#39;&gt;Preview&lt;/a&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &amp;nbsp; &lt;table&gt; &lt;tr width=100&gt;&lt;td&gt;&lt;img border=1 src=&#39;http://sandipgor.googlepages.com/0387260498.jpg&#39; width=136 height=210&gt;&lt;/td&gt; &lt;td valign=&#39;top&#39; height=210 align=&#39;left&#39;&gt; &lt;table class=&#39;books_table&#39; width=230 height=210 border=0 cellpadding=1&gt; &lt;tr&gt;&lt;td class=&#39;BookName&#39; colspan=2&gt;&lt;b&gt;A Practical Guide for System Verilog Assertions&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Author :&lt;/b&gt;&lt;/td&gt;         &lt;td class=&#39;right&#39;&gt;Srikanth Vijayaraghavan and Meyyappan Ramanathan&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;ISBN&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;0387260498&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publisher&lt;/b&gt;&lt;/td&gt;        &lt;td class=&#39;right&#39;&gt;Springer Verlag&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publish Date&lt;/b&gt;&lt;/td&gt;     &lt;td class=&#39;right&#39;&gt;2005&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Page&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;334&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;RI&#39;&gt;&lt;a target=_blank class=&#39;RI&#39; href=&#39;http://books.google.com.sg/books?id=wWJmy6X3cbQC&amp;printsec=frontcover&amp;dq=A+Practical+Guide+for+System+Verilog+Assertions&#39;&gt;Preview&lt;/a&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &amp;nbsp; &lt;table&gt; &lt;tr width=100&gt;&lt;td&gt;&lt;img border=1 src=&#39;http://sandipgor.googlepages.com/0387717382.jpg&#39; width=136 height=210&gt;&lt;/td&gt; &lt;td valign=&#39;top&#39; height=210 align=&#39;left&#39;&gt; &lt;table class=&#39;books_table&#39; width=230 height=210 border=0 cellpadding=1&gt; &lt;tr&gt;&lt;td class=&#39;BookName&#39; colspan=2&gt;&lt;b&gt;Hardware Verification With SystemVerilog: An Object-oriented Framework&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Author :&lt;/b&gt;&lt;/td&gt;         &lt;td class=&#39;right&#39;&gt;Mike Mintz and Robert Ekendahl&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;ISBN&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;0387717382&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publisher&lt;/b&gt;&lt;/td&gt;        &lt;td class=&#39;right&#39;&gt;Springer&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Publish Date&lt;/b&gt;&lt;/td&gt;     &lt;td class=&#39;right&#39;&gt;May, 2007&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;left&#39;&gt;&lt;b&gt;Page&lt;/b&gt;&lt;/td&gt;             &lt;td class=&#39;right&#39;&gt;314&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class=&#39;RI&#39;&gt;&lt;a target=_blank class=&#39;RI&#39; href=&#39;http://books.google.com.sg/books?id=Mawfv_drBJoC&amp;printsec=frontcover&amp;dq=Hardware+Verification+With+SystemVerilog:+An+Object-oriented+Framework&#39;&gt;Preview&lt;/a&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/table&gt; &amp;nbsp;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/9165326051361480918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/9165326051361480918?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/9165326051361480918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/9165326051361480918'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2009/06/specmanverification-books_15.html' title='Specman/Verification Books'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-7398863904508754737</id><published>2009-05-25T16:38:00.004+05:30</published><updated>2009-05-25T17:09:27.553+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sample Codes"/><title type='text'>randc kind of implementation in e</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;When I went through SystemVerilog constructs, one of the unique construct I found out was &lt;span style=&quot;font-style: italic;&quot;&gt;randc&lt;/span&gt;. Cyclic randomization sometimes helps you generating all unique combinations before repeating it. One classic usage example of &lt;span style=&quot;font-style: italic;&quot;&gt;randc&lt;/span&gt; is to inject all the sequences into DUT at least once without repeating it again. So, I was wondering if it is possible to implement it in &lt;span style=&quot;font-style: italic;&quot;&gt;e.&lt;/span&gt; I realized that though you can not generate the item based on its previously generated values, you can have some workaround for that using list psudo methods. There are all_values() and is_a_permutation() psudo methods which can be used for this purpose.&lt;br /&gt;&lt;br /&gt;Let me explain the logic to implement that classic usage example to inject all the sequences into DUT without repeating it. If we somehow generate a list of unique sequence kinds randomly, we can take that list items one-by-one and generate the sequence based on that kind. So, to generate the unique yet random list of sequence kind, we can use above mentioned two  list psudo methods. Take a look at the following code snippet.&lt;br /&gt;&lt;/div&gt;&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;&lt;br /&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;&lt;&#39;&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;type seq_type_t : [SEQ_A, SEQ_B, SEQ_C, SEQ_D, SEQ_E, SEQ_F, SEQ_G];&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;extend MAIN my_sequence_s&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt; seq_randc : list of seq_type_t;&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;  keep seq_randc.is_a_permutation(all_values(seq_type_t));&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt; !seq : my_sequence_s;&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt; body() @driver.clock is only&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt; {&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;  gen_seq_randc();&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;  for i from 0 to seq_randc.size() - 1&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;  {&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent4&quot;&gt;   do seq { keeping .kind == seq_randc[i]; }&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;  };&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt; };&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;&#39;&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-style: italic; color: rgb(51, 51, 255);&quot;&gt;all_values(seq_type_t)&lt;/span&gt; statement will return a list which will have all the unique values of scaler type &lt;span style=&quot;font-style: italic;&quot;&gt;seq_type_t&lt;/span&gt;. &lt;span style=&quot;font-style: italic; color: rgb(51, 51, 255);&quot;&gt;is_a_permutation()&lt;/span&gt; will make sure that &lt;span style=&quot;font-style: italic;&quot;&gt;seq_ranc&lt;/span&gt; list has random  but all the fields of the list returned by &lt;span style=&quot;font-style: italic; color: rgb(51, 51, 255);&quot;&gt;all_values(seq_type_t)&lt;/span&gt; statement. Thus, we have a list which has all the random values of the sequence kind. Now, we can loop through this list one by one and generate a seq and push it to the DUT.&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/7398863904508754737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/7398863904508754737?isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/7398863904508754737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/7398863904508754737'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2009/05/randc-kind-of-implementation-in-e.html' title='randc kind of implementation in e'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-5599865486660131724</id><published>2009-05-22T14:27:00.024+05:30</published><updated>2009-05-22T15:35:03.491+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Debugging"/><category scheme="http://www.blogger.com/atom/ns#" term="Specman Commands"/><title type='text'>Less known and less used Specman commands</title><content type='html'>There are quite a few Specman commands which are handy when it comes to debugging. Here I tried to summarize few less known but useful Specman commands. Here we go.&lt;ol&gt;&lt;li&gt;If you have verification environment loaded on Specman and one method is extended in multiple files and you want to see all the extension of that method in a single place, &quot;collect&quot; command is what you are looking for.&lt;/li&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; collect sys.mystruct.monitor&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; collect sys.run&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt; &lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;    File temp.erld - created by collecting:&lt;/div&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;    sys.run    (after module specman)&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;&lt;&#39;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;----------------------- Reset sys.run:&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;extend sys {&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;    run(&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;        ) is as was after specman;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;----------------------- From temp.e at line 6:&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;extend sys {&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;        run() is also&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;        {&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;                var x : mystruct_s;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;                gen x;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;        };&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;----------------------- End of sys.run&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;&#39;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;li&gt;If you want to debug temporal expression, you would like to visualise how different events are triggered. Event chart is basic but sometimes useful for debugging temporal expressions. To see the events you first have to collect events you are interested in by using &quot;collect events&quot; Specman command.&lt;/li&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; collect events *.*&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; collect events sys.mystruct.* //collects all events for the instance sys.mystruct&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; collect events mystruct_s.* //collects all the events of struct mystruct_s&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;If you want to see the events triggered during simulation, you can use Specman command &quot;show events&quot; after collecting the events as mentioned above.&lt;/li&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; show events&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; show events 100 //This command shows events since time 100&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; show events 100..150 //This command shows events in the time range 100..150&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; show events -chart //Pops up event chart&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;If you want to have a summarized report about the events count, if it is associated with cover group, its source etc, you can use &quot;show events def&quot; command.&lt;/li&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; show events def sys.any&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;    count   echo    col   covr  name             source&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;------------------------------------------------------------------&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;0   10000  FALSE   TRUE  FALSE  sys.any          @sn_te_tick&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Executing actions on command line. You can define variables or call methods or start a TCMs. (you can not call a TCM on command line). Remember, you can not give &quot;gen&quot; action on command line, but you can call a method which has gen action in it.&lt;/li&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; var x : uint(bits: 4) = 5;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; var y : uint = x + 10;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; print x + y;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; sys.non_tcm()&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; start sys.tcm()&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; sys.non_tcm_with_arg(4, TRUE)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;You can search/grep within the loaded files using &quot;search&quot; command&lt;/li&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; search mystruct_s&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;You can open a file (known as &quot;module&quot; in Specman terms) in source browser by using &quot;source&quot; command. It will open a source browser with that perticular line number into focus.&lt;/li&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;syntax: source &lt;filename&gt; &lt;line&gt;&lt;/line&gt;&lt;/filename&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; source mystruct.e 50&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;You can run unix commands using &quot;shell&quot; command.&lt;/li&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;syntax: shell &lt;unix&gt;&lt;/unix&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; shell echo $SPECMAN_PATH&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; shell pwd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;You can also get the value of define by issuing &quot;show define&quot; command.&lt;/li&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;syntax: show define [-v] [-e] &lt;string&gt;&lt;/string&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; show define -v &quot;*WIDTH*&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;If you want to know what are the modules that are loaded you can use &quot;show modules&quot; command.&lt;/li&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; show modules&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;You can get unix environment variables value within your e code by using get_symbol() method.&lt;/li&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;my_method() is&lt;/div&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;outf (&quot;SPECMAN_PATH=%s&quot;,get_symbol(&quot;SPECMAN_PATH&quot;));&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;li&gt;12. If you wish to execute specman command in e code, then you can use specman() method as shown below.&lt;/li&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;pre_generate() is&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;specman(&quot;break on error&quot;);&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;li&gt;If you wish to execute unix command from your e code, you can use output_from() method.&lt;/li&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;my_method() is&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;var list_of_files: string;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;list_of_files = output_from(&quot;ls&quot;);&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;print list_of_files;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot; class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;li&gt;If you want to uderstand port binding in Specman, use &quot;show ports&quot; command.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;You can use &quot;trace bind&#39; to follow the binding process&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If you have executed a set of commands and want to see the history of executed commands, you can use &quot;show redo&quot; command.&lt;/li&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt; &lt;/span&gt;show redo&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;show redo&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;The redo buffer (default is &#39;redo 0..&#39;) =&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;0.    &quot;restore specman.esv&quot;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;1.    &quot;load temp.e&quot;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;2.    &quot;test&quot;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;3.    &quot;clear screen; restore; reload; test&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Once you know the hisotry of executed command, you can reexecute them by issueing &quot;redo&quot; Specman command.&lt;/li&gt;&lt;br /&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; redo 3 //this will execute command 3 (clear screen; restore; reload; test)&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;;font-family:courier new;font-size:85%;&quot;  &gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; redo 0..2 //this will execute command 0 to 2 (restore specman.esv, load temp.e, test)&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;li&gt;If you have wave command executed to view e fields into waveform and want to dump all these wave tracing commands into a file, you can use &quot;write wave&quot; command.&lt;/li&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;syntax: write wave to &lt;filename&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; write wave to trace_wave.ecom&lt;/filename&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;filename&gt;&lt;/filename&gt;&lt;filename&gt;19. To debug, packing and unpacking, you can use &quot;show pack&quot; and &quot;show unpack&quot; command as shown below.&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;/filename&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; var x : uint (bits: 3) = 3&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; var y : uint (bits: 7) = 5&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; show pack(packing.low, x, y);&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;     |9 8 7 6 5 4 3|2 1 0|  +0&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;     +-------------+-----|&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;     |0 0 0 0 1 0 1|0 1 1|&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;     +-------------+-----|&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;     |y            |x    |&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; var x : packet_s&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; var data : list of bit = {1;1;0;1;0;0;0;1;1;1;0;1}&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span class=&quot;__mozilla-findbar-search&quot; style=&quot;padding: 0pt; background-color: yellow; display: inline;font-size:inherit;color:black;&quot;  &gt;Specman&gt;&lt;/span&gt; show unpack(packing.low, data, x)&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;     |1 0 9 8 7 6 5 4|3 2 1 0|  +0&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;     +---------------+-------|&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;     |1 0 1 1 1 0 0 0|1 0 1 1|&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;     +---------------+-------|&lt;/span&gt;&lt;/filename&gt;&lt;br /&gt;&lt;filename&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;     |x.addr         |x.len  |&lt;/span&gt;&lt;/filename&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/5599865486660131724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/5599865486660131724?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/5599865486660131724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/5599865486660131724'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2009/05/less-known-and-less-used-specman.html' title='Less known and less used Specman commands'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-8486610350589206309</id><published>2009-05-21T13:03:00.014+05:30</published><updated>2009-05-21T14:50:50.849+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Debugging"/><title type='text'>Debugging packing and unpacking in Specman</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;Hello readers, I am back after a loooooong break. It has been quite a some time since I posted something here as I was too busy with my personal life and responsibilities. I try to be regular now. So with this note, let me start something from today itself.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;While using packing/unpacking in your environment, you might have gone through some debugging troubles due to silly mistakes. So here are few tips to avoid errors for packing and unpacking.&lt;br /&gt;So starting with Unpacking, there can be 2 kind of problems you may face while unpacking a list into struct&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;You run out of data while unpacking (i.e. list is shorter than total length of physical fields of a struct)&lt;/li&gt;&lt;li&gt;Unpacking is finished but you have bits/bytes left over (i.e. list is bigger than total length of physical fields of struct)&lt;/li&gt;&lt;/ul&gt;If you have situation 1, it will be flagged as run-time error by Specman. But, if you have situation 2, you might not even aware of it as Specman does not issue even a warning for this. For situation 1, if you want to suppress run-time error, you can use &#39;try&#39; action.&lt;style&gt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:8.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&lt;/style&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;tcm() @clk is {&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;try {&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;unpack(packing.low, my_list, my_struct);&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;} else {&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;message (LOW, &quot;Unpacking failed&quot;);&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;To debug packing/unpacking issues, you can use Specman command &#39;&lt;span style=&quot;font-style: italic;&quot;&gt;trace packing&lt;/span&gt;&#39;. It shows how packing/unpacking is performed. Following example shows the result of &#39;trace packing&#39; command performed for unpacking.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;img src=&quot;http://sandipgor.googlepages.com/unpacking_trace_result.png&quot; width=&quot;100%&quot; height=&quot;100%&quot; /&gt;&lt;/div&gt;&lt;br /&gt;&lt;add&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Following example shows the result of &#39;trace packing&#39; command performed for packing&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;img src=&quot;http://sandipgor.googlepages.com/packing_trace_result.png&quot; width=&quot;100%&quot; height=&quot;100%&quot; /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;add&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;If unpacking is unsuccessful (ran out of data in the list), you normally get following message on Specman STDOUT.&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0);font-family:courier new;&quot; &gt;   *** Error: Ran out of data while trying to unpack (use &#39;trace packing&#39; for further details)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0);font-family:courier new;&quot; &gt;        at line 19 in @packing_unpacking_debug&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0);font-family:courier new;&quot; &gt;        unpack(packing.low, lob_u, x);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But if you use &#39;&lt;span style=&quot;font-style: italic;&quot;&gt;trace packing&lt;/span&gt;&#39; Specman command, you see where unpacking stopped.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0);font-size:85%;&quot; &gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&gt; ----- Starting an unpack() at line 19 in @packing_unpacking_debug ----&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&gt; ----------- Unpacking &#39;x&#39;: x_s&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&gt; Unpacking &#39;x.a&#39;: uint (bits: 4)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;                                                         8      .0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&gt; &#39;x.a&#39;: uint (bits: 4) = 8&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&gt; Unpacking &#39;x.b&#39;: uint (bits: 8)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;                                                       0 5      .0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&gt; &#39;x.b&#39;: uint (bits: 8) = 5&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&gt; Unpacking &#39;x.c&#39;: list of byte&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;   *** Error: Ran out of data while trying to unpack into &#39;x.c&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        at line 19 in @packing_unpacking_debug&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        unpack(packing.low, lob_u, x);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;One of the very common cause of the unpacking failure is the unsized list. If the target struct has unsized list as a physical field, all the bits/bytes of the source list will be absorbed by this unsized list and there will be no data left for the next physical field and Specaman will issue an error. So it is always advisable not to have unsized list in the target struct.&lt;br /&gt;&lt;br /&gt;Another reason for unpacking failure could be subtype physical fields. If you have few physical fields defined under &lt;span style=&quot;font-style: italic;&quot;&gt;&#39;when&#39; &lt;/span&gt;subtype of a struct, your need to make sure which subtype to pick while unpacking.&lt;br /&gt;&lt;br /&gt;One more reason for the unpacking to give errorneous result is the order of the physical fields in a struct. If physical fields of a struct is defined in the multiple files, then import order of that file becomes crucial because based on the order, physical fields will be treated differently during unpacking. Take a look at the following example.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/add&gt;&lt;/add&gt;&lt;div&gt;&lt;img src=&quot;http://sandipgor.googlepages.com/import_order.PNG&quot; width=&quot;100%&quot; height=&quot;100%&quot; /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/8486610350589206309/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/8486610350589206309?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/8486610350589206309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/8486610350589206309'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2009/05/debugging-packing-and-unpacking-in.html' title='Debugging packing and unpacking in Specman'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-1266223039325751109</id><published>2008-12-17T12:19:00.003+05:30</published><updated>2008-12-17T12:22:24.122+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Jobs"/><title type='text'>Job openings at Cadence Design Systems, India (Bangalore and Noida)</title><content type='html'>In this tough time, there are some openings at Cadence Design Systems for its India centers (Bangalore and Noida). Please have a look at the openings for more details &lt;a href=&quot;http://getjobsinindia.blogspot.com/search/label/Cadence%20Design%20Systems&quot;&gt;&lt;u&gt;here&lt;/u&gt;&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/1266223039325751109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/1266223039325751109?isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/1266223039325751109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/1266223039325751109'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2008/12/job-openings-at-cadence-design-systems.html' title='Job openings at Cadence Design Systems, India (Bangalore and Noida)'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-8853768507478586104</id><published>2008-10-15T12:29:00.004+05:30</published><updated>2008-10-15T12:38:06.884+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Jobs"/><title type='text'>Verification Engineer required for Cadence Design Systems, Bangalore or Noida</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;u&gt;Experience:&lt;/u&gt;&lt;/span&gt; 4 to 5 years&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;u&gt;Location:&lt;/u&gt;&lt;/span&gt; India, Bangalore or Noida&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;u&gt;Job Requirement:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;This engineer’s primary role will be to work in a team oriented environment to deliver digital logic design and verification methodologies, customised design environments and design implementation solutions that align with client goals. He/she will interact and work with other engineers on the worldwide D&amp;amp;V VCAD delivery team. &lt;/li&gt;&lt;li&gt;Responsibilities will include creating and customising design environments, design and verification methodologies.&lt;/li&gt;&lt;li&gt;Ideally the canddate should be able to assist with the optimisation of acceleration and emulation technologies using the Cadence Incisive verification flows including the Palladium and Xtreme hardware.&lt;/li&gt;&lt;li&gt;The engineer must have a solid background in logic design and verification experience with Cadence technology in the digital domain.&lt;/li&gt;&lt;li&gt;The client should have at least a basic understanding of modeling (e.g. Architecture or system), and both block and system level verification experiance, preferably with coverage driven methodologies. &lt;/li&gt;&lt;li&gt;The candidate should possess the necessary engineering and consultancy skills, i.e. that he/she is technically mature with the necessary communication skills to be able to consult effectively with clients, e.g. to talk to, coach and advise Customers. &lt;/li&gt;&lt;li&gt;The engineer must have a solid background  in the electronics industry with at least 4 to 5 years experience, and should be willing to learn new technical and consulting skills.&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;u&gt;Key Accountabilities:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Execution on VCAD Customer support projects, e.g. Implementation and functional verification of design systems. &lt;/li&gt;&lt;li&gt;Development of customer specific verification environments including components, methodology support, operation and maintenance.&lt;/li&gt;&lt;li&gt;Be prepared to provide design and verification support in VCAD Customer design projects, both remotely and onsite.&lt;/li&gt;&lt;li&gt;Ability to handle all design environment implementation tasks and architectural tasks with the minimum support or through working in a joint team of Cadence and Customer engineers.&lt;/li&gt;&lt;li&gt;Work on multi person projects of varying complexity, working especially in a multi-site/multi-cultural project. The latter requires excellent communication skills in English.&lt;/li&gt;&lt;li&gt;Acquire a basic understanding of the (service) business environment of Cadence within 6 months including pre sales support.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Contact&lt;/u&gt;:&lt;/strong&gt; &lt;a href=&quot;mailto:getjobsinindia2007@gmail.com&quot;&gt;getjobsinindia2007@gmail.com&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/8853768507478586104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/8853768507478586104?isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/8853768507478586104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/8853768507478586104'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2008/10/verification-engineer-bangalore-or.html' title='Verification Engineer required for Cadence Design Systems, Bangalore or Noida'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-7420048252723602416</id><published>2008-10-15T12:16:00.004+05:30</published><updated>2008-10-15T12:39:19.519+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Jobs"/><title type='text'>DFT Engineer required for Cadence Design Systems, Bangalore</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;u&gt;Experience:&lt;/u&gt;&lt;/span&gt; 3 to 6 Years&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;u&gt;Location:&lt;/u&gt;&lt;/span&gt; Bangalore, India&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;u&gt;Skill Sets:&lt;/u&gt;&lt;/span&gt; Scan, Jtag, Atpg, Tester interface.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;u&gt;Good to have skills:&lt;/u&gt;&lt;/span&gt; Exposure to ATPG tools like Encounter Test&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;u&gt;Job Description:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;This engineer’s primary role will be to work in a team oriented environment to deliver DFT activities for implementation services.  He/she will interact and work with other engineers on the worldwide delivery team.&lt;/li&gt;&lt;li&gt;This engineer is expected to provide services using the following technical skills: Scan, JTAG, ATPG, Logic Synthesis, Static Timing Analysis, and to interface with designers / testing team.&lt;/li&gt;&lt;li&gt;In addition to the technical skills they will be expected to operate effectively in project teams delivering the design of leading edge. Additional responsibilities include customer interactions and pre-sales activities.&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;u&gt;Key Accountabilities&lt;/u&gt;&lt;/span&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Ability to handle all design environment implementation tasks assigned, either personally or through supervising other Cadence and Customer engineers.&lt;/li&gt;&lt;li&gt;Work on multi person projects of varying complexity, working especially in a multi-site/multi-cultural project. The latter requires excellent communication skills in English.&lt;/li&gt;&lt;li&gt;Acquire a basic understanding of the (service) business environment of Cadence including pre sales support.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Contact&lt;/u&gt;:&lt;/strong&gt; &lt;a href=&quot;mailto:getjobsinindia2007@gmail.com&quot;&gt;getjobsinindia2007@gmail.com&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/7420048252723602416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/7420048252723602416?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/7420048252723602416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/7420048252723602416'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2008/10/dft-engineer-required-for-cadence.html' title='DFT Engineer required for Cadence Design Systems, Bangalore'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-7261075859790301256</id><published>2008-10-15T11:57:00.005+05:30</published><updated>2008-10-15T12:07:27.279+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="News"/><category scheme="http://www.blogger.com/atom/ns#" term="OVM"/><title type='text'>OVM 2.0 Webinar on 16th Oct, 2008</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;There is a &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_0&quot;&gt;OVM&lt;/span&gt; 2.0 &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_1&quot;&gt;Webinar&lt;/span&gt; organized on 16&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_2&quot;&gt;th&lt;/span&gt; Oct, 2008.&lt;br /&gt;&lt;br /&gt;Details of &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_3&quot;&gt;webinar&lt;/span&gt; is mentioned below.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Date&lt;/span&gt;          :     Thursday, October 16&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_4&quot;&gt;th&lt;/span&gt;, 2008&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Time&lt;/span&gt;         :     10:00 AM - 11:00 AM (Pacific Daylight Time)&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Location&lt;/span&gt; :     Online via Microsoft Office Live Meeting (details provided upon registration)&lt;br /&gt;&lt;br /&gt;For more information and registration, please click &lt;a href=&quot;http://www.ovmworld.org/webinars.php&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_5&quot;&gt;OVM&lt;/span&gt; 2.0 update contains some technical advances. Few of are listed bellow&lt;br /&gt;&lt;ul&gt;&lt;li&gt;     Unified sequence mechanism&lt;/li&gt;&lt;li&gt;     &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_7&quot;&gt;OVM&lt;/span&gt; User Guide&lt;/li&gt;&lt;li&gt;     Improved debugging and expanded use of &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_8&quot;&gt;parametrized&lt;/span&gt; classes&lt;/li&gt;&lt;li&gt;     Driver/sequencer communication enhancements&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/7261075859790301256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/7261075859790301256?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/7261075859790301256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/7261075859790301256'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2008/10/ovm-20-webinar-on-16th-oct-2008.html' title='OVM 2.0 Webinar on 16th Oct, 2008'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-7968855927132960122</id><published>2008-05-26T12:22:00.002+05:30</published><updated>2008-05-26T12:27:01.486+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="IEEE"/><title type='text'>IEEE Working Group Announces Updated e Language Standard</title><content type='html'>&lt;div align=&quot;justify&quot;&gt;The e Functional Verification Language Working Group (eWG) was formed to define a standard for the e language, and the initial 1647-2006 standard was published in September 2006. And now, IEEE has approved a revision to IEEE 1647, Standard for the Functional Verification Language e. This revision is called 1647-2008 e Language Standard&lt;br /&gt;&lt;br /&gt;Please see following link for more details.&lt;br /&gt;&lt;a href=&quot;http://standards.ieee.org/announcements/IEEE1647_eLanguageStandard.html&quot;&gt;http://standards.ieee.org/announcements/IEEE1647_eLanguageStandard.html&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/7968855927132960122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/7968855927132960122?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/7968855927132960122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/7968855927132960122'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2008/05/ieee-working-group-announces-updated-e.html' title='IEEE Working Group Announces Updated e Language Standard'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-4706554865343865670</id><published>2008-03-13T10:57:00.008+05:30</published><updated>2008-03-19T16:24:09.061+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="News"/><category scheme="http://www.blogger.com/atom/ns#" term="OVM"/><title type='text'>OVM Seminars at Hyderabad and Bangalore</title><content type='html'>&lt;div align=&quot;justify&quot;&gt;There is an OVM semniar held at Hyderabad on Thursday, March 25, 2008 between 8:30 am to 2:30 pm (IST) and at Bangalore on Thursday, March 27, 2008 between 8:30 am to 2:30 pm (IST).&lt;/div&gt;&lt;br /&gt;&lt;div&gt;For registeration, please visit &lt;a href=&quot;http://www.ovmworld.org/seminars.php&quot;&gt;http://www.ovmworld.org/seminars.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here are the topics covered in the seminar.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;LI&gt;&lt;STRONG&gt;OVM Overview&lt;/STRONG&gt;&lt;UL&gt;&lt;LI&gt;Planning for Verification&lt;LI&gt;Testbench Architecture&lt;LI&gt;Transaction-Level Modeling (TLM) in Verification &lt;/LI&gt;&lt;/UL&gt;&lt;LI&gt;&lt;STRONG&gt;Stimulus and Coverage&lt;/STRONG&gt;&lt;UL&gt;&lt;LI&gt;Transaction-Level Stimulus&lt;LI&gt;Decoupling Stimulus from the Design&lt;LI&gt;Sequential Stimulus Specification&lt;LI&gt;Layered Stimulus&lt;LI&gt;Transaction-Level Layered Coverage &lt;/LI&gt;&lt;/UL&gt;&lt;LI&gt;&lt;STRONG&gt;Planning for Verification Reuse&lt;/STRONG&gt;&lt;UL&gt;&lt;LI&gt;Flexible Instantiation – Using the Factory&lt;LI&gt;Configuring Verification Components for Reuse&lt;LI&gt;Hierarchical Encapsulation &amp; Reuse &lt;/LI&gt;&lt;/UL&gt;&lt;LI&gt;&lt;STRONG&gt;Putting it All Together&lt;/STRONG&gt;&lt;UL&gt;&lt;LI&gt;OVM Moving Forward&lt;/LI&gt;&lt;/UL&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/4706554865343865670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/4706554865343865670?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/4706554865343865670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/4706554865343865670'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2008/03/ovm-seminar-tour.html' title='OVM Seminars at Hyderabad and Bangalore'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-6711567935289062724</id><published>2008-02-13T16:08:00.020+05:30</published><updated>2008-08-18T13:09:56.639+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Did You Know"/><title type='text'>About generation of do-not-generate fields</title><content type='html'>&lt;p align=&quot;justify&quot;&gt;Say a parent struct is having two fields inside it. One is an ungenerated (with do-not-generate sign) child struct and another ungenerated field is of pre defined data types (like uint, bool etc.).&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;When this parent struct is generated&lt;/p&gt;&lt;div class=&quot;indent1&quot;&gt;1) ungenerated field of pre defined data types will get their initial value (0 for scalars, NULL for structs, empty list for lists). &lt;p align=&quot;justify&quot;&gt;2) ungenerated field whose value is a range (such as [0..100]) gets the first value in the range.&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;3) ungenerated field of user defined data types (like sturcts) will not be allocated and none of the fields in it will be generated.&lt;/p&gt;&lt;/div&gt;&lt;p align=&quot;justify&quot;&gt;Take a look at following code.&lt;/p&gt;&lt;div class=&quot;post-body entry-content&quot;&gt;&lt;style&gt;&lt;!-- /* Font Definitions */ @font-face  {font-family:SimSun;  panose-1:2 1 6 0 3 1 1 1 1 1;} @font-face  {font-family:&quot;\@SimSun&quot;;  panose-1:0 0 0 0 0 0 0 0 0 0;}  /* Style Definitions */ div.codefrag  {margin:0in;  margin-bottom:.0001pt;  font-size:10.0pt;  font-family:&quot;Courier New&quot;; } div.indent1      {text-indent:20px; } div.indent2      {text-indent:40px; } div.indent3      {text-indent:60px; } div.indent4      {text-indent:80px; } --&gt;&lt;/style&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;&lt;&#39;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;struct child_s&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;!a : uint (bits: 4);&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;b : uint (bits: 4);&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;struct top_s&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;!child : child_s;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;!x : uint (bits: 3);&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;!y : uint (bits: 3);&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent3&quot;&gt;keep x in [2..5];&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;extend sys&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;{&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent2&quot;&gt;top : top_s;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;};&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codefrag&quot;&gt;&lt;div class=&quot;indent1&quot;&gt;&#39;&gt;&lt;/div&gt;&lt;/div&gt;&lt;p align=&quot;justify&quot;&gt;In this example, top_s struct has one ungenerated struct and two ungenerated fields of uint (bits: 3). When top is generated inside the sys&lt;/p&gt;&lt;div class=&quot;indent1&quot;&gt;1) y will be generated and will get any random value between 0 and 7 &lt;p align=&quot;justify&quot;&gt;2) x will be generated with value of 2 as it is a range bound ungenerated field.&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;3) child field will not be generated as it is defined as ungenerated struct. So, the fields a and b of child struct will not be generated as well.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/6711567935289062724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/6711567935289062724?isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/6711567935289062724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/6711567935289062724'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2008/02/about-generation-of-do-not-generate.html' title='About generation of do-not-generate fields'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-7712077732241865656</id><published>2008-02-12T16:30:00.000+05:30</published><updated>2008-02-12T16:43:25.917+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Did You Know"/><title type='text'>By default MAIN sequence is not empty</title><content type='html'>&lt;div align=&quot;justify&quot;&gt;By default, body method of MAIN sequence is not empty. It contains a loop which executes random number of times creating the sequence field (randomly unless constrained). The generated/created driver contains an instance of the MAIN sequence, which is started automatically upon run().&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;br /&gt;So, in your environment, if body method of MAIN sequence of any eVC is not made empty, it will start executing some random sequences at 0 simulation time. This might have adverse effect on the behavior of the stimulus given to the design if you are using virtual sequence, because user defined sequence (executed inside virutal sequence) and MAIN sequence might be running parallely and might be driving same signals and causing undesirable stimulus.&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;br /&gt;Debugging this will become difficult. You might be wondering why some other sequences are being executed even though you are calling perticular sequence only in virtual sequence?&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;br /&gt;So, if you are an eVC developer, always provide sequence library with body of MAIN sequence made empty. And if you are verifying any DUT and if you are using virtual sequence and not using MAIN sequence of any eVC, make body method of all MAIN sequences empty.&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;br /&gt;Take a look at &lt;a href=&quot;http://sandipgor.googlepages.com/main_sequence_example.e&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt; e code to check that how MAIN sequence is executing a loop which creates and executes the random sequence. Load &lt;a href=&quot;http://sandipgor.googlepages.com/main_sequence_example.e&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt; e code and give test command with random seed. You will see that even though body method of MAIN sequence is not extended, MAIN sequence is executing random sequneces (TEST1, TEST2, SIMPLE).&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/7712077732241865656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/7712077732241865656?isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/7712077732241865656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/7712077732241865656'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2008/02/by-default-main-sequence-is-not-empty.html' title='By default MAIN sequence is not empty'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-2515819245798336080</id><published>2008-01-14T15:00:00.000+05:30</published><updated>2008-01-14T15:02:26.782+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="News"/><category scheme="http://www.blogger.com/atom/ns#" term="OVM"/><title type='text'>OVM available on its new site</title><content type='html'>&lt;div align=&quot;justify&quot;&gt;Open Verification Methodology (OVM) is now available on its new site &lt;a href=&quot;http://www.ovmworld.org/&quot;&gt; http://www.ovmworld.org&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/2515819245798336080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/2515819245798336080?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/2515819245798336080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/2515819245798336080'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2008/01/ovm-available-on-its-new-site.html' title='OVM available on its new site'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724087381158100807.post-3495011391533431395</id><published>2008-01-08T12:14:00.000+05:30</published><updated>2008-01-08T13:57:01.750+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Implementation"/><title type='text'>Checker implementation dilema</title><content type='html'>&lt;div align=&quot;justify&quot;&gt;Ever encountered the checker implementation &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_0&quot;&gt;dilemma&lt;/span&gt;? How to implement it? Using temporal expressions or using methods? Once in a lifetime, every verification engineer &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_1&quot;&gt;comes&lt;/span&gt; to a stage where they have to take decision about the implementation of a checker. Once, I made a wrong decision and &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_2&quot;&gt;implemented&lt;/span&gt; a complex event-based checker in temporal expressions using &quot;&lt;em&gt;expect&lt;/em&gt;&quot; statement. After that I was introduced to the hell of debugging temporal expressions in &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_3&quot;&gt;Specman&lt;/span&gt;. Event chart is a junk feature in the &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_4&quot;&gt;Specman&lt;/span&gt;. Filtering of the events, having full path of the events are not so easy to see in the events chart. Even, &lt;em&gt;when-&lt;/em&gt;subtypes&#39; events can not be viewed &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_5&quot;&gt;separately&lt;/span&gt;.&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt; &lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;After having a lot of trouble debugging temporal expressions, I re-wrote the entire checker in the methods format using &lt;em&gt;&quot;check that&lt;/em&gt;&quot; and &quot;&lt;em&gt;if &lt;/em&gt;else&lt;em&gt;&quot; &lt;/em&gt;construct&lt;em&gt;.&lt;/em&gt; Debugging of method based checker is such an easy task in &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_6&quot;&gt;Specman&lt;/span&gt;, as &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_7&quot;&gt;Specman&lt;/span&gt; has a beautiful and reliable debugger. Lot of features, though might be basic, are quiet useful when it comes to debug the method based checkers. In Specman debugger, one can put conditional and unconditional breakpoints, can see the &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_8&quot;&gt;hierarchy&lt;/span&gt; of the threads, can add &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_9&quot;&gt;watch points&lt;/span&gt; on &lt;em&gt;e &lt;/em&gt;fields and a lot more. I will &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_10&quot;&gt;discuss&lt;/span&gt; about debugging in Specman for the beginners in the &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_11&quot;&gt;separate&lt;/span&gt; post. &lt;/div&gt;&lt;div align=&quot;justify&quot;&gt; &lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;After that experience, I concluded following things for the checker implementation.&lt;/div&gt;&lt;ol&gt;&lt;li&gt;&lt;div align=&quot;justify&quot;&gt;Write down the checker in the simple e&lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_12&quot;&gt;nglish&lt;/span&gt; to understand its complexity.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align=&quot;justify&quot;&gt;If checker is simple, I mean, just contains 2 to 3 basic events to check, then go for temporal expressions for the checker &lt;span class=&quot;blsp-spelling-corrected&quot; id=&quot;SPELLING_ERROR_13&quot;&gt;implementation&lt;/span&gt;.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align=&quot;justify&quot;&gt;If checker is even a bit complex having more than 3 events, just go for the method based checker implementation. You will save a hell lot of time which might be lost in the debugging temporal expressions.&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div align=&quot;justify&quot;&gt;Method based checker implementation looks more readable, even though it requires extra codes to implement and it&#39;s a bit slower than temporal expressions based checkers. But at the end, you are going to save lot of time having clean checker.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitalverification.blogspot.com/feeds/3495011391533431395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1724087381158100807/3495011391533431395?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/3495011391533431395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724087381158100807/posts/default/3495011391533431395'/><link rel='alternate' type='text/html' href='http://digitalverification.blogspot.com/2008/01/checker-implementation-dilema.html' title='Checker implementation dilema'/><author><name>Sandeep Gor</name><uri>http://www.blogger.com/profile/17756641047106957907</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>