<?xml version="1.0" encoding="ISO-8859-1"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xml:lang="en-US">
	<title>Tips for HVL and HDL users with special emphasis on Specman-e, SystemVerilog and Questa</title>
	<link rel="alternate" type="text/html" href="http://www.specman-verification.com/index.php" />
	<modified>2008-05-09T16:16:33Z</modified>
	<author>
		<name>Avidan Efody</name>
		<email>avidan_e@yahoo.com</email>
	</author>
	<copyright>Copyright 2008, Avidan Efody</copyright>
	<generator url="http://www.sourceforge.net/projects/sphpblog" version="0.4.6.1">SPHPBLOG</generator>
	<entry>
		<title>Soft constraints in SV</title>
		<link rel="alternate" type="text/html" href="http://www.specman-verification.com/index.php?entry=entry080330-214734" />
		<content type="text/html" mode="escaped"><![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 />  ]]></content>
		<id>http://www.specman-verification.com/index.php?entry=entry080330-214734</id>
		<issued>2008-03-30T00:00:00Z</issued>
		<modified>2008-03-30T00:00:00Z</modified>
	</entry>
	<entry>
		<title>First DATE with JL</title>
		<link rel="alternate" type="text/html" href="http://www.specman-verification.com/index.php?entry=entry080313-093740" />
		<content type="text/html" mode="escaped"><![CDATA[Several days ago I wrote that I will be manning Mentor’s OVM booth, but as all the attractive singles that came looking for me soon found out, this was only a vicious trick to attract them to our stand. In fact, someone in Mentor’s intricate administrative hierarchy made a mistake, which I only found out about yesterday. This means I had all the time in the world to wonder around the relatively empty stands in the relatively small exhibition area, and to collect all sorts of shiny papers and cheap gifts. Most of the sales people behind the stands were eager for some activity so even the shortest eye contact meant high risk of getting a lengthy lecture, most probably about a product that is in no way related to anything I did or will ever do. I got one such talk from the very nice guys at the <a href="http://www.cypress.com" target="_blank" >Cypress</a> desk, who showed me different kinds of cool gadgets that could be implemented with their mixed signal FPGA, among which a smell detector that could tell you the directions to an open bottle of Vodka, and a shoe whose sole fits itself to the terrain. Too bad they had only me as an audience for this quite impressive show… <br /><br />Johann Notbauer from Siemens in Wien gave a talk that is worth mentioning about a testbench written using the, meanwhile defunct, AVM. On the whole, he was quite positive about it and claimed that at the moment it was a good solution for verification of small-medium size blocks, which are often still verified using directed tests. This could happen even with companies that have access to, say Specman (such as Siemens), only because writing a full blown coverage driven testbench in this “strange” e language for a small block, is regarded as an overkill by many designers. Johann thinks the AVM, written and used with the “designer friendly” SV, and being run using the very same tool, has a big advantage here. <br /><br />The single thing he didn’t like about the AVM was the complexity of connecting testbench parts. I remember that in my pre-Mentor days I used to not quite like this part as well (but of course I love it now :-)). He found it too complex, and it in fact is – a bit too verbose, a bit too difficult to debug, and quite confusing. Even after a year with AVM I still found it difficult to connect ports, exports, imps and fifos in the right way. I think I’m in the process of figuring it all out, and when I do, I will publish some quick tutorial right here. Those of you who experienced the same problems with AVM will be probably happy to hear that the OVM went a long way in simplifying this part. Still, it is not the easiest in the world and does take some time to grasp. Hopefully later versions will make it even more straight forward. I promise I’ll be pushing for that…<br /><br />But the highlight of the day, was of course my meeting with <a href="http://www.coolverification.com" target="_blank" >JL</a>. We have talked on the phone and emailed a lot before, but we’ve never met face to face. I was quite happy to find out that JL is a very cool and friendly guy, that doesn’t put any airs because he hangs out with the biggest verification hot-shots, and the EDA world stars. We had a long interesting talk about blogging, Verilab and life in general, and he even paid for my coffee at the end. Now, that’s what I call a real successful DATE :-)]]></content>
		<id>http://www.specman-verification.com/index.php?entry=entry080313-093740</id>
		<issued>2008-03-13T00:00:00Z</issued>
		<modified>2008-03-13T00:00:00Z</modified>
	</entry>
	<entry>
		<title>VMM vs. OVM on coolverification</title>
		<link rel="alternate" type="text/html" href="http://www.specman-verification.com/index.php?entry=entry080306-184502" />
		<content type="text/html" mode="escaped"><![CDATA[JL has got an interesting, somewhat heated <a href="http://www.coolverification.com/2008/02/vmm---robust-an.html" target="_blank" >discussion</a> regarding the pros and cons of VMM vs. OVM going on at his place. It has attracted considerable amount of attention from various verification celebs and is sure worth a look. <br /><br />JL makes the claim that the initiative in SV verification is not in the hands of Synopsys anymore: Synopsys got stuck on the proprietery VMM for too long, and therefore lost its cutting edge position to the more advanced and open-source OVM. Personally I think he&#039;s right but having no real hands-on experience with VMM I believe my opinion is not very well informed. As I&#039;m going to be wearing an OVM shirt and manning Mentor&#039;s OVM booth at the <a href="http://www.date-conference.com/" target="_blank" >DATE</a> next week (say hello if you&#039;re passing by!), there are chances that it is biased as well.   <br /><br />Having nothing clever to say about the present, let me turn my attention to the future. An interesting question for me is whether the OVM will benefit from Synopsys joining in. Obviously, the OVM alliance doesn&#039;t mean Mentor and Cadence are not bitter competitors anymore. The competition is also reflected in the OVM, where in some domains, a Cadence flavor and a Mentor flavor exist. Although I believe that sooner or later technical common sense (backed up by powerful cleints) will prevail, and one of the flavors will be dropped, this process could probably go faster if a &quot;responsiple adult&quot; is present in the room as well. In that sense, I think Synopsys presence might be good news. On the other hand, it might also result in having a third &quot;Synopsys&quot; flavor, which might make the OVM an empty shell.<br /><br />]]></content>
		<id>http://www.specman-verification.com/index.php?entry=entry080306-184502</id>
		<issued>2008-03-06T00:00:00Z</issued>
		<modified>2008-03-06T00:00:00Z</modified>
	</entry>
	<entry>
		<title>SV tutorial and personal news</title>
		<link rel="alternate" type="text/html" href="http://www.specman-verification.com/index.php?entry=entry080222-050551" />
		<content type="text/html" mode="escaped"><![CDATA[Thanks to continental airlines and a six hour delay on my flight to Portland, I&#039;ve finally got to start my <a href="http://www.specman-verification.com/sv_tutorial.php?page=IntroductionToSVTutorial" target="_blank" >SystemVerilog tutorial</a>. Not a lot there at the moment, but hopefully I&#039;ll soon have some other delayed flights...<br /><br />Full disclosure: Last month I&#039;ve switched from Verilab to Mentor Graphics. Although I intend to keep this blog as objective as before, and even leave its name and domain intact, readers are warned, so that they take subsequent information, with as many grains of salt as they want.<br />]]></content>
		<id>http://www.specman-verification.com/index.php?entry=entry080222-050551</id>
		<issued>2008-02-22T00:00:00Z</issued>
		<modified>2008-02-22T00:00:00Z</modified>
	</entry>
	<entry>
		<title>OVM is finally released</title>
		<link rel="alternate" type="text/html" href="http://www.specman-verification.com/index.php?entry=entry080109-184226" />
		<content type="text/html" mode="escaped"><![CDATA[<a href="http://www.ovmworld.org/" target="_blank" >http://www.ovmworld.org/</a><br /><br />Didn&#039;t have a chance to look at it yet. Feel free to comment if you did.]]></content>
		<id>http://www.specman-verification.com/index.php?entry=entry080109-184226</id>
		<issued>2008-01-09T00:00:00Z</issued>
		<modified>2008-01-09T00:00:00Z</modified>
	</entry>
	<entry>
		<title>How to return an array from an SV function?</title>
		<link rel="alternate" type="text/html" href="http://www.specman-verification.com/index.php?entry=entry080107-212235" />
		<content type="text/html" mode="escaped"><![CDATA[Here&#039;s a code snippet I should have posted already some time ago. It shows you how you can return an array from an SV function. It runs with Questa 6.3c, but not with NC 6.2 that still doesn&#039;t support this feature (and many many others, if I may add). Have a look first, and then we can discuss it shortly:<br /><br />
     <pre>
<span class="type">typedef</span> <span class="verilog-font-lock-p1800">int</span> int_array5[5][5];
<span class="type">typedef</span> <span class="verilog-font-lock-p1800">int</span> int_array[][];
<span class="type">typedef</span> <span class="verilog-font-lock-p1800">int</span> int_q[$][$];


<span class="keyword">module</span> top;
   <span class="verilog-font-lock-p1800">int</span> a[5][5];
   <span class="verilog-font-lock-p1800">int</span> b[][];
   <span class="verilog-font-lock-p1800">int</span> c[$][$];

   <span class="comment">// The obvious way doesn&#039;t compile
</span>   <span class="comment">//function </span><span class="reference"><span class="comment">int</span></span><span class="comment">[5][5] d(int arr5[5][5]);
</span>   <span class="comment">//   return arr5;
</span>   <span class="comment">//endfunction
</span>
   <span class="keyword">function</span> <span class="reference">int_array5</span> d(<span class="verilog-font-lock-p1800">int</span> arr5[5][5]);
      <span class="keyword">return</span> arr5;
   <span class="keyword">endfunction</span> <span class="comment">// d
</span>
   <span class="keyword">function</span> <span class="reference">int_array</span> e(<span class="verilog-font-lock-p1800">int</span> arr[][]); 
      <span class="keyword">return</span> arr;
   <span class="keyword">endfunction</span> <span class="comment">// d
</span>
   <span class="keyword">function</span> <span class="reference">int_q</span> f(<span class="verilog-font-lock-p1800">int</span> q[$][$]);
      <span class="keyword">return</span> q;
   <span class="keyword">endfunction</span> <span class="comment">// d
</span>
   <span class="keyword">initial</span> <span class="keyword">begin</span>
      <span class="verilog-font-lock-p1800">void</span>&#039;(d(a));
      <span class="verilog-font-lock-p1800">void</span>&#039;(e(b));
      <span class="verilog-font-lock-p1800">void</span>&#039;(f(c));
   <span class="keyword">end</span>
<span class="keyword">endmodule</span>
   
</pre><br /><br />The SV standard shows how you can pass an array argument to a function at section 5.8 under &quot;arrays as arguments&quot;. Great. However, at least as far as I could tell, it is silent about arrays as return values. The obvious way shown above simply does not compile, which is why it is commented out.<br /><br />You might ask yourself if this clumsy typedef trick is really the standard way, or just a workaround some SV feature that is still unsupported by Questa. I believe, and please correct me if I&#039;m wrong, that the clumsy way is the standard one. The SV formal syntax BNF at annex A of the standard, which I usually do my best to avoid, says that a function return type is defined as:<br /><br />data_type_or_implicit ::=<br />integer_vector_type [ signing ] { packed_dimension }<br />| integer_atom_type [ signing ]<br />| non_integer_type<br />| struct_union [ packed [ signing ] ] { struct_union_member { struct_union_member } }<br />{ packed_dimension }<br />| enum [ enum_base_type ] { enum_name_declaration { , enum_name_declaration } }<br />| string<br />| chandle<br />| virtual [ interface ] interface_identifier<br />| [ class_scope | package_scope ] type_identifier { packed_dimension }<br />| class_type<br />| event<br />| ps_covergroup_identifier<br />| type_reference<br /><br />Compare this with the definition of a function argument, and you’ll see that the “variable_dimension” part which exists below, is missing above:<br /><br />tf_port_item ::=<br />{ attribute_instance }<br />[ tf_port_direction ] [ var ] data_type_or_implicit<br />[ port_identifier { variable_dimension } [ = expression ] ]<br /><br />So, you can’t put a “variable_dimension” for the return argument, but you can do it for arguments you pass. For the return arguments, therefore, you don’t have a choice but to use a typedef (the option type_reference above).<br /><br />And now you know why I do my best to avoid this BNF part…<br />]]></content>
		<id>http://www.specman-verification.com/index.php?entry=entry080107-212235</id>
		<issued>2008-01-07T00:00:00Z</issued>
		<modified>2008-01-07T00:00:00Z</modified>
	</entry>
</feed>

