<?xml version="1.0" encoding="ISO-8859-1"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ref="http://purl.org/rss/1.0/modules/reference/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://www.specman-verification.com//rss.rdf">
		<title>Tips for HVL and HDL users with special emphasis on Specman-e, SystemVerilog and Questa</title>
		<link>http://www.specman-verification.com/index.php</link>
		<description><![CDATA[No Footer]]></description>
		<items>
			<rdf:Seq>
				<rdf:li resource="http://www.specman-verification.com/?entry=entry080714-150156" />
				<rdf:li resource="http://www.specman-verification.com/?entry=entry080621-094553" />
				<rdf:li resource="http://www.specman-verification.com/?entry=entry080617-170749" />
				<rdf:li resource="http://www.specman-verification.com/?entry=entry080528-184046" />
				<rdf:li resource="http://www.specman-verification.com/?entry=entry080517-094449" />
				<rdf:li resource="http://www.specman-verification.com/?entry=entry080330-214734" />
			</rdf:Seq>
		</items>
	</channel>
	<item rdf:about="http://www.specman-verification.com/?entry=entry080714-150156">
		<title>Buzzword of the week: functional qualification</title>
		<link>http://www.specman-verification.com/index.php?entry=entry080714-150156</link>
		<description><![CDATA[Yaron Ilani, a fellow blogger has posted an interesting interview with Mark Hampton, the CTO of Certess, a company specializing in &quot;functional qualificaion. Functional qualification, I have just learned, is a new technology that introduces artificial bugs into an HDL design, to check how good your testbench is. If this sounds interesting, or if you&#039;d just like to impress the girls in your team with your deep knowledge of the latest trends, go ahead and <a href="http://www.thinkverification.com/?p=45" target="_blank" >read some more</a>. ]]></description>
	</item>
	<item rdf:about="http://www.specman-verification.com/?entry=entry080621-094553">
		<title>A $ comes for free</title>
		<link>http://www.specman-verification.com/index.php?entry=entry080621-094553</link>
		<description><![CDATA[It took me a while (about 1.5 year of working with SV), but I’ve just realised that dynamic arrays are just plain useless: Whatever a dynamic array can do, a queue can do much better. A queue could be resized using new[] just like an array, but it would also be resized automatically when you add an element, or a list of elements. You could use two variables to slice a queue, which you <a href="http://www.specman-verification.com/index.php?entry=entry070806-211204" target="_blank" >can’t do</a> with an array, and this alone is a good enough reason to forget about dynamic arrays for eternity. And, in general, every function or language structure that would work with a dynamic array, would also work with a queue. You could also randomize queues of course. <br /><br />And why did it take me such a long time to figure this out? Obviously, because no one in his right mind expects a language to have some outright redundant constructs. I was assuming that if dynamic arrays are there, then there must be some raison d&#039;être, some hidden super-power that I haven’t come-across yet. Well, I guess I should have read what <a href="http://www.specman-verification.com/index.php?entry=entry080528-184046" target="_blank" >I’ve written</a> some weeks ago first…Then I would have realised much earlier that the results of committee work, don’t always follow the most basic rules of common-sense.<br /><br />So, the bottom line is, whenever you write something like that:<br /><br />int a[];<br /><br />Just go ahead and place that $ inside:<br /><br />int a[$]<br /><br />This dollar comes for free, and it can give back so much.]]></description>
	</item>
	<item rdf:about="http://www.specman-verification.com/?entry=entry080617-170749">
		<title>Cadence wants this website back!</title>
		<link>http://www.specman-verification.com/index.php?entry=entry080617-170749</link>
		<description><![CDATA[Just learned that Cadence is trying to preform a <a href="http://www.forbes.com/reuters/feeds/reuters/2008/06/17/2008-06-17T161201Z_01_N17325351_RTRIDST_0_MENTOR-CADENCE-UPDATE-4.html" target="_blank" >hostile takeover</a> of Mentor. <br /><br />Will I soon become Cadence employee? Will &quot;die hard&quot; Specman survive? <br /><br />Judging by <a href="http://www.eetimes.com/news/design/showArticle.jhtml?articleID=208700112" target="_blank" >this article</a> (which makes sense for a business ignorant guy like myself), probably not...]]></description>
	</item>
	<item rdf:about="http://www.specman-verification.com/?entry=entry080528-184046">
		<title>Low standards</title>
		<link>http://www.specman-verification.com/index.php?entry=entry080528-184046</link>
		<description><![CDATA[About a week ago a dramatic announcement has taken the verification world by storm: Accellera has started a new standardization committee dedicated to Verification IP interoperability. This committee should take the OVM, the VMM and any other existing SV methodologies as its inputs, insert some 1-2 years delay, then drive the Absolutely Complete Verification Methodology (ACVM) on its output. The exact specification of this complex committee-DUT is still TBD, but we can already take a wild guess on the output right now: It will be a class library; it will contain base classes for reporting; it will have a configuration interface; it will define ports that can be used by scoreboards; it will have a generation interface. Maybe it will define some naming conventions, directory structure and a way to deploy new versions as well. By the time output valid goes high, however, we will have plenty of OVM based IPs, VMM based IPs, ??? based IPs and many eVCs still there, and all of these would have to be interoperable with the new interoperable ACVM. A brave new world indeed.<br /><br />You have to be naïve at best or a (Synopsys) salesperson at worst, to believe that the new standard will result in better interoperability and better quality VIPs. I have a strong deja-vu feeling when I hear these talks about vendor interoperability: wasn’t it only 2 years ago that the exact same promise was used to sell SV to clients? Wouldn’t it be smarter to first make SV live to its interoperability promises, and only then move on to build another layer on top? <a href="http://www.coolverification.com/2008/05/on-systemverilo.html" target="_blank" >JL has a very strong point</a> when he puts SV interoperability as a pre-condition for any further discussion of VIP interoperability.<br /><br />Why is it that SV vendor-interoperability is taking such a long time? The answer to this question hides a very important lesson for the new committee, which has not been acknowledged or learned so far. The main problem with the SV standard is in fact not vendor-interoperability, but the fact that the standard is not even interoperable with itself. Different parts of the language have almost no connection to other parts: assertions and classes, for example, seem to live on two different plants. You can’t have assertions in classes and you can’t have references to class members in assertions. The same goes for the object oriented part and the static hierarchy world – of all three static elements defined in the language (interface, module and program) not even one supports inheritance. There are more such examples but I guess you got the point. <br /><br />If the SV standard is made out of so many separate non-communicating worlds, this is not because some of the best verification experts in the world got suddenly dumb when they wrote it. It is simply because these “worlds” were each separately designed by a different vendor, than donated to the committee to integrate. Assertions, classes, programs and interfaces all originated in different “donations”. These “donations” have of course nothing to do with kind hearted charity: in fact they are no more than a euphemism for “strong pressure”. Too often, their unique actual contribution is to put another obstacle in the competition’s path: why not let the competition break its head over the implementation of this thing/this crap we already have? And, of course, the first part of the standard each company implements are its own donations, because they’re already there.<br /><br />Since the standardization committee is too weak and too divided to tell strong vendors “thanks, but no thanks”, the easiest way out is just to sum everything up. That’s how a bunch of loosely integrated donations ends up becoming a standard, and that’s how you get assertions and classes that can hardly communicate. In fact, even if the committee wanted to do better it probably could not, since it lacks its own independent R&amp;D resources. This means that it simply has to relay on the donations made, and hope for no more than some slight modifications for the sake of integration at best. Even such slight modifications often encounter tough resistance because they force the contributing vendor to modify an already existing piece of code. <br /><br />Since there is absolutely no reason to assume the new standard will escape the donations kiss of death, there is also no reason to believe it will be more tightly integrated than the 1800-2005. Both OVM and VMM have already been donated, and since it is quite unlikely that either Mentor/Cadence or Synopsys will agree to see their donations thrown away, what we will most probably have at the end is a sum that is less than its individual parts. It is quite likely that we will have a lot of duplicated functionality that will be kept inside only to save face in front of old customers. This duplicated functionality will mean, at the end of the day, that we will have several non-interoperable ways of doing things. Back to square one. <br /><br />Is there any way out of this situation? I would say the only way out is to give Accellera some real teeth and resources. Then it will be able to delegate such standard creation to a small company of independent experts, who will sit, just like a jury, in a room with no internet connection until white smoke comes out. Since they will be paid by Accellera, they will be able to fearlessly throw away spam donations, and develop missing parts themselves. <br /><br />It is quite simple: you can’t arbitrate between two competing sides if one of them is paying your salary. That’s why judges, for example, get paid by the state, right?]]></description>
	</item>
	<item rdf:about="http://www.specman-verification.com/?entry=entry080517-094449">
		<title>Randomizing an array of objects in SV </title>
		<link>http://www.specman-verification.com/index.php?entry=entry080517-094449</link>
		<description><![CDATA[Here&#039;s another code snippet I should have added already a while ago. It shows how you can randomize an array of SV objects, without using pre_randomize or post_randomize to do any randomization at all. Why it is so important to avoid doing any randomization in these two functions, will be explained below. Before we go into that philosophical discussion, however, here&#039;s the code:<br /><br />
    <pre>
<span class="keyword">module</span> top;
   <span class="verilog-font-lock-p1800">class</span> a;
      <span class="verilog-font-lock-p1800">rand</span> <span class="verilog-font-lock-p1800">int</span> b;
   <span class="verilog-font-lock-p1800">endclass</span>

   <span class="verilog-font-lock-p1800">class</span> b;
      <span class="verilog-font-lock-p1800">const</span> <span class="verilog-font-lock-p1800">int</span> <span class="verilog-font-lock-p1800">unsigned</span> max_array_size = 100;
      <span class="verilog-font-lock-p1800">rand</span> a obj_array[];

      <span class="verilog-font-lock-p1800">constraint</span> obj_array_size_c {obj_array.<span class="function-name">size</span>() < max_array_size;}

      <span class="keyword">function</span> <span class="reference"><span class="verilog-font-lock-p1800">void</span></span> <span class="function-name">pre_randomize</span>();
         obj_array = <span class="verilog-font-lock-p1800">new</span>[max_array_size];
         <span class="verilog-font-lock-p1800">foreach</span>(obj_array[j])
           obj_array[j] = <span class="verilog-font-lock-p1800">new</span>();
      <span class="keyword">endfunction</span>
<span class="comment">                           
</span>   <span class="verilog-font-lock-p1800">endclass</span>

   <span class="keyword">initial</span> <span class="keyword">begin</span>
      b b1 = <span class="verilog-font-lock-p1800">new</span>;
      b1.<span class="function-name">randomize</span>();
      <span class="keyword">$display</span>("<span class="string">done</span>");
   <span class="keyword">end</span>
   
<span class="keyword">endmodule</span></pre><br />Since SV never instantiates objects as part of the randomization process you have to instantiate an array of the maximal size at pre_randomize. SV will than randomize the size of the array, and because of the constraint that uses the size() method, will cut down your array to the new size. The objects up to the new size will be randomized, and the remaining ones will be removed out of the dynamic array, and left for garbage collection to take care of. <br /><br />As mentioned above, this code doesn&#039;t randomize either the size or any of the elements at pre_randomize or post_randomize. Randomizing stuff in pre_randomize or post_randomize means that you can no longer use constraints of any kind to direct the randomization. For example, had I done this:<br /><br />
<pre>
   <span class="verilog-font-lock-p1800">class</span> b;
      <span class="verilog-font-lock-p1800">const</span> <span class="verilog-font-lock-p1800">int</span> <span class="verilog-font-lock-p1800">unsigned</span> max_array_size = 100;
      <span class="verilog-font-lock-p1800">rand</span> a obj_array[];

      <span class="keyword">function</span> <span class="reference"><span class="verilog-font-lock-p1800">void</span></span> <span class="function-name">pre_randomize</span>();
         <span class="verilog-font-lock-p1800">int</span> obj_array_size = <span class="keyword">$urandom_range</span>(max_array_size,0);
         obj_array = <span class="verilog-font-lock-p1800">new</span>[obj_array_size];
         <span class="verilog-font-lock-p1800">foreach</span>(obj_array[j])
           obj_array[j] = <span class="verilog-font-lock-p1800">new</span>();
      <span class="keyword">endfunction</span>          
   <span class="verilog-font-lock-p1800">endclass</span></pre><br /><br />I wouldn’t have been able later to do this:<br /><br />
<pre>
   <span class="verilog-font-lock-p1800">class</span> c <span class="verilog-font-lock-p1800">extends</span> b;
      <span class="verilog-font-lock-p1800">constraint</span> obj_array_size_eq_1 {obj_array.<span class="function-name">size</span>() == 1;}
   <span class="verilog-font-lock-p1800">endclass</span></pre>
<br /><br />Or this:<br /><br /><pre>
   <span class="keyword">initial</span> <span class="keyword">begin</span>
      b b1 = <span class="verilog-font-lock-p1800">new</span>;
      b1.<span class="function-name">randomize</span>() <span class="verilog-font-lock-p1800">with</span> {obj_array.<span class="function-name">size</span>() == 5;};
      <span class="keyword">$display</span>("<span class="string">done</span>");
   <span class="keyword">end</span>
</pre><br /><br />In a real life testbench such limitations mean that users won’t be easily able to direct the generator towards interesting cases and coverage holes. From this point it’s a short way to having to patch your testbench with ugly workarounds to allow them to do the stuff they want. <br /> <br />However, with SV, this flexibility and control come at a relatively high price. As you might have noticed, you need to know upfront the maximal size your array will have. Worse, you need to allocate a maximal size array every time you call randomize. There might be tricks to work around that limitation, such as using prtototypes and fixed size arrays instead of dynamic ones but I&#039;ll not go into those right now because I still haven’t found the perfect mix. Maybe in a few years time :-)<br /><br />Many thanks to Ray Salemi From Mentor for his help with this entry.<br />]]></description>
	</item>
	<item rdf:about="http://www.specman-verification.com/?entry=entry080330-214734">
		<title>Soft constraints in SV</title>
		<link>http://www.specman-verification.com/index.php?entry=entry080330-214734</link>
		<description><![CDATA[For all those e veterans coding in SV and still badly missing their soft constraints, Akiva Michalson from ACE verification has wrote a small macro that would enable you to have soft constraints in SV as well. This is very convenient, and I tend to agree with Akiva when he says that it is a much nicer way than turning constraints on and off, the way some of them SV experts want us to go. Since he has a version of the macro for all the big three simulators (IUS, VCS and Questa), portability is not an issue here. I have just tried it with Questa, and you’re more than welcome to go ahead and give it a try on your simulator of choice for yourselves. <br /><br />Download it <a href="http://www.aceverification.com/softconstraints_pkg.htm" target="_blank" >here</a> (short registration required)<br /><br />  ]]></description>
	</item>
</rdf:RDF>

