<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AgileSoC</title>
	<atom:link href="http://www.agilesoc.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.agilesoc.com</link>
	<description>Bringing Agile Methods  to Soc Development</description>
	<lastBuildDate>Wed, 22 Feb 2012 16:32:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>By Example: Test-driven Development of Verification IP</title>
		<link>http://www.agilesoc.com/2012/02/20/by-example-test-driven-development-of-verification-ip/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=by-example-test-driven-development-of-verification-ip</link>
		<comments>http://www.agilesoc.com/2012/02/20/by-example-test-driven-development-of-verification-ip/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 06:03:42 +0000</pubDate>
		<dc:creator>nosnhojn</dc:creator>
				<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://www.agilesoc.com/?p=1483</guid>
		<description><![CDATA[I&#8217;ve been putting a lot of time into developing new examples for SVUnit lately and as of wednesday last week, I&#8217;ve finished another to show how people can use SVUnit to do test-driven development of verification IP. This particular example &#8230; <a href="http://www.agilesoc.com/2012/02/20/by-example-test-driven-development-of-verification-ip/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been putting a lot of time into developing new examples for SVUnit lately and as of wednesday last week, I&#8217;ve finished another to show how people can use SVUnit to do test-driven development of verification IP.</p>
<p>This particular example involves development of an APB master BFM. APB isn&#8217;t the most complicated of bus protocols but it&#8217;s a very good subject for an example like this because the code and tests are easy to understand (there&#8217;s an APB example in the latest UVM release also, presumably for the same reason).</p>
<blockquote><p>UPDATE: for people looking at UVM Express that was announced by Mentor Graphics on Feb 22, this is my interpretation of how TDD can be applied at the lowest layer development of the BFM. Examples showing the addition of functional coverage and completion of an agent that includes sequence generation are still to come. You can see UVM Express on the Mentor website by going <a href="http://verificationacademy.com/course-modules/uvm-ovm-verification/uvm-express-adopting-uvm-and-uvm-verification-style">here</a>.</p></blockquote>
<p><span id="more-1483"></span></p>
<p>In terms of requirements and documentation for our BFM, I&#8217;ll describe what&#8217;s going on with a couple of user stories:</p>
<p><a href="http://www.agilesoc.com/wp-content/uploads/2012/02/IMG107.jpg"><img class="alignnone size-medium wp-image-1489" title="IMG107" src="http://www.agilesoc.com/wp-content/uploads/2012/02/IMG107-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><a href="http://www.agilesoc.com/wp-content/uploads/2012/02/IMG106.jpg"><img class="alignnone size-medium wp-image-1488" title="IMG106" src="http://www.agilesoc.com/wp-content/uploads/2012/02/IMG106-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>There&#8217;s 2 stories that aptly describe this APB master verification IP. The ability to write/read memory of a peripheral and that&#8217;s pretty much it.</p>
<p>Here&#8217;s the acceptance criteria for both stories:</p>
<p><a href="http://www.agilesoc.com/wp-content/uploads/2012/02/IMG108.jpg"><img class="alignnone size-medium wp-image-1490" title="IMG108" src="http://www.agilesoc.com/wp-content/uploads/2012/02/IMG108-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>Because there&#8217;s 101 ways to build an APB BFM, the acceptance criteria here is important for narrowing things down. We&#8217;re looking for something equally useful for designers and verifiers so we&#8217;re not going to use anything fancy like UVM and we&#8217;re not going to use a transaction interface or anything constrained-random-like (which always seems to be the impulse of verification engineers). We&#8217;re just going to have IP with a simple method user interface on 1 side and pins on the other that could be connected to a peripheral. Arguably, a systemverilog interface is best for this so that&#8217;s the direction I went.</p>
<p>I was missing some necessary features for SVUnit so before I got started, I had to add support for generating unit test templates for systemverilog interfaces. I based the template off what I had already done for the module unit test template so it didn&#8217;t take long to get that done. With 1 test to verify the template output and 2 others to verify it compiled and simulated in both Questa and VCS, I could move on to the actual example.</p>
<p>The first tests I added to the unit test template were synchronous and asynchronous reset tests. No, they weren&#8217;t present on a story card but I thought this would be a good place to start anyway because they&#8217;re useful and would require all the pins of the interface but next to no functionality. Here&#8217;s one of those tests (fyi&#8230; `MST_EXPECT is a macro that checks each of the output ports on the interface. I expect all to be 0 after the reset):</p>
<p><a href="http://www.agilesoc.com/wp-content/uploads/2012/02/Picture-7.png"><img class="alignnone size-full wp-image-1499" title="Picture 7" src="http://www.agilesoc.com/wp-content/uploads/2012/02/Picture-7.png" alt="" width="340" height="161" /></a></p>
<p>The first time I ran this test, it failed &#8211; as I expected &#8211; in compilation because none of the pins nor the reset method existed in the interface yet. I added the pins and an empty method and ran it again. That ended in a runtime failure &#8211; again as I expected &#8211; because the reset method was empty and my FAIL_IF assertions were firing (here, FAIL_IF is hidden in the MST_EXPECT but you&#8217;ll see it in the next test). Add the reset functionality in the interface method, run the test a 3rd time and voila&#8230; my first passing test and my first complete loop through the TDD cycle:</p>
<blockquote><p><strong>Add a test, confirm the test fails, add just enough design code, confirm the test passes.</strong></p></blockquote>
<p>The next test I wrote had to do with testing the functionality of the select pin for a write, which takes me into implementation of our first user story. Here&#8217;s that test:</p>
<p><a href="http://www.agilesoc.com/wp-content/uploads/2012/02/Picture-8.png"><img class="alignnone size-full wp-image-1498" title="Picture 8" src="http://www.agilesoc.com/wp-content/uploads/2012/02/Picture-8.png" alt="" width="398" height="227" /></a></p>
<p>You see here that I&#8217;m calling the write method on the interface and in parallel I&#8217;m checking the functionality of the select pin. Running this the first time ends of course with a compilation error because the write method doesn&#8217;t exist yet. I add an empty write method, run it again and see the failures from my FAIL_IF assertions again&#8230; which is exactly where I want to be. Now I add the code required to control the select. That means adding a state machine that takes the interface from IDLE to SETUP to ENABLE and back to IDLE while the select pin is active in SETUP and ENABLE but inactive in IDLE. Here&#8217;s the code I added to do that:</p>
<p><a href="http://www.agilesoc.com/wp-content/uploads/2012/02/Picture-10.png"><img class="alignnone size-full wp-image-1495" title="Picture 10" src="http://www.agilesoc.com/wp-content/uploads/2012/02/Picture-10.png" alt="" width="238" height="503" /></a></p>
<p>You&#8217;ll notice that my definition of <em>just enough</em> includes the write method, the FSM, the logic to control the select for a single write and some synchronization. I have nothing more than that because that&#8217;s all I need to pass my test. Run SVUnit again and now I have 2 passing tests: I know I can reset my interface and I know the select works properly for a single write.</p>
<p>One last example to drive it home&#8230; the next test I wrote was still focused on the select pin but was verifying it would remain active for 4 cycles in the case of back-to-back write transactions. Here&#8217;s the test:</p>
<p><a href="http://www.agilesoc.com/wp-content/uploads/2012/02/Picture-9.png"><img class="alignnone size-full wp-image-1497" title="Picture 9" src="http://www.agilesoc.com/wp-content/uploads/2012/02/Picture-9.png" alt="" width="387" height="256" /></a></p>
<p>That failed because the BFM couldn&#8217;t yet handle the transition from ENABLE back to SELECT. Here&#8217;s the update to the BFM that I had to make to pass the test:</p>
<p><a href="http://www.agilesoc.com/wp-content/uploads/2012/02/Picture-11.png"><img class="alignnone size-full wp-image-1496" title="Picture 11" src="http://www.agilesoc.com/wp-content/uploads/2012/02/Picture-11.png" alt="" width="389" height="228" /></a></p>
<p>Several more baby steps through the TDD cycle eventually led to a completed ABP BFM. Instead of boring you with the rest of the code, I&#8217;ll leave you with some statistics of what I ended up with after I was finished.</p>
<ul>
<li>My APB BFM ended up being ~200 lines long</li>
<li>It includes methods for writing and reading that designers and verifiers would both find easy to use</li>
<li>I ended up with 26 tests in a unit test template that was ~550 lines long</li>
<li>I had 2 tests for each port on the interface to verify it behaved correctly for single read/write transactions and back-to-back read/write transactions</li>
<li>SVUnit tells me in about 4 seconds (of which about 3.5 sec is spent in compilation) whether or not my APB BFM is working properly</li>
<li>Including the addition of interface support to SVUnit, this whole thing took me about 5 hours&#8230; from 8pm to 1:30am with a half hour break for tea at midnight <img src='http://www.agilesoc.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>I&#8217;ll summarize by saying that as a beginner, I still find it a little tricky to get into TDD mode where I think in terms of tests first. Once I&#8217;m there though, I find it&#8217;s a very practical way to write code. And the best part is that you know the code is working as you write it as opposed to debugging it after the fact.</p>
<p>If you&#8217;re interested in seeing and running the results, this APB BFM example is currently available to SVUnit early adopters in the examples directory. If you&#8217;re not an SVUnit early adopter but you&#8217;re interested in becoming one, you can get a hold of me at neil.johnson@agilesoc.com.</p>
<p>-neil</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F20%2Fby-example-test-driven-development-of-verification-ip%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F20%2Fby-example-test-driven-development-of-verification-ip%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F20%2Fby-example-test-driven-development-of-verification-ip%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F20%2Fby-example-test-driven-development-of-verification-ip%2F&amp;count=none&amp;text=By%20Example%3A%20Test-driven%20Development%20of%20Verification%20IP" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F20%2Fby-example-test-driven-development-of-verification-ip%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F20%2Fby-example-test-driven-development-of-verification-ip%2F&amp;count=none&amp;text=By%20Example%3A%20Test-driven%20Development%20of%20Verification%20IP" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F20%2Fby-example-test-driven-development-of-verification-ip%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F20%2Fby-example-test-driven-development-of-verification-ip%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F20%2Fby-example-test-driven-development-of-verification-ip%2F&amp;linkname=By%20Example%3A%20Test-driven%20Development%20of%20Verification%20IP" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.agilesoc.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F20%2Fby-example-test-driven-development-of-verification-ip%2F&amp;title=By%20Example%3A%20Test-driven%20Development%20of%20Verification%20IP" id="wpa2a_2">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.agilesoc.com/2012/02/20/by-example-test-driven-development-of-verification-ip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unit Testing UVM Components: The Making Of</title>
		<link>http://www.agilesoc.com/2012/02/09/unit-testing-uvm-components-the-making-of/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=unit-testing-uvm-components-the-making-of</link>
		<comments>http://www.agilesoc.com/2012/02/09/unit-testing-uvm-components-the-making-of/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 08:43:40 +0000</pubDate>
		<dc:creator>nosnhojn</dc:creator>
				<category><![CDATA[Functional Verification]]></category>

		<guid isPermaLink="false">http://www.agilesoc.com/?p=1459</guid>
		<description><![CDATA[Today we take another step into the practical with a demonstration of how SVUnit can be used to test UVM components. In the 3rd installment of the SVUnit Demo Series, I take people through a simple &#8211; yet complete &#8211; &#8230; <a href="http://www.agilesoc.com/2012/02/09/unit-testing-uvm-components-the-making-of/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today we take another step into the practical with a demonstration of how SVUnit can be used to test UVM components.</p>
<p>In the 3rd installment of the <a title="The SVUnit Demo Series" href="http://www.agilesoc.com/agilesoc-on-demand/the-svunit-demo-series/">SVUnit Demo Series</a>, I take people through a simple &#8211; yet complete &#8211; example of what&#8217;s required to test a UVM component within the SVUnit framework (if you haven&#8217;t seen the video yet, I&#8217;d recommend watching it <a title="SVUnit: Unit Testing UVM Components" href="http://www.agilesoc.com/agilesoc-on-demand/the-svunit-demo-series/svunit-unit-testing-uvm-components/">here</a> before reading on). The example I put together, and more importantly the plumbing under the hood required to make it work took me quite a while to put together for reasons that I don&#8217;t really get into in the video&#8230; but I will talk a bit about them here.</p>
<p>The usage model for SVUnit involves sequentially running a series of classes or modules through a corresponding list of unit test methods. In UVM however, due to the tight coupling between the phase methods in all uvm components and the instance of the uvm_root that ultimately drives the invocation of each phase method, uvm components are run in parallel.</p>
<p>One usage model wanting to be sequential and the other coded for parallelism gives us two models that are fundamentally at odds&#8230; so for unit testing UVM components, I had to get creative <img src='http://www.agilesoc.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>I wouldn&#8217;t consider myself a UVM expert so the best way forward wasn&#8217;t immediately obvious. First I attempted to disable the components I wasn&#8217;t interested in by temporarily removing them from the component hierarchy. That was a dead end however because of the local access restrictions. My second idea was to replace components with a dud that effectively had no implementation&#8230; which means if the dud ran in place of an actual component, nothing would end up happening. That too was a dead end because of the same local access restrictions of the component hierarchy (in hindsight I should have known right away this was a no-go but I was still learning!).</p>
<p>The last implementation that ended up working involved creating and adding a new uvm_domain that ran in parallel with the existing UVM domain (where the run phases are stored). In the video, I talk about idle components that do nothing and a single unit under test that is driven through the run phases, iteratively if necessary. The idle components end up being idle because the newly created domain they&#8217;re assigned to &#8211; after of course going through the common phases of build, connect, end of elaboration and start of simulation &#8211; ends up raising an objection in the pre_reset_phase. That objection effectively means that components assigned to the domain never advance further. That&#8217;s what idle means&#8230; never advancing further than pre_reset.</p>
<p>I was pleasantly surprised to see that components could be assigned to different domains at any time which means I could activate and deactivate components whenever I wanted simply by changing which domain they&#8217;re assigned to.</p>
<p>When a component is deactivated, it is assigned to the new idle domain by&#8230;</p>
<pre>function void svunit_deactivate_uvm_component(uvm_component c);
  c.set_domain(svunit_idle_uvm_domain::get_svunit_domain(), 1);
endfunction</pre>
<p>Similarly, where I show a component being activated, it is being assigned to the normal uvm domain by&#8230;</p>
<pre>function void svunit_activate_uvm_component(uvm_component c);
  c.set_domain(uvm_domain::get_uvm_domain(), 1);
endfunction</pre>
<p>That seems to be the trick to being able to run uvm components sequentially in SVUnit without adding any new control or requirements to the components themselves, something I was looking to avoid from the outset.</p>
<p>If you want to take a closer look at the code, you can become an SVUnit project member and early adopter by getting a hold of me at neil.johnson@agilesoc.com.</p>
<p>Bonus marks go to the person that looks at the code and can suggest a better way of doing the same thing!</p>
<p>-neil</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F09%2Funit-testing-uvm-components-the-making-of%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F09%2Funit-testing-uvm-components-the-making-of%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F09%2Funit-testing-uvm-components-the-making-of%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F09%2Funit-testing-uvm-components-the-making-of%2F&amp;count=none&amp;text=Unit%20Testing%20UVM%20Components%3A%20The%20Making%20Of" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F09%2Funit-testing-uvm-components-the-making-of%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F09%2Funit-testing-uvm-components-the-making-of%2F&amp;count=none&amp;text=Unit%20Testing%20UVM%20Components%3A%20The%20Making%20Of" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F09%2Funit-testing-uvm-components-the-making-of%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F09%2Funit-testing-uvm-components-the-making-of%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F09%2Funit-testing-uvm-components-the-making-of%2F&amp;linkname=Unit%20Testing%20UVM%20Components%3A%20The%20Making%20Of" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.agilesoc.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F02%2F09%2Funit-testing-uvm-components-the-making-of%2F&amp;title=Unit%20Testing%20UVM%20Components%3A%20The%20Making%20Of" id="wpa2a_4">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.agilesoc.com/2012/02/09/unit-testing-uvm-components-the-making-of/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Work Smarter, Not Harder</title>
		<link>http://www.agilesoc.com/2012/01/30/work-smarter-not-harder/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=work-smarter-not-harder</link>
		<comments>http://www.agilesoc.com/2012/01/30/work-smarter-not-harder/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 18:17:22 +0000</pubDate>
		<dc:creator>nosnhojn</dc:creator>
				<category><![CDATA[Leadership]]></category>

		<guid isPermaLink="false">http://www.agilesoc.com/?p=1446</guid>
		<description><![CDATA[You&#8217;ve been working 12 hour days for the last 4 months. You&#8217;re coming off a night of only 4 hours sleep because all you could think about was the all-hands meeting with the CEO, CFO and CTO the next morning &#8230; <a href="http://www.agilesoc.com/2012/01/30/work-smarter-not-harder/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ve been working 12 hour days for the last 4 months. You&#8217;re coming off a night of only 4 hours sleep because all you could think about was the all-hands meeting with the CEO, CFO and CTO the next morning where you&#8217;d be reminded that you&#8217;re 3 months behind schedule. Your alarm sounds. You drag yourself into work. You&#8217;re there in the meeting &#8211; just barely &#8211; leaning back half asleep. After listening for 30 minutes about how important &lt;this release&gt; is the company, you finally hear it&#8230;</p>
<blockquote><p>We need to find a way to work smarter (not harder).</p></blockquote>
<p>The ultimate bit of useless advice&#8230; work smarter, not harder &#8211; or some variation thereof.</p>
<p><span id="more-1446"></span>Thanks. Will do.</p>
<p>From managers (sorry for picking on managers but I think they&#8217;ll probably agree with me on this), the &#8220;work smarter not harder&#8221; imperative never seems to have the intended effect. It comes across more like &#8220;maybe if you thought about things a little bit we&#8217;d be done by now, we&#8217;d be getting rich off our stock options and instead of wasting your evenings in the office, you could be out waterskiing behind your new boat or golfing in Hawaii&#8221;.</p>
<p>What&#8217;s wrong with &#8220;work smarter&#8221;? It&#8217;s vague, there&#8217;s no method or actual goal, it devalues the hard work you <em>are</em> putting in, it always seems to come at a time of intense stress, and it injects panic instead of hope. Not exactly helpful. It is logical advice though and for some reason, I spent my weekend thinking about options for work smarter, not harder that teams can use to challenge themselves before the steady 12 hour work days kick in.</p>
<p>Here&#8217;s what I came up with&#8230;</p>
<ul>
<li>What would we have to do to cut our tools budget by 50% while maintaining our productivity and quality?</li>
<li>How could we cut our regression times in half without increasing the size of our server farm?</li>
<li>How could we get 5 days worth of work done in 4 days?</li>
<li>How would we organize ourselves if we had no one to manage us?</li>
<li>How could we limit the number of known defects to 1 or less (where less == 0)?</li>
<li>How could we cut the size of our product by 25% without losing customers?</li>
<li>How could we condense our design documentation by 75%?</li>
<li>How could we lower our defect rate by 90%?</li>
</ul>
<p>You&#8217;ll notice that these are pretty aggressive ideas and that&#8217;s on purpose. Aggressive goals like these would force teams to think outside the box (there&#8217;s another useful cliche <img src='http://www.agilesoc.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) to find new/interesting/revolutionary changes to the way they work instead of looking for the evolutionary optimizations that never seem to get us much further ahead. These ideas are probably a good way to recognize the wasted time and effort in your development process that you&#8217;ve been accepting without realizing it.</p>
<p>So the challenge is&#8230; get your team together, pick a seemingly outrageous goal from the list I have or think of one on your own, brainstorm a list of ways to make it happen (no idea is too stupid) and then go do it.</p>
<p>Small optimizations are not an option. Go big or go home <img src='http://www.agilesoc.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>-neil</p>
<p><strong>Q. What &#8220;work smarter&#8221; goals would you add to the list? How would you (or have you) reached those goals?</strong></p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F30%2Fwork-smarter-not-harder%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F30%2Fwork-smarter-not-harder%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F30%2Fwork-smarter-not-harder%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F30%2Fwork-smarter-not-harder%2F&amp;count=none&amp;text=Work%20Smarter%2C%20Not%20Harder" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F30%2Fwork-smarter-not-harder%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F30%2Fwork-smarter-not-harder%2F&amp;count=none&amp;text=Work%20Smarter%2C%20Not%20Harder" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F30%2Fwork-smarter-not-harder%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F30%2Fwork-smarter-not-harder%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F30%2Fwork-smarter-not-harder%2F&amp;linkname=Work%20Smarter%2C%20Not%20Harder" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.agilesoc.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F30%2Fwork-smarter-not-harder%2F&amp;title=Work%20Smarter%2C%20Not%20Harder" id="wpa2a_6">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.agilesoc.com/2012/01/30/work-smarter-not-harder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is Specialization Good For Hardware Development?</title>
		<link>http://www.agilesoc.com/2012/01/27/is-specialization-good-for-hardware-development/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=is-specialization-good-for-hardware-development</link>
		<comments>http://www.agilesoc.com/2012/01/27/is-specialization-good-for-hardware-development/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 17:18:03 +0000</pubDate>
		<dc:creator>nosnhojn</dc:creator>
				<category><![CDATA[Leadership]]></category>

		<guid isPermaLink="false">http://www.agilesoc.com/?p=1437</guid>
		<description><![CDATA[Last night I started reading &#8220;The Machine That Changed The World&#8221;. It&#8217;s a book from 1990 that I&#8217;ve been meaning to read for a couple years that documents the rise of lean production through the 1900&#8242;s at companies like Toyota. &#8230; <a href="http://www.agilesoc.com/2012/01/27/is-specialization-good-for-hardware-development/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last night I started reading &#8220;The Machine That Changed The World&#8221;. It&#8217;s a book from 1990 that I&#8217;ve been meaning to read for a couple years that documents the rise of lean production through the 1900&#8242;s at companies like Toyota. The second chapter called <em>The Rise And Fall Of Mass Production</em> foreshadows a point on specialization that is discussed in detail (I&#8217;m assuming) later in the book. I thought it was interesting enough to post here for opinions on how it may or may not apply to specialization in hardware development.</p>
<p><span id="more-1437"></span></p>
<p>From page 31 of <a href="http://www.amazon.ca/gp/product/0743299795/ref=pd_lpo_k2_dp_sr_1/182-4488699-8589043?pf_rd_m=A3DWYIK6Y9EEQB&amp;pf_rd_s=lpo-top-stripe&amp;pf_rd_r=0ZX4B9KD30Y578HK7P1R&amp;pf_rd_t=201&amp;pf_rd_p=485327511&amp;pf_rd_i=0060974176">The Machine That Changed The World</a>, this is part of the last paragraph in a section that describes specialization of the skilled workforce in a mass production system:</p>
<blockquote><p>As time went on and engineering branched into more and more subspecialties, these engineering professionals found they had more and more to say to their subspecialists and less and less to say to engineers with other expertise. As cars and trucks became ever more complicated, this minute division of labor within engineering would result in massive dysfunctions&#8230;&#8221;</p></blockquote>
<p>What if we mangle that last sentence to apply to hardware development?</p>
<blockquote><p>&#8220;As [systems become] ever more complicated, this minute division of labor within engineering [will] result in massive dysfunctions.&#8221;</p></blockquote>
<p>Does that comment make sense when we take count all the people required to put a piece of hardware together? I can think of systems engineers, design engineers-digital and analog, functional verification engineers, physical design engineers, software developers, support and application specialists, tech-writers and various layers of management. I know I&#8217;m missing others.</p>
<p>Some specialization is necessary, but how much is too much? Do you see <em>massive dysfunctions</em> arise from specialization in hardware development?</p>
<p>-neil</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F27%2Fis-specialization-good-for-hardware-development%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F27%2Fis-specialization-good-for-hardware-development%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F27%2Fis-specialization-good-for-hardware-development%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F27%2Fis-specialization-good-for-hardware-development%2F&amp;count=none&amp;text=Is%20Specialization%20Good%20For%20Hardware%20Development%3F" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F27%2Fis-specialization-good-for-hardware-development%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F27%2Fis-specialization-good-for-hardware-development%2F&amp;count=none&amp;text=Is%20Specialization%20Good%20For%20Hardware%20Development%3F" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F27%2Fis-specialization-good-for-hardware-development%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F27%2Fis-specialization-good-for-hardware-development%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F27%2Fis-specialization-good-for-hardware-development%2F&amp;linkname=Is%20Specialization%20Good%20For%20Hardware%20Development%3F" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.agilesoc.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F27%2Fis-specialization-good-for-hardware-development%2F&amp;title=Is%20Specialization%20Good%20For%20Hardware%20Development%3F" id="wpa2a_8">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.agilesoc.com/2012/01/27/is-specialization-good-for-hardware-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SVUnit Future Directions</title>
		<link>http://www.agilesoc.com/2012/01/09/svunit-future-directions-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=svunit-future-directions-2</link>
		<comments>http://www.agilesoc.com/2012/01/09/svunit-future-directions-2/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 13:00:50 +0000</pubDate>
		<dc:creator>Bryan Morris</dc:creator>
				<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://www.agilesoc.com/?p=1403</guid>
		<description><![CDATA[Future Directions of SVUnit This post looks at some ideas for future directions for SVUnit.  Both Neil and I put forth our views. Bryan&#8217;s Views I’m putting these ideas out there with a hope that you’ll tell me that my &#8230; <a href="http://www.agilesoc.com/2012/01/09/svunit-future-directions-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Future Directions of SVUnit</strong></p>
<p>This post looks at some ideas for future directions for SVUnit.  Both Neil and I put forth our views.</p>
<p><span id="more-1403"></span></p>
<p><strong>Bryan&#8217;s Views</strong></p>
<p>I’m putting these ideas out there with a hope that you’ll tell me that my thoughts are good, impractical, ridiculous, or feel free join in the discussion and share your own ideas on where we should go with the SVUnit.   Now that the source code is open-source (Apache License) and pushed into a sourceforge project we can all contribute and use the framework.</p>
<p>But first, I’ll throw my ideas onto the wall to see what sticks!</p>
<p><strong>UVM</strong></p>
<p>This framework was created pre-UVM so you can probably guess that I think it might be a good idea to either convert SVUnit over to be an UVM compliant framework, or at worst fork this library off and create a new project e.g., uvm_unit.  That is, the non-UVM SVUnit will continue so that people not using UVM can still get value from the work, while the UVM compliant version can also develop in parallel.</p>
<p>I think creating a UVM-compliant library for unit-testing is necessary.  The SystemVerilog world is standardizing on the UVM base class library and creating something that is eventually not compliant seems pointless.  I do appreciate that there are still plenty of projects that are using pre-UVM base class libraries and can still benefit from a methodology-independent TDD framework — which is what SVUnit currently provides.</p>
<p>As well, if it is a UVM-compliant library, it is conceivable that it could be discussed, and eventually rolled into the UVM “standard” — giving a consistent way for all of us to do TDD.</p>
<p>What do I mean by ‘converting’ to UVM?  At the very least, the UVM Unit would have the following features:</p>
<ul>
<li>Move all messaging to use the <em>`uvm_info</em>, `<em>uvm_error </em> etc. macros.</li>
<li>Deriving each from the <em>uvm_component</em> so that it can benefit from the standard phasing and objection mechanisms.</li>
</ul>
<p>The last one is bit open for speculation i.e., should I derive from <em>uvm_component</em>, or is there a more appropriate class like the seemingly appropriate <em>uvm_test</em>.  From my perspective, the SVUnit framework needs to be fairly light-weight.  (I find it difficult to describe UVM as ‘light-weight’).  Comprehensive yes; light-weight, no.  Meaning that while it clearly defines a very nice structure to build a verification environment, it does require a lot of classes and a lot of ‘plumbing’ code to get running.  Albeit true, once you get all that plumbing code finished, you have a fine structure to work from to add the application specific code i.e., what we get paid for.</p>
<p>This post is already long, and I have some other ideas to cover so my next post will start to put out some further ideas on creating a UVM-compliant SVUnit library.  Here&#8217;s a <em>teaser</em> UML diagram of what I&#8217;m thinking.  More on that in a later post&#8230;</p>
<p><a href="http://www.agilesoc.com/wp-content/uploads/2011/12/uvm_unit_class.png"><img class="alignnone size-full wp-image-1366" title="uvm_unit_class" src="http://www.agilesoc.com/wp-content/uploads/2011/12/uvm_unit_class.png" alt="" width="418" height="1036" /></a></p>
<p><strong>Generator</strong></p>
<p>The second direction that needs to be considered is to improve the current batch of scripts that are available to generate all the ‘plumbing’ code required by the framework itself.  Neil has done a great job updating these scripts to be more robust than the initial implementation.  These generators make it truly convenient and quick to create a test environment to run your unit tests quickly.  Two key elements of TDD are “fast” and “easy”. In other words, you want to create a testcase quickly and easily, and you want to run a testcase quickly and easily.  The generator scripts enable that fast and easiness.</p>
<p>My current thoughts on improvements to the generator scripts are:</p>
<ul>
<li>Look at using the more standard ‘template’ libraries to generate the code.</li>
<li>Generate the appropriate UVM related infrastructure</li>
<li>Wrap a <em>simple</em> GUI Test Runner to allow people to execute, report and view test case execution.  Related to this is that I’m currently looking at Jenkins as a continuous integration tool (think continuous regression).  If I could tie the two together that would allow me to launch jobs and then the pass/fail reporting would be done for me.  Jenkins uses a web-based front-end.  Just a “twinkle-in-my-eye” for now.</li>
</ul>
<p><strong>Eating My Own Dog Food</strong></p>
<p>Now, do I use TDD for creating the UVM-SVUnit?  Kind of recursive, but you bet.  Another task for this framework is to create a set of unit-tests that test the framework.</p>
<p><strong>Neil&#8217;s Thoughts</strong></p>
<p>First on the list is eating my own dog food. Personally, I think with TDD we have a technique that can provide immediate benefits to hardware teams in that it&#8217;s tangible, understandable and doable. TDD doesn&#8217;t require major organizational change or buy-in (really&#8230; you can do it by yourself without anyone else even knowing) and SVUnit is easy to use.</p>
<p>On the flip-side, TDD and SVUnit are also unproven in hardware hence me having &#8220;eat my own dog food&#8221; at the top of the list. I&#8217;ve already started using it for all the new code I&#8217;ve written and the results have been promising though not yet conclusive. I&#8217;ll continue to use it so I can get a better idea of what works, what doesn&#8217;t and what makes sense in future.</p>
<p>Next on my list is supporting others that are interested in SVUnit (we&#8217;re actively looking for people to&#8230; uhh&#8230; eat our dog food so if you&#8217;re interested in being one of the first few to try SVUnit, you can let us know at <strong>neil.johnson@agilesoc.com</strong> or <strong>bryan.morris@agilesoc.com</strong>). I started the <a title="The SVUnit Demo Series" href="http://www.agilesoc.com/agilesoc-on-demand/the-svunit-demo-series/">SVUnit Demo Series</a> that should help get people going. I&#8217;ll continue with more of those in future. We also have some usage examples to update. We need an FAQ page that new folks can reference for the easy stuff. Basically, whatever else people need to make an informed opinion, I&#8217;m ready to put it together <img src='http://www.agilesoc.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Then there&#8217;s &#8220;testing my own dog food&#8221;. This is something I started a couple months ago. The SVUnit testsuite isn&#8217;t comprehensive yet (ie. there are a lot of untested features in the SVUnit code), but it&#8217;s started so we can regress some of the core functionality. I&#8217;m also verifying new features and updates as they happen.</p>
<p>Honorable mention on my list is to write a project charter. Before we have too many hands in the cookie jar, we&#8217;ll need to capture some big picture goals for SVUnit with a list of things that we&#8217;re not going to concern ourselves with. Considering it&#8217;s an open-source project, we&#8217;ll also need some development guidelines.</p>
<p><strong>Q. What are your thoughts on the direction where SVUnit can (or should go)?</strong></p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F09%2Fsvunit-future-directions-2%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F09%2Fsvunit-future-directions-2%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F09%2Fsvunit-future-directions-2%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F09%2Fsvunit-future-directions-2%2F&amp;count=none&amp;text=SVUnit%20Future%20Directions" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F09%2Fsvunit-future-directions-2%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F09%2Fsvunit-future-directions-2%2F&amp;count=none&amp;text=SVUnit%20Future%20Directions" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F09%2Fsvunit-future-directions-2%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F09%2Fsvunit-future-directions-2%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F09%2Fsvunit-future-directions-2%2F&amp;linkname=SVUnit%20Future%20Directions" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.agilesoc.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.agilesoc.com%2F2012%2F01%2F09%2Fsvunit-future-directions-2%2F&amp;title=SVUnit%20Future%20Directions" id="wpa2a_10">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.agilesoc.com/2012/01/09/svunit-future-directions-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy New Year!</title>
		<link>http://www.agilesoc.com/2011/12/30/happy-new-year/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=happy-new-year</link>
		<comments>http://www.agilesoc.com/2011/12/30/happy-new-year/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 12:48:47 +0000</pubDate>
		<dc:creator>Bryan Morris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.agilesoc.com/?p=1407</guid>
		<description><![CDATA[All the best to you and yours for 2012. Neil and I want to wish everyone following AgileSoC a very Happy New Year! AgileSoC has grown tremendously over the past year, and we’ve received many appreciative and insightful comments about &#8230; <a href="http://www.agilesoc.com/2011/12/30/happy-new-year/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>All the best to you and yours for 2012.</p>
<p>Neil and I want to wish everyone following AgileSoC a very Happy New Year!</p>
<p>AgileSoC has grown tremendously over the past year, and we’ve received many appreciative and insightful comments about what Neil and I are trying to do.</p>
<p>We look forward to 2012 — where our conversation with you about AgileSoC will continue to grow and develop.</p>
<p>Bryan &amp; Neil</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F30%2Fhappy-new-year%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F30%2Fhappy-new-year%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F30%2Fhappy-new-year%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F30%2Fhappy-new-year%2F&amp;count=none&amp;text=Happy%20New%20Year%21" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F30%2Fhappy-new-year%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F30%2Fhappy-new-year%2F&amp;count=none&amp;text=Happy%20New%20Year%21" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F30%2Fhappy-new-year%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F30%2Fhappy-new-year%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F30%2Fhappy-new-year%2F&amp;linkname=Happy%20New%20Year%21" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.agilesoc.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F30%2Fhappy-new-year%2F&amp;title=Happy%20New%20Year%21" id="wpa2a_12">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.agilesoc.com/2011/12/30/happy-new-year/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TDD for RTL</title>
		<link>http://www.agilesoc.com/2011/12/20/tdd-for-rtl/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tdd-for-rtl</link>
		<comments>http://www.agilesoc.com/2011/12/20/tdd-for-rtl/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 11:40:43 +0000</pubDate>
		<dc:creator>Bryan Morris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.agilesoc.com/?p=1395</guid>
		<description><![CDATA[In this (very late) post, I attempt a look at why RTL designers should use Test Driven Development (TDD) to create each of their modules. For this topic espeically, I’d like to hear your experiences with TDD, whether you think TDD &#8230; <a href="http://www.agilesoc.com/2011/12/20/tdd-for-rtl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In this (very late) post, I attempt a look at why RTL designers should use Test Driven Development (TDD) to create each of their modules.</p>
<p>For this topic espeically, I’d like to hear your experiences with TDD, whether you think TDD is an appropriate methodology for RTL, and if you’ve been following along with our TDD-month(-and-a-half), whether you agree with Neil’s and my position that TDD is a great addition to our ASIC/FPGA development toolbox.</p>
<p><span id="more-1395"></span></p>
<p><strong>Why RTL Designers Should Use TDD</strong></p>
<p>While a Verification Engineer should see the immediate benefits of using Test Driven Design, the idea of an RTL designer using it is perhaps a little more difficult to grasp.  The difficulty is when you start to think about the amount of infrastructure required to create a unit test — it can be large for a reasonable sized block.  Just providing the required stimulus across the tens, or sometimes hundreds of pins can seem impractical.</p>
<p>However, that presumes that you want to create a unit test from a fully completed RTL block. Instead the TDD methodology encourages the incremental creation of tests and functionality.  In the case of RTL, this would begin with the creation of simple stimulus to test the minimal interface — ideally built as the RTL designer creates the block. Starting from a simple core with clock and reset and minimal functionality the unit test is straightforward.  As the designer continues to add more features, the signals and stimulus required in the unit test build gradually and incrementally.  In other words,  TDD for RTL is very similar to what was described in previous posts regarding adding TDD to the verification process — you build the tests and functionality incrementally.</p>
<p>First, let’s go through some of the benefits of using TDD for RTL development.</p>
<p><strong>Simple Stimulus</strong></p>
<p>Every RTL designer I have ever had the pleasure of working with has always wanted a simple testbench that would allow them to provide some simple stimulus to their block. Using TDD with a standard framework such as SVUnit, the goal is to create every module with very simple stimulus since it is at the module level, and then gradually add the extra functionality and signals required until the module is complete.  The unit test will cover all possible stimulus, many of which would be difficult to provide at a block-level test consisting of several interacting modules.</p>
<p><strong>Documentation</strong></p>
<p>As with Verification Engineers, the unit tests demonstrate the block&#8217;s interface expectations. A block that must interface with that block could potentially use the unit test&#8217;s functionality as the driver or receiver of data from the block depending on the direction of the data.</p>
<p><strong>Easier SVA Adoption Curve</strong></p>
<p>It’s easy to see from an RTL perspective why adding SystemVerilog Assertions into a module/block is beneficial. One issue to adoption is the complexity of building assertions on a reasonably complex block.  That is, many assertions require complicated system-level test stimulus in order to activate the correct sequence of signals to trigger an assertion.  Creating unit tests is a complimentary technique, and can in some cases provide some of the same value of assertions &#8212; the ability to pinpoint where logic is incorrect; identify conditions where the underlying assumptions are thoroughly tested.  It is a complimentary in that the stimulus provided starts out simple and grows incrementally more complex — the checking of the DUTs responses can be done in either the SystemVerilog functionality in the unit test, or with an SV Assertion.  Any assertions created also begin very simply and can grow gradually more complex.  Again, building both confidence in using writing assertions, and confidence that any new assertion builds on previously validated assertions.</p>
<p><strong>TDD for RTL Workflow</strong></p>
<p>How would I create an RTL block using TDD?  Here are my thoughts; I’d welcome your opinions.</p>
<p>Let’s assume that we’re creating a simple round-robin arbiter block.  Briefly, the design has a simple interface:</p>
<ul>
<li>Clock and reset,</li>
<li>Input request signal (one bit per client),</li>
<li>Output grant signal (one bit per client).  ≈</li>
<li>Round-robin arbitration across all asserted requests.  One per clock cycle.</li>
</ul>
<p>As discussed in previous posts, the typical TDD workflow creates a unit test first; <em>by design</em> this test fails because the associated functionality does not exist.  The first unit test can be as simple as instantiating an empty module with pins for clock and reset and then hooking up the clock and reset generation logic to these pings.  The ‘test’ is defined to succeed when the reset signal in the block is deasserted at the same time as the external reset generator is deasserted.   Following the TDD flow, you’d attempt to compile this unit test and it should fail spectacularly as the block does not even exist.</p>
<p>The RTL designer creates the block with the clock and reset signals to make the reset test pass.  The test passes when the internal block comes out of reset.  A simple assertion could be used to test this condition.</p>
<p>The next test to create is the resetting of the internal pointers that maintain the updating of the request and grant logic, and the current client state.  An assertion to check these values after reset should be sufficient.  Again, the test fails as the logic to reset these values does not exist.   Add the logic until the assertion no longer fires and the test passes.</p>
<p>As you can see you gradually build the functionality of an arbiter e.g., adding the independent requests and generation of the grants, keeping state of which client has been served last, meanwhile adding increasingly meaningful assertions and functional checks into the unit test as you continuously add the functional components.</p>
<p>Of course, most modules are more complicated than a round-robin arbiter, but my intent is to show that TDD encourages an incremental approach to design.  Each incremental step building on the strength of knowledge that the previous step is solidly grounded in working code.  Each incremental test and assertion with a corresponding functional addition contributes to increasing confidence that the code is correct by construction. Truly the whole (unit test + module) is greater than the sum of its parts.</p>
<p>You’re also secure in the knowledge that if the interface changes with a dependent block, a simple run of these unit tests confirms whether your block has been affected by the change.  Similarly, any additional functionality that is added later in the design cycle, you’ll have a solid foundation from which to build.</p>
<p>My goal here is to demonstrate how one could create an RTL module using TDD, with the end-result of a working module, and a set of unit tests that ensure the block works as expected.</p>
<p>If you’ve been using TDD-like ideas in your RTL development, please share them.</p>
<p><strong>The Last Post&#8230; on TDD&#8230; for now</strong></p>
<p>I&#8217;ll be pushing out my last post on the TDD topic in a couple of days.  This will define my ideas on some possible future direction for SVUnit.  Neil has pushed the source code into sourceforge and we&#8217;re looking for some early adopters to test it out before a general release.  Neil also posted a <a title="SVUnit Up and Running" href="http://www.agilesoc.com/agilesoc-on-demand/the-svunit-demo-series/" target="_blank">video</a> demonstrating the svunit in action.  If you&#8217;re keen and serious to take svunit for a spin, please let Neil or I know.</p>
<p><span style="color: #ff0000;"><strong><br />
</strong></span></p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F20%2Ftdd-for-rtl%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F20%2Ftdd-for-rtl%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F20%2Ftdd-for-rtl%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F20%2Ftdd-for-rtl%2F&amp;count=none&amp;text=TDD%20for%20RTL" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F20%2Ftdd-for-rtl%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F20%2Ftdd-for-rtl%2F&amp;count=none&amp;text=TDD%20for%20RTL" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F20%2Ftdd-for-rtl%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F20%2Ftdd-for-rtl%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F20%2Ftdd-for-rtl%2F&amp;linkname=TDD%20for%20RTL" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.agilesoc.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F12%2F20%2Ftdd-for-rtl%2F&amp;title=TDD%20for%20RTL" id="wpa2a_14">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.agilesoc.com/2011/12/20/tdd-for-rtl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TDD: Verification with SVUnit</title>
		<link>http://www.agilesoc.com/2011/11/29/tdd-verification-with-svunit/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tdd-verification-with-svunit</link>
		<comments>http://www.agilesoc.com/2011/11/29/tdd-verification-with-svunit/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 11:32:27 +0000</pubDate>
		<dc:creator>Bryan Morris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.agilesoc.com/?p=1305</guid>
		<description><![CDATA[Introduction In my last posting, I gave a brief overivew of the SVUnit framework, and it&#8217;s usage model. This post will look at how to use this framework in your workflow: how it can be integrated into your existing verification &#8230; <a href="http://www.agilesoc.com/2011/11/29/tdd-verification-with-svunit/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In my last posting, I gave a brief overivew of the SVUnit framework, and it&#8217;s usage model. This post will look at how to use this framework in your workflow: how it can be integrated into your existing verification methodology to help develop new verification components, and extend existing environments.</p>
<p>At this point, I&#8217;ll state that the key determinant for a successful introduction is attitude. The developers must see merit in using this approach, or at least trying the approach with an open mind. Otherwise, it will very likely not be successful.</p>
<p><span id="more-1305"></span></p>
<h2>Adding TDD to your New Project / Verification Component</h2>
<p>Neil has discussed in previous posts about the value of adding the TDD methodology, and has shown that as an activity in a new project it is straightforward. The scripts in this framework make adding TDD even easier value by automatically generating code that is immediately usable. The following provides some recommendations on a workflow that we&#8217;ve found useful:</p>
<ul>
<li>Create the class header files with only the class definition (i.e., no implementation). Don’t worry about getting the class <em>perfect</em>, the intent here is to use the scripts to generate the scaffolding code required for the unit test framework.</li>
<li>Use the provided scripts to generate your unit test case files and corresponding test suites.</li>
<li>For each function and task in the system create a unit test case (derived from the <em>svunit_testcase</em> class). The focus while writing these unit tests is to create the usage model for your new verification component, or <em>how</em> each task/function is to be used in your environment.  This should be done iteratively, one task/function at a time building from a logical start e.g., following the UVM phase flow, or from the public tasks/functions and following their call flow.</li>
<li>Add just enough code into task/function to get the test case to pass, debugging each task/function individually to ensure that they are correct as per the usual TDD “way”.</li>
<li>Aggregate the testcases into meaningful test suites. Create these test suites using the scripts provided.</li>
<li>Similarly, aggregate the test suites into the test runner derived from the <em>svunit_testrunner</em> (using the scripts provided).</li>
</ul>
<p>At this point, you have a couple of very handy things:</p>
<ul>
<li>a working, debugged initial version of your class;</li>
<li>a example usage model for your new users of that class – this usage model is found in the unit tests that your colleagues may look at;</li>
<li>test code that can be used to ensure that when you add or change functionality (using TDD) in the class that the code continues to function as your users expect; and test code that can be periodically run to ensure that if any updates to classes that your code is dependent on continues to work as expected i.e. you&#8217;ll see when someone else affects your code.</li>
</ul>
<div><span style="font-size: small;"><span class="Apple-style-span" style="line-height: 24px;">From comments I&#8217;ve received, some of you are already doing TDD with your own frameworks.  Please feel free to add to this conversation on your best practices.</span></span></div>
<h2>Using SVUnit for Existing Classes</h2>
<p>When using the SVUnit framework on an existing library of verification components you can either adopt an incremental or full approach. The incremental approach would use the scripts to generate the initial unit tests (all of which would be blank) and then add the unit tests individually as required (e.g., when the corresponding task/function is being updated). The full approach would be to generate and define the unit tests for all tasks/functions immediately.</p>
<h2>Which Classes to Pick</h2>
<p>Ideally, TDD should be used for <em>every</em> class in your verification component. You will likely come to this conclusion after you&#8217;ve used TDD for a while, but adopting TDD strategically at first is still of great value. That is, cherry-picking the most complicated classes, or base classes that are used across multiple environments or projects are clearly the classes you need to pick first.</p>
<p>There are some classes that provide some minimal complication. For example, drivers/BFMs need an SystemVerilog <em>interface </em>or RTL to be able to drive to and respond. When the RTL that you&#8217;re driver is talking with is not available, using TDD on a driver is doable by adding some small tasks in your interface, or creating a small piece of RTL to replicate a source/sink for your driver. However, if the RTL is ready to be used, creating a driver using the TDD methodology does allow you to create a very simple mechanism to drive stimulus into your RTL. This is a very low-overhead, test harness that you can give to your RTL designer to use while you build out the rest of your environment.</p>
<h2>When to Run Unit Tests</h2>
<p>The last key element is to identify in your process when it would be best to run the unit tests. Ideally, the tests should be run by every developer on a regular basis to determine whether they have introduced any issues. The possibilities on where the test runner script can be added into your process are as follows (in preferential order):</p>
<ul>
<li>The best approach is to run the entire test suite prior to committing code to the source code management. Any issues must be dealt with prior to check in. Generally, the TDD tests for verification components are usually very quick (usually less than couple of minutes with most of that time taken up by the compilation/elaboration as tests do not use any RTL code).</li>
<li>Another good approach is to add it to your commit sequence for your source code control system. That is, the check-in for any code is allowed to proceed ONLY if the test runner script passes. This assumes that you have a wrapper script around your source code “commit” or “check-in” command.</li>
<li>If you use a “sanitizer” script for your source code i.e., where a code snapshot is qualified as being “good” (or in the agile parlance a continuous integration flow). This script usually requires a sanity regression to be run, if the regression passes then all the code revisions that make up the snapshot are labeled as “sane”. Adding the test runner into this script prior to running the sanity regression would be another possibility.</li>
<li>Alternatively, the test runner script can be run manually prior to starting a regression. The decision to use the pass/fail result from the test runner script as either a “warning” (allowing the regression to proceed but the cause for the failure to be investigated) or as a “fatal” (where the regression is not allowed to proceed until the test failure is (fixed) is up to the project’s regression management team. (I&#8217;d vote for the fatal, but that&#8217;s just me <img src='http://www.agilesoc.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</li>
<li>Lastly, the test runner can be run using a cron job on a regular schedule to take the latest “valid” snapshot of the source code and determine any failures. The key downside of this approach is that then someone has to isolate whose update caused the issue.  However, this should not generally be an issue since the granularity of the tests is so small.</li>
</ul>
<p>My next post will look at two things: how TDD can be used by RTL designers, and some future directions for the TDD framework. From the comments received to date, there are some folks out there already doing TDD, and are already discovering its value. We as a group of professionals need to evolve TDD to work effectively in a design and verification flow. Give it a try and join the discussion!</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F29%2Ftdd-verification-with-svunit%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F29%2Ftdd-verification-with-svunit%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F29%2Ftdd-verification-with-svunit%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F29%2Ftdd-verification-with-svunit%2F&amp;count=none&amp;text=TDD%3A%20Verification%20with%20SVUnit" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F29%2Ftdd-verification-with-svunit%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F29%2Ftdd-verification-with-svunit%2F&amp;count=none&amp;text=TDD%3A%20Verification%20with%20SVUnit" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F29%2Ftdd-verification-with-svunit%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F29%2Ftdd-verification-with-svunit%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F29%2Ftdd-verification-with-svunit%2F&amp;linkname=TDD%3A%20Verification%20with%20SVUnit" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.agilesoc.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F29%2Ftdd-verification-with-svunit%2F&amp;title=TDD%3A%20Verification%20with%20SVUnit" id="wpa2a_16">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.agilesoc.com/2011/11/29/tdd-verification-with-svunit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test Driven Development: Introducing the SVUnit Framework</title>
		<link>http://www.agilesoc.com/2011/11/21/test-driven-development-introducing-the-svunit-framework/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=test-driven-development-introducing-the-svunit-framework</link>
		<comments>http://www.agilesoc.com/2011/11/21/test-driven-development-introducing-the-svunit-framework/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 13:22:19 +0000</pubDate>
		<dc:creator>Bryan Morris</dc:creator>
				<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[svunit]]></category>

		<guid isPermaLink="false">http://www.agilesoc.com/?p=1228</guid>
		<description><![CDATA[Up until now, we&#8217;d been discussing the justification of using TDD in an ASIC development flow.   Hopefully, we&#8217;ve convinced you to try it.  In this post we&#8217;ll introduce a TDD framework that has been developed for SystemVerilog to help you use this &#8230; <a href="http://www.agilesoc.com/2011/11/21/test-driven-development-introducing-the-svunit-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Up until now, we&#8217;d been discussing the justification of using TDD in an ASIC development flow.   Hopefully, we&#8217;ve convinced you to try it.  In this post we&#8217;ll introduce a TDD framework that has been developed for SystemVerilog to <em>help</em> you use this design technique.</p>
<p>A couple of weeks ago, just after we got started with TDD month, Neil added the link to the posts on several industry forums, and got this comment from Alex Gnusin on the <a href="http://www.verificationguild.com/modules.php?name=Forums&amp;file=viewtopic&amp;t=4341">verification guild</a>:</p>
<blockquote><p>&#8220;Is it a Designer responsibility to test each line of code? In this case, there is a need to provide designers with working methodology to verify their code&#8230;&#8221;</p></blockquote>
<p>To which Neil responded:</p>
<blockquote><p>Alex: I&#8217;m not sure if you guessed we&#8217;d be covering the topic of a working methodology &#8211; aka: unit test framework &#8211; but if you did, I&#8217;d like to thank you for that nice bit of foreshadowing!</p></blockquote>
<p>Alex is right, a proper framework is pretty important for anyone doing TDD; primarily because it gives you the opportunity to get up and running quickly.</p>
<p>In the software world, there are are number of wildly popular unit test frameworks. <a href="http://www.junit.org" target="_blank">JUnit</a> might be the best known (for those doing java development) but there are about a million others (as you can see with a quick trip over to <a href="http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks" target="_blank">Wikipedia</a>). A unit test framework is critical for TDD, that&#8217;s why myself and Rob Saxe (both formerly of XtremeEDA) put one together a couple of years ago for people wanting to do TDD with SystemVerilog.</p>
<p>First presented at SNUG San Jose in 2009, SVUnit is a unit test framework that provides:</p>
<ul>
<li>structures for creating and running unit tests</li>
<li>utilities for reporting test status and results</li>
<li>a test &#8220;runner&#8221; that executes a set of test suites and report on their overall success/failure</li>
<li>scripts to automate the mechanical aspects of creating new unit test code</li>
</ul>
<div>
<p><img title="More..." src="http://www.agilesoc.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /><span id="more-1228"></span></p>
<p>This post <em>briefly </em>covers the usage model for using the framework.  Actually, I&#8217;ll split the post into three: this post covers how to use such a framework, the next post will discuss where to use it when  building your verification components, and my last post will discuss how RTL designers can potentially use it. As this post is more a teaser than a full blown article, you should ask the folks at <a href="http://www.xtreme-eda.com" target="_blank">XtremeEDA</a> for a copy of the SNUG paper that Rob and I created.  It gives full details on the framework design and usage model.  Of course, the next question you&#8217;ll be asking is: where can we get the code?  We&#8217;re working on that&#8230; more details very shortly.</p>
<p><strong>Usage Model</strong></p>
<p>At its most basic, there are three hierarchical classes that you need to know about:</p>
<div>
<ul>
<li><em>svunit_testcase</em>: an abstract base class that you derive from and add your TDD code into.</li>
<li><em>svunit_testsuite</em>: which aggregates and runs the <em>svunit_testcase</em> objects.</li>
<li><em>svunit_testrunner</em>: which aggregates and runs the <em>svunit_testsuite</em> objects, and reports the errors.</li>
</ul>
<p><span style="font-size: small;"><span class="Apple-style-span" style="line-height: 24px;">The following UML class diagram gives an overview of the classes and the hierarchical relationship between the three classes.  For those of you unfamiliar with UML, this diagram shows that a <em>svunit_testrunner</em> holds one or more <em>svunit_testsuite</em> objects which holds one or more <em>svunit_testcase</em> objects.</span></span></p>
</div>
<div id="attachment_1247" class="wp-caption alignnone" style="width: 1099px"><a href="http://www.agilesoc.com/wp-content/uploads/2011/11/ClassUML.png"><img class="size-full wp-image-1247" title="SvUnit ClassUML" src="http://www.agilesoc.com/wp-content/uploads/2011/11/ClassUML.png" alt="" width="1089" height="583" /></a><p class="wp-caption-text">SVUnit Class UML Diagram</p></div>
<p>Every testcase that you create derives from the abstract <em>svunit_testcase</em> base class object. It has three methods that you&#8217;ll need to know about:</p>
<div>
<ul>
<li><em>setup()</em>: where you can optionally setup the pre-conditions for the test.</li>
<li><em>run_test()</em>: where you add your test code.</li>
<li><em>teardown()</em>: where you can optionally restore the verification component back to reasonable defaults.</li>
</ul>
</div>
<p>There also two macros to help in creating the tests:</p>
<div>
<ul>
<li><em>FAIL_IF(expression)</em>: similar to an assertion where the testcase fails if the expression is true. e.g., FAIL_IF(my_packet.calc_crc() == TRUE);</li>
<li><em>FAIL_UNLESS(expression)</em>: corollary to FAIL_IF, where the testcase fails if the expression is false. e.g.,`FAIL_UNLESS(my_packet.get_parity(data) == 0);</li>
</ul>
</div>
<p>Then you can start creating unit tests in a class called <em>class_under_test_unit_test</em> (which is stored in a file called class_under_test_unit_test.sv). This class derives from the <em>svunit_testcase</em> base class.</p>
<p><span class="Apple-style-span" style="font-size: 16px; line-height: 24px;">Add your testcode into the <em>run_test()</em> function. If required, you can add pre-test and post-test code in the <em>setup()</em> and <em>teardown()</em> tasks, respectively.  </span><span class="Apple-style-span" style="font-size: 16px; line-height: 24px;">As discussed in previous posts, the idea is to create a set of tests that focus on one aspect, or an atomic feature of your verification class. These tests will incrementally build over time as you develop your verification class.  I suggest you create a set of tasks inside your <em>classname_unit_test</em> that are called by the <em>run_tests()</em> task. e.g.,</span></p>
<pre>task run_test();
    `INFO("Running Unit Tests for class: packet_bfm:");
    test_pack_bytes();
    test_unpack_bytes();
    test_send_data();
endtask : run_test</pre>
<p>There is some &#8220;plumbing&#8221; code that needs to be created to instantiate and run these testcases. As this is a tedious, repetitive task we created some basic scripts that generate the code for the <em>svunit_testsuite</em> and <em>svunit_testrunner</em> classes. Ideally, all you&#8217;ll ever need to write is the unit test code. The script finds all the source files that match the pattern <em>*_unit_test.sv</em>, and then creates a corresponding class (derived from <em>svunit_testsuite</em> class) responsible for instantiating and running your unit test objects. The script then wraps those test suite classes into a test runner class (derived from the <em>svunit_testrunner)</em> class responsible for instantiating and running the test suite objects. At the end of the test, the auto-generated <em>svunit_testrunner</em> object reports on the pass/fail of the unit tests.</p>
<p>As discussed in previous posts, the flow of using TDD is to create the tests first, and then add just enough code into the class being tested until the tests pass. The flow of creating a unit test with the <em>svunit </em>framework is similar:</p>
<ol>
<li>Create your unit test class derived from svunit_testcase. If the &#8216;Class Under Test&#8217; does not exist, create an empty class that your unit test class can instantiate.</li>
<li>Add you test case into the <em>run_test()</em> (or better yet in a separate task that <em>run_test()</em> calls).</li>
<li>Create the plumbing code by calling the script to auto-generate the derived <em>svunit_testsuite</em> and <em>svunit_testrunner</em> classes.  The script also creates a Makefile to run the tests). Don&#8217;t touch any of these auto-generated since everytime you run the script they will be overrwritten.</li>
<li>Run the test (make sure it <em>fails</em>!!).</li>
<li>Add <em>just</em> enough code into your class under test until the test passes.</li>
<li>Repeat steps 2 to 5 until all aspects of your class under test are completely tested.</li>
</ol>
<p>The svunit framework provides you with some tools to make TDD easier to use &#8212; you focus on the individual tests; the framework runs those tests. Of course, there is more to this framework, but I would just repeating the contents of the paper in a post. Just ask our friends at XtremeEDA for a copy of the paper.</p>
<p>This post provides a brief introduction to the SVUnit framework.  The next posts will provide some thoughts and guidance on where to use this technique for verification and RTL  As well, I&#8217;ll discuss some future directions for this pre-UVM framework.</p>
</div>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F21%2Ftest-driven-development-introducing-the-svunit-framework%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F21%2Ftest-driven-development-introducing-the-svunit-framework%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F21%2Ftest-driven-development-introducing-the-svunit-framework%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F21%2Ftest-driven-development-introducing-the-svunit-framework%2F&amp;count=none&amp;text=Test%20Driven%20Development%3A%20Introducing%20the%20SVUnit%20Framework" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F21%2Ftest-driven-development-introducing-the-svunit-framework%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F21%2Ftest-driven-development-introducing-the-svunit-framework%2F&amp;count=none&amp;text=Test%20Driven%20Development%3A%20Introducing%20the%20SVUnit%20Framework" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F21%2Ftest-driven-development-introducing-the-svunit-framework%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F21%2Ftest-driven-development-introducing-the-svunit-framework%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F21%2Ftest-driven-development-introducing-the-svunit-framework%2F&amp;linkname=Test%20Driven%20Development%3A%20Introducing%20the%20SVUnit%20Framework" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.agilesoc.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F21%2Ftest-driven-development-introducing-the-svunit-framework%2F&amp;title=Test%20Driven%20Development%3A%20Introducing%20the%20SVUnit%20Framework" id="wpa2a_18">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.agilesoc.com/2011/11/21/test-driven-development-introducing-the-svunit-framework/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>TDD And A New Paradigm For Hardware Verification</title>
		<link>http://www.agilesoc.com/2011/11/14/tdd-and-a-new-paradigm-for-hardware-verification/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tdd-and-a-new-paradigm-for-hardware-verification</link>
		<comments>http://www.agilesoc.com/2011/11/14/tdd-and-a-new-paradigm-for-hardware-verification/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 05:58:29 +0000</pubDate>
		<dc:creator>nosnhojn</dc:creator>
				<category><![CDATA[Functional Verification]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[TDD month]]></category>

		<guid isPermaLink="false">http://www.agilesoc.com/?p=1098</guid>
		<description><![CDATA[We&#8217;ve looked at why teams should consider doing TDD; we&#8217;ve looked at how the roles and responsibilities change between design and verification experts; now let&#8217;s look at when everything happens. This is the key to seeing how everything fits together. &#8230; <a href="http://www.agilesoc.com/2011/11/14/tdd-and-a-new-paradigm-for-hardware-verification/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve looked at <a title="Test Your Own Code! (I’ve Got Better Things To Do)" href="http://www.agilesoc.com/2011/10/31/test-your-own-code-ive-got-better-things-to-do/">why teams should consider doing TDD</a>; we&#8217;ve looked at <a title="TDD In Hardware Development: Who Does What?" href="http://www.agilesoc.com/2011/11/06/tdd-in-hardware-development-does/">how the roles and responsibilities change</a> between design and verification experts; now let&#8217;s look at <em>when</em> everything happens. This is the key to seeing how everything fits together.</p>
<p>Most teams nowadays chose to split their verification effort up as a combination of block level and top level testing. Block level testing is usually applied to every subsystem in a design and intended to exhaustively cover all the features of each subsystem. Once the block level testing is done, the exhaustively tested pieces are integrated and tested in a top level testbench.</p>
<p><span id="more-1098"></span>The need for block level testing is justified by the fact that the arms-length control and visibility normally available in the top level testbench is inadequate or inconvenient for testing the first and second order functionality we talked about in the <a title="TDD In Hardware Development: Who Does What?" href="http://www.agilesoc.com/2011/11/06/tdd-in-hardware-development-does/">last post</a>. The need for the top level testing is obvious as well because the block level testing does nothing to verify the interdependencies between subsystems and the operation of the system as a whole.</p>
<p>Makes sense&#8230; block level testing to verify the details; top-level testing to verify the integration. Here&#8217;s a picture of that as an timeline with the design, block level and top-level testing.</p>
<p><a href="http://www.agilesoc.com/wp-content/uploads/2011/10/TDD-entry-3a.png"><img class="size-full wp-image-1111 alignnone" title="TDD entry 3a" src="http://www.agilesoc.com/wp-content/uploads/2011/10/TDD-entry-3a.png" alt="" width="517" height="279" /></a></p>
<p>The designers start writing RTL. Verification engineers start building a block level testbench at the same time (or shortly thereafter as I&#8217;ve shown here). When the RTL and the block level testbench are done, the verification team will start running tests and collecting coverage results. When the block level testing is done, the block level design is signed off and it&#8217;s ready for top level testing.</p>
<p>The top level testbench, in the meantime, is usually started after the block level design and verification is well underway. The top level tests get run when most the block level designs near sign off. At the conclusion of top-level testing, the entire design is signed off and the design goes to the fab (or the FPGA goes to a customer, or the IP goes to another team or whatever). You&#8217;re done.</p>
<p>Now let&#8217;s look at the problems that normally pop-up and the reasons for why things never seem to work out as planned.</p>
<ol>
<li><strong>The RTL is <em>NOT</em> done:</strong> I&#8217;ve harped on this before so I&#8217;m not going to spend much time on it here other than to say that I would challenge anyone that says the <em>RTL Done</em> milestone we all race toward is at all meaningful. You may have a bunch of code, but it&#8217;s <em>not</em> tested and it&#8217;s <em>not</em> done (see <a title="By Example: Done vs. DONE" href="http://www.agilesoc.com/2011/07/31/by-example-done-vs-done/">By Example: Done vs. DONE</a>).</li>
<li><strong>The testbench is <em>NOT</em> done:</strong> same comment as above. Testbenches aren&#8217;t <em>DONE</em> when we say they&#8217;re done either. That goes for block level and top level (again&#8230; see <a title="By Example: Done vs. DONE" href="http://www.agilesoc.com/2011/07/31/by-example-done-vs-done/">By Example: Done vs. DONE</a>).</li>
<li><strong>You can&#8217;t plan your way through integration testing:</strong> here&#8217;s the big one and the real reason you&#8217;re here today. I really believe I&#8217;ve seen top level testing planned as good as anyone could reasonably plan. Well partitioned design: check. Well defined block level interfaces: check. Standardized model interfaces: check. Uniform, reusable block level environments: check. Customer initiated use cases: check. Skilled team: check. The ducks were all lined up and still there were the same old issues that tend to blow apart a schedule. A plan is one thing; practice is usually something else.</li>
</ol>
<p>Take those and other issues into account and what you get in practice is more likely to resemble this&#8230;</p>
<p><a href="http://www.agilesoc.com/wp-content/uploads/2011/10/TDD-entry-3b.png"><img class="alignright size-full wp-image-1112" title="TDD entry 3b" src="http://www.agilesoc.com/wp-content/uploads/2011/10/TDD-entry-3b.png" alt="" width="653" height="300" /></a>RTL done and testbench done mean you have a bunch of buggy design and testbench code that doesn&#8217;t really work. After saying they&#8217;re done, experts from both domains transition into a firefighting role as soon as the first few tests uncover major quality issues (the firefighting is shown as red extensions to the original estimates). While that&#8217;s going on, the person in charge of the top level testing finds out that everything <em>doesn&#8217;t</em> actually just fit together as planned. Because people are firefighting at the block level <em>and</em> because the block level is given priority, the top level people have to make due until help finally arrives; if it arrives. A lack of help means the top level testing drags on, eventually stumbling across the finish line days, weeks or months later than expected. By the time the design is finally released, people are exhausted from weeks of stress and sleep deprivation.</p>
<p><strong>I used to be of the opinion that teams could plan their way through top level verification. Now I&#8217;m sure they can&#8217;t.</strong></p>
<p>I think the difference between planned and actual release dates is caused by false confidence and ambiguity in our development process. I think we can overcome both with a new paradigm for hardware development that emphasizes early validation and prioritizes top level development. Here&#8217;s a simple diagram of this new paradigm&#8230;</p>
<p><a href="http://www.agilesoc.com/wp-content/uploads/2011/10/TDD-entry-3c.png"><img class="size-full wp-image-1113 alignnone" title="TDD entry 3c" src="http://www.agilesoc.com/wp-content/uploads/2011/10/TDD-entry-3c.png" alt="" width="514" height="394" /></a></p>
<p>The first thing to point out is the alternating test-design cycles at the unit level. This is TDD. That&#8217;s meant to clean up localized/unit level bugs in the design <em>before</em> they&#8217;re committed to the database. Notice also that the unit level design starts with a purple bar. Test first!!</p>
<p>Next major point is that there is no delay to top level testing; it starts immediately. As portions of the design are unit tested, they are also verified at the top level. Top level tests are where we measure progress. When the top level tests pass, then &#8211; and only then &#8211; is the code considered DONE.</p>
<p>A third note here is reserved for the role of block level testing. In this new paradigm, block level testing is no longer automatic because TDD is used to prevent many of the first and second order bugs and integration testing happens much sooner. While there may still be a need for block level tests to, for example, isolate certain complex features that are hard to isolate at the top level, exhaustive testing of all blocks within a design would no longer be the norm.</p>
<p><strong>We&#8217;ll still do block level testing but it&#8217;s no longer &#8220;on&#8221; by default.</strong></p>
<p>What&#8217;s required to keep everything together in this new paradigm for functional verification? One word&#8230;</p>
<blockquote><p><strong>TEAMWORK</strong></p></blockquote>
<p>The top level effectively takes priority in the testing, which means all the development at the unit and block levels <em>must</em> be synchronized such that it feeds the top level effort successfully. Everyone needs to know what is going on and how there work supports the combined effort of top level testing. That takes teamwork, plain and simple.</p>
<p>-neil</p>
<p><strong>Q. What problems do you see during integration testing? Does unit testing and/or early integration testing address those problems?</strong></p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F14%2Ftdd-and-a-new-paradigm-for-hardware-verification%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F14%2Ftdd-and-a-new-paradigm-for-hardware-verification%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F14%2Ftdd-and-a-new-paradigm-for-hardware-verification%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F14%2Ftdd-and-a-new-paradigm-for-hardware-verification%2F&amp;count=none&amp;text=TDD%20And%20A%20New%20Paradigm%20For%20Hardware%20Verification" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F14%2Ftdd-and-a-new-paradigm-for-hardware-verification%2F&amp;counturl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F14%2Ftdd-and-a-new-paradigm-for-hardware-verification%2F&amp;count=none&amp;text=TDD%20And%20A%20New%20Paradigm%20For%20Hardware%20Verification" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F14%2Ftdd-and-a-new-paradigm-for-hardware-verification%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F14%2Ftdd-and-a-new-paradigm-for-hardware-verification%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F14%2Ftdd-and-a-new-paradigm-for-hardware-verification%2F&amp;linkname=TDD%20And%20A%20New%20Paradigm%20For%20Hardware%20Verification" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.agilesoc.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.agilesoc.com%2F2011%2F11%2F14%2Ftdd-and-a-new-paradigm-for-hardware-verification%2F&amp;title=TDD%20And%20A%20New%20Paradigm%20For%20Hardware%20Verification" id="wpa2a_20">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.agilesoc.com/2011/11/14/tdd-and-a-new-paradigm-for-hardware-verification/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

