<?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>Verification Martial Arts &#187; Modeling</title>
	<atom:link href="http://www.vmmcentral.org/vmartialarts/category/modeling/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vmmcentral.org/vmartialarts</link>
	<description>A Blog on Verification Methodology</description>
	<lastBuildDate>Fri, 03 Feb 2012 03:34:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>The One stop shop: get done with everything you need to do with your registers</title>
		<link>http://www.vmmcentral.org/vmartialarts/2011/07/the-one-stop-shop-get-done-with-everything-you-need-to-do-with-your-registers/</link>
		<comments>http://www.vmmcentral.org/vmartialarts/2011/07/the-one-stop-shop-get-done-with-everything-you-need-to-do-with-your-registers/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 05:36:40 +0000</pubDate>
		<dc:creator>Amit Sharma</dc:creator>
				<category><![CDATA[Automation]]></category>
		<category><![CDATA[Modeling]]></category>
		<category><![CDATA[Register Abstraction Model with RAL]]></category>
		<category><![CDATA[Tools & 3rd Party interfaces]]></category>

		<guid isPermaLink="false">http://www.vmmcentral.org/vmartialarts/?p=2580</guid>
		<description><![CDATA[Ballori Bannerjee, Design Engineer, LSI India Processes are created, refined and improved upon and the change in productivity which starts with a big leap subsequently slows down and at the same time as the complexity of tasks increases, the existing processes can no longer scale up. This drives the next paradigm shift in moving towards [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span style="font-size: small">Ballori Bannerjee, Design Engineer, LSI India</span></strong></p>
<p><strong><span style="font-size: small"> </span></strong></p>
<p>Processes are created, refined and improved upon and the change in productivity which starts with a big leap subsequently slows down and at the same time as the complexity of tasks increases, the existing processes can no longer scale up. This drives the next paradigm shift in moving towards new process and automation. As in the case of all realms of technology, this is true in the context of the Register development and validation flow as well.. So, let’s look at how we changed our process to get the desired boost in productivity that we wanted..</p>
<p>This following flowchart represents our legacy register design and validation process.. This was a closed process and served us well initially when the number of registers, their properties etc were limited.. However, with the complex chips that we are designing and validating today, does this scale up?</p>
<p><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvd3AtY29udGVudC91cGxvYWRzLzIwMTEvMDcvcmVnaXN0ZXJfdmVyaWYucG5n"><img style="float: none;margin-left: auto;margin-right: auto;border: 0px" src="http://www.vmmcentral.org/vmartialarts/wp-content/uploads/2011/07/register_verif_thumb.png" border="0" alt="register_verif" width="413" height="343" /></a></p>
<p>As an example, in a module that we are implementing, there are four thousand registers. Translating into number of fields, for 4000 32-bit registers we have 128,000 fields, with different hardware and software properties!</p>
<p>Coding the RTL with address decoding for 4000 registers, with fields having different properties is a week’s effort by a designer. Developing a re-usable randomized verification environment with tests like reset value check, read-write is another 2 weeks, at the least. Closure on bugs requires several feedbacks from verification to update design or document. So overall, there is at least a month’s effort plus maintenance overhead anytime the address mapping is modified or a register updated/added.</p>
<p>This flow is susceptible to errors where there could be disconnect between document, design, verification and software.</p>
<p>So, what do we do? We redefine the process! And this is what I will be talking about, our automated register design and verification (DV) flow which streamlines this process.</p>
<p><strong>AUTOMATED REGISTER DESIGN AND VERIFICATION FLOW </strong></p>
<p><strong> </strong></p>
<p>The flow starts with the designer modeling the registers using a high level register description language. In our case , we use SystemRDL, and then leverage third party tools are available to generate the various downstream components from the RDL file:</p>
<p>· RTL in Verilog/VHDL</p>
<p>· C/C++ code for firmware</p>
<p>· Documentation ( different formats)</p>
<p>· High level verification environment code (HVL) in VMM</p>
<p>This is shown in below. The RDL file serves as a one-stop point for any register update required following a requirement change.</p>
<p><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvd3AtY29udGVudC91cGxvYWRzLzIwMTEvMDcvcmVnaXN0ZXIyLnBuZw=="><img style="float: none;margin-left: auto;margin-right: auto;border: 0px" src="http://www.vmmcentral.org/vmartialarts/wp-content/uploads/2011/07/register2_thumb.png" border="0" alt="register2" width="467" height="247" /></a> </p>
<p><strong>Automated Register DV Flow</strong></p>
<p>Given, that its critical to create an efficient object oriented abstraction layer to model registers and memories in a design under test, we exploit VMM RAL for the same. How do we generate the VMM RAL Model? This is generated from RALF. Many 3<sup>rd</sup> party tools are available to generate RALF from various inputs formats and we use one of them to generate RALF from SystemRDL</p>
<p>Thus, a complete VMM compliant randomized, coverage driven register verification environment can be created by extending the flow such that:</p>
<p>i. Using 3<sup>rd</sup> party tool, from SystemRDL the verification component generated is RALF, Synopsys’ Register Abstraction Layer File.</p>
<p>ii. RALF is passed through RALGEN, a Synopsys utility which converts the RALF information to a complete VMM based register verification environment. This includes automatic generation of pre-defined tests like reset value check, bit bash tests etc of registers and complete functional coverage model, which would have taken considerable staff-days of effort to write.</p>
<p>The flowchart below elucidates the process.</p>
<p><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvd3AtY29udGVudC91cGxvYWRzLzIwMTEvMDcvcmVnaXN0ZXIzLnBuZw=="><img style="float: none;margin-left: auto;margin-right: auto;border: 0px" src="http://www.vmmcentral.org/vmartialarts/wp-content/uploads/2011/07/register3_thumb.png" border="0" alt="register3" width="251" height="439" /></a></p>
<p>Adopting the automated flow, it took 2 days to write the RDL. The rest of components were generated from this source. A small amount of manual effort may be required for items like back-door path definition, but it is minimal and a one-time effort. The overall benefits are much more than the number of staff days saved and we see this as something which gives us perpetual returns.. I am sure, a lot of you would already be bringing in some amount of automation in your register design and verification setup, and if you aren’t, its time you do it J</p>
<p>While, we are talking about abstraction and automation, lets look at another aspect in register verification.</p>
<p><strong>Multiple Interfaces/Views for a register</strong></p>
<p>It is possible to have registers in today’s complex SOC designs which need to be connected to two or more different buses and accessed differently. The register address will be different for the different physical interfaces it is shared between. So, how do we model this..</p>
<p>This can be defined in SystemRDL by using a parent <em>addressmap</em> with <em>bridge</em> property, which contains sub addressmaps representing the different views.</p>
<p>For example:</p>
<p><em>addrmap dma_blk_bridge {</em><br />
<em>bridge;// top level address map</em><br />
<em>reg commoncontrol_reg {</em><br />
<em>shared; // register will be shared by multiple address maps</em><br />
<em>field {</em><br />
<em>hw=rw;</em><br />
<em>sw=rw;</em><br />
<em>reset=32’h0;</em><br />
<em>} f1[32];</em><br />
<em>};</em></p>
<p><em>addrmap {// Define the Map for the AHB Side of the bridge</em><br />
<em>commoncontrol_reg cmn_ctl_ahb @0&#215;0; // at address=0</em><br />
<em>} ahb;</em><br />
<em> </em></p>
<p><em>addrmap { // Define the Map for the AXI Side of the bridge</em><br />
<em>commoncontrol_reg cmn_ctl_axi @0&#215;40; // at address=0&#215;40</em><br />
<em>} axi;</em><br />
<em>}; </em></p>
<p>The equivalent of multiple view <em>addressmap</em>, in RALF is <strong><em>domain</em></strong>.</p>
<p>This allows one definition of the shared register while allowing access from each domain to it, where register address associated with each domain may be different .The following code is RALF with domain implementation for above RDL.</p>
<p><em>register commoncontrol_reg {</em><br />
<em><strong>shared</strong>;</em><br />
<em>field f1 {</em><br />
<em>bits 32;</em><br />
<em>access rw;</em><br />
<em>reset &#8216;h0;</em><br />
<em>}</em><br />
<em>}</em></p>
<p><em>block dma_blk_bridge {</em><br />
<em><strong>domain</strong> ahb {</em><br />
<em>bytes 4;</em><br />
<em>register commoncontrol_reg =cmn_ctl_ahb @&#8217;h00 ;</em><br />
<em>}</em></p>
<p><em><strong>domain</strong> axi {</em><br />
<em>bytes 4;</em></p>
<p><em>register commoncontrol_reg=cmn_ctl_axi @&#8217;h40 ;</em><br />
<em>}</em><br />
<em>}</em></p>
<p>Each physical interface is a domain in RALF. Only blocks and systems have domains, registers are in the block. For access to a register from one interface/domain RAL provides read/write methods which can be called with the domain name as argument. This is shown below..</p>
<p><em>ral_model.STATUS.write(status, data, <strong>“pci”);</strong></em></p>
<p><em>ral_model.STATUS.read(status, data, <strong>“ahb”</strong>); </em></p>
<h4>This considerably simplifies the verification environment code for the shared register accesses. For more on the same, you can look at : <a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvMjAxMC8wOS9zaGFyZWQtcmVnaXN0ZXItYWNjZXNzLWluLXJhbC10aG91Z2gtbXVsdGlwbGUtcGh5c2ljYWwtaW50ZXJmYWNlcy8=">Shared Register Access in RAL though multiple physical interfaces</a></h4>
<p>However, unfortunately, in our case, the tools we used did not support multiple interfaces and the automated flow created a the RALF having effectively two or more top level systems re-defining the registers. This can blow up the RALF file size and also verification environment code.</p>
<p><em>system dma_blk_bridge {</em><br />
<em>bytes 4;</em><br />
<em>block ahb (ahb) @0&#215;0 {</em><br />
<em>bytes 4;</em><br />
<em>register cmn_ctl_ahb @0&#215;0 {</em><br />
<em>bytes 4;</em><br />
<em>field cmn_ctl_ahb_fl(cmn_ctl_ahb_f1)@0{</em><br />
<em>bits 32;</em><br />
<em>access rw;</em><br />
<em>reset 0&#215;0;</em><br />
<em>} }</em><br />
<em>}</em></p>
<p><em>block axi (axi) @0&#215;0 {</em><br />
<em>bytes 4;</em><br />
<em>register cmn_ctl_axi @0&#215;40 {</em><br />
<em>bytes 4;</em><br />
<em>field cmn_ctl_axi_f1 (cmn_ctl_axi_f1) @0 {</em><br />
<em>bits 32;</em><br />
<em>access rw;</em><br />
<em>reset 0&#215;0;</em><br />
<em>} } </em><br />
<em>}</em><br />
<em>}</em></p>
<p>Thus, as seen above, the tool is generating two blocks ‘ahb’ and ‘axi’ and re-defining the register in each block. For multiple shared registers, the resulting verification code will be much bigger than if <em>domain </em>had been used.</p>
<p>Also, without the domain associated read/write methods (as shown above) for accessing the shared registers will be at least a few lines of code per register for accessing it from a domain/interface. This makes writing the test scenarios complicated and wordy.</p>
<p>Using ‘domain’ in RALF and VMM RAL makes shared register implementation and access in verification environment easy. We hope that we would soon be able to have our automated flow leverage this effectively..</p>
<p>If you are interested to go through more details about our automation setup and register verification experiences, you might want to look at: <a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dzEwLmVkYWNhZmUuY29tL2xpbmsvRFZDb24tMjAxMS1BdXRvbWF0ZWQtYXBwcm9hY2gtUmVnaXN0ZXItRGVzaWduLVZlcmlmaWNhdGlvbi1jb21wbGV4LVNPQy8zNDU2OC92aWV3Lmh0bWw=">http://www10.edacafe.com/link/DVCon-2011-Automated-approach-Register-Design-Verification-complex-SOC/34568/view.html</a></p>
 <img src="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?view=1&post_id=2580" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vmmcentral.org/vmartialarts/2011/07/the-one-stop-shop-get-done-with-everything-you-need-to-do-with-your-registers/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Transactor generator with VMM technology for efficient usage of CPU resources.</title>
		<link>http://www.vmmcentral.org/vmartialarts/2010/04/transactor-generator-with-vmm-technology-for-efficient-usage-of-cpu-resources/</link>
		<comments>http://www.vmmcentral.org/vmartialarts/2010/04/transactor-generator-with-vmm-technology-for-efficient-usage-of-cpu-resources/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 15:37:15 +0000</pubDate>
		<dc:creator>Oded Edelstein</dc:creator>
				<category><![CDATA[Automation]]></category>
		<category><![CDATA[Modeling]]></category>
		<category><![CDATA[Optimization/Performance]]></category>

		<guid isPermaLink="false">http://www.vmmcentral.org/vmartialarts/?p=1175</guid>
		<description><![CDATA[Oded Edelstein – Founder and CEO of SolidVer Background: Many network designs require an efficient transactor generator to cover DUT functionality. In a random test we would like to cover all scenarios, but also to use the CPU mostly on cases which push the design to its edge. In this VMM example, I will demonstrate [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvd3AtY29udGVudC91cGxvYWRzLzIwMTAvMDQvT2RlZEVkZWxzdGVpblBpYy5qcGc="><img style="border: 0px;" src="http://www.vmmcentral.org/vmartialarts/wp-content/uploads/2010/04/OdedEdelsteinPic_thumb.jpg" border="0" alt="OdedEdelsteinPic" width="114" height="151" align="left" /></a></p>
<p>Oded Edelstein – Founder and CEO of SolidVer</p>
<p>Background:</p>
<p>Many network designs require an efficient transactor generator<br />
to cover DUT functionality.</p>
<p>In a random test we would like to cover all scenarios,<br />
but also to use the CPU mostly on cases which push the design to its edge.</p>
<p>In this VMM example, I will demonstrate 3 cases, and solutions for a better<br />
usage of CPU resources.</p>
<p>Cases:</p>
<p>Case A &#8211; In network designs packet size can vary between 40 Bytes, for small packets<br />
and 10KBytes, for large MTU packets.<br />
A test which is based on the number of packets(Transactions), might be very short<br />
or very long depends on the total size of packets. The long tests scenarios can<br />
be covered in a separate random test.</p>
<p>Case B &#8211; Some network designs forward packets to different channels(queues) with<br />
different levels of bandwidth support. Random generation of channel<br />
number does not cover many cases (e.g. filling a certain queue with packets),<br />
since the probability that the same channel will be chosen one after the other,<br />
in a system with many channels is very low.</p>
<p>Case C &#8211; In some projects, the transactor generates many packets to all queues<br />
while some queues are randomly configured to a low bandwidth. This causes the<br />
test to be very long, until all packets are being forwarded.<br />
At the beginning of the test, the DUT is very busy &#8211; almost every cycle, it gets data.<br />
But after the high bandwidth queues got all packets, the low bandwidth queues<br />
continue slowly to get packets, until all packets have been forwarded.<br />
Now, most of the DUT queues are empty and the DUT is using only a small<br />
portion of its performance ability. That has no added value for coverage.</p>
<p>Solutions:</p>
<p>The following code example, shows a simple solution for the above cases.<br />
The solution is based on the following techniques:</p>
<p>1. Test length is defined based on sum of packets size, instead of the number of<br />
packets(transactions).</p>
<p>2. Add the random test a basic case where a number of packets are send  to the same channel<br />
one after the other.<br />
Low probability cases need to be identified and added as case inside<br />
the random test (cases inside directed tests are not good enough for a good coverage).</p>
<p>3. No packets are generated in advance for all queues.<br />
Packets are randomly generated and driven, on the fly, only to available queues.<br />
From my experience, random tests can generate all parameters, and a good coverage can be achieved.<br />
At the same time, a much better coverage can be achieved if idle periods, which consume<br />
CPU during the test are identified and handle correctly.</p>
<p>Code Example:</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
//<br />
//  packet.sv<br />
//<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
class packet extends vmm_data;</p>
<p>rand byte payload[];<br />
rand int packet_size;<br />
rand int channel_num;</p>
<p>static int cnt;</p>
<p>constraint c_payload_size { payload.size == packet_size; }</p>
<p>constraint c_pkt_size_dist { packet_size  dist { 40:= 20,<br />
[41:200]:= 50,<br />
[200:2000]:= 5,<br />
[2000:10000]:= 1,<br />
10000 := 1};}</p>
<p>`vmm_data_member_begin(packet)<br />
`vmm_data_member_scalar_array(payload, DO_ALL)<br />
`vmm_data_member_scalar(packet_size, DO_ALL)<br />
`vmm_data_member_scalar(channel_numm, DO_ALL)<br />
`vmm_data_member_end(packet)</p>
<p>endclass : packet</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
// VMM Macros &#8211; Channel and Atomic Generator<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
`vmm_channel(packet)<br />
`vmm_atomic_gen(packet, &#8220;Packet atomic generator&#8221;)</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
//  End file packet.sv<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
//<br />
//  bfm_master.sv<br />
//<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>//<br />
// SUM_PACKETS_SIZE_IN_TEST : The sum of packets size in bytes that the BFM will drive the DUT.<br />
// We used sum of packets size, to define test length, instead of number of packets, since packet<br />
// size distribution could randomly vary between 40 bytes (small packets) &#8211; 10KByes (Large MTU packets).<br />
// This could cause for some seeds to be very long, with no significant added value for coverage.<br />
// These long scenarios were tested in a separate random test.<br />
//<br />
`define SUM_PACKETS_SIZE_IN_TEST 10000000 // 10MB</p>
<p>//<br />
// In this example The DUT gets a packet with a channel number.<br />
// The DUT holds a sperate FIFO for every channel.<br />
//<br />
`define MAX_NUMBER_OF_CAHNNELS   16<br />
class bfm_master extends vmm_xactor;</p>
<p>vmm_log log;</p>
<p>// Packet Transaction channels<br />
//<br />
packet_channel    packet_chan;</p>
<p>//<br />
// The DUT will send the BFM back pressure signal, separately for every channel,<br />
// when the channel FIFO, inside the DUT is full.<br />
// avail_channel_list &#8211; Holds a bit for every channel, The BFM can drive packets only on channels<br />
//                      which are not back pressured.<br />
//<br />
bit [(`MAX_NUMBER_OF_CAHNNELS-1):0] avail_channel_list;<br />
int done = 0;</p>
<p>extern function new (string instance,<br />
integer stream_id,<br />
packet_channel packet_chan);<br />
extern function int generate_stream_size();<br />
extern function int generate_avail_channel();</p>
<p>extern virtual task main();<br />
extern virtual task drive_packet(packet packet_trans);</p>
<p>endclass: bfm_master</p>
<p>function bfm_master::new(string instance,<br />
integer stream_id,<br />
packet_channel packet_chan);</p>
<p>super.new(&#8220;BFM MASTER&#8221;, instance, stream_id);<br />
log = new(&#8220;BFM MASTER&#8221;, &#8220;BFM MASTER&#8221;);<br />
if (packet_chan == null) packet_chan = new(&#8220;BFM MASTER INPUT CHANNEL&#8221;, instance);<br />
this.packet_chan = packet_chan;</p>
<p>endfunction: new</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
// main() &#8211; Main task for driving packets.<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>task bfm_master::drive_packet(packet packet_trans);<br />
// drive the packet &#8230;<br />
endtask: drive_packet</p>
<p>function int bfm_master::generate_avail_channel();<br />
&#8230;.<br />
endfunction</p>
<p>function int bfm_master::generate_stream_size();<br />
&#8230;.<br />
endfunction<br />
task bfm_master::main();</p>
<p>//<br />
// The sum of packets that the BFM will drive the DUT. when this value is<br />
// above SUM_PACKETS_SIZE_IN_TEST the BFM will stop driving packets<br />
//<br />
int sum_packet_data_sent = 0;</p>
<p>//<br />
// The channel on which the DUT will drive packets. This channel should not be back pressured<br />
// while driving packets<br />
//<br />
int channel_num;</p>
<p>//<br />
// packet_stream_size<br />
// The number of packets that will be sent one after the other to the same channel.<br />
// The idea behind this variable is to get a good coverage for cases where number<br />
// of packets are sent to the same channel one after the other, to quickly fill the FIFO.<br />
// Otherwise the BFM will generate statistically every time, a different<br />
// channel. The probability that the same channel will be generated one after the other<br />
// is very low. e.g. Statistically the probability that the same channel will be<br />
// generated 5, 10, or 20 times, one after the other, is 16 power 5, 16 power 10 or<br />
// 16 power 20, which is a very low probability.<br />
//</p>
<p>int packet_stream_size;</p>
<p>// Counter for the number of packets that were driven in the test.<br />
//<br />
int packet_cnt = 0;<br />
int i;<br />
packet packet_trans;<br />
super.main();<br />
while(sum_packet_data_sent &lt; `SUM_PACKETS_SIZE_IN_TEST) begin<br />
// gen random channel from avail_channel_list;<br />
channel_num = generate_avail_channel();<br />
packet_stream_size =  generate_stream_size();</p>
<p>for(i = 0; i &lt; packet_stream_size; i++ ) begin<br />
this.wait_if_stopped_or_empty(this.packet_chan);<br />
if(avail_channel_list[channel_num] == 1) begin<br />
packet_chan.get(packet_trans);<br />
packet_trans.channel_num = channel_num;<br />
drive_packet(packet_trans);<br />
sum_packet_data_sent = sum_packet_data_sent + packet_trans.packet_size;<br />
packet_cnt++;<br />
`vmm_note(log, $psprintf(&#8220;drive packet = %0d  size = %0d  channel = %0d  stream index = %0d  sum = %0d &#8220;,<br />
packet_cnt, packet_trans.packet_size, channel_num, i, sum_packet_data_sent));<br />
end<br />
else begin<br />
break;<br />
end<br />
end // for loop<br />
end// end while loop<br />
done = 1;</p>
<p>endtask: main</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
//<br />
//  End file bfm_master.sv<br />
//<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
 <img src="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?view=1&post_id=1175" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vmmcentral.org/vmartialarts/2010/04/transactor-generator-with-vmm-technology-for-efficient-usage-of-cpu-resources/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Verification For the Rest of Us</title>
		<link>http://www.vmmcentral.org/vmartialarts/2010/03/verification-for-the-rest-of-us/</link>
		<comments>http://www.vmmcentral.org/vmartialarts/2010/03/verification-for-the-rest-of-us/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 21:30:33 +0000</pubDate>
		<dc:creator>Andrew Piziali</dc:creator>
				<category><![CDATA[Modeling]]></category>
		<category><![CDATA[Organization]]></category>
		<category><![CDATA[Verification Planning & Management]]></category>

		<guid isPermaLink="false">http://www.vmmcentral.org/vmartialarts/?p=1141</guid>
		<description><![CDATA[Andrew Piziali, independent consultant Jim Bondi, DMTS, Texas Instruments Functional verification engineers—also known as DV engineers—often think quite highly of themselves. Having mastered both hardware and software design, and each new design from top to bottom with an understanding exceeding all but the architects, we can see why they might end up with an inflated [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Andrew Piziali, independent consultant<br />
Jim Bondi, DMTS, Texas Instruments</strong></p>
<p>Functional verification engineers—also known as DV engineers—often think quite highly of themselves. Having mastered both hardware and software design, and each new design from top to bottom with an understanding exceeding all but the architects, we can see why they might end up with an inflated ego. Yet, responsibility for verification of the design is not theirs alone and sometimes not theirs at all!</p>
<p>In this next series of blog posts I am going to direct your attention to the role various members of a design team play in the verification process. Each will be co-authored by someone contributing to their design in the role under discussion. It is not uncommon these days for a small design team to lack any dedicated verification engineers.  Hence, the designers become responsible for the functional verification process embedded in, yet operating in parallel to, the design process.  What does that overall process look like?<a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=I0VTTA==">[1]</a></p>
<ol>
<li> Specification and Modeling</li>
<li> Hardware/Software Partitioning</li>
<li> Pre-Partitioning Analysis</li>
<li> Partitioning</li>
<li> Post-Partitioning Analysis and Debug</li>
<li> Post-Partitioning Verification</li>
<li> Hardware and Software Implementation</li>
<li> Implementation Verification</li>
</ol>
<p>Specification and modeling is responsible for exploring nascent design spaces and capturing original intent. The difficult choices of how to partition the design implementation between hardware and software components comes next. Then, analysis of each partitioning choice and debugging these high level models. Our first opportunity for functional verification follows post-partitioning analysis and debug, where abstract algorithm errors are discovered and eliminated. Hardware and software implementation is self explanatory, lastly leading to implementation verification, answering the question &#8220;Has the design intent been preserved in the implementation?&#8221;</p>
<p>This kick-off post in this series addresses the role of the architect in verification. My co-author, Jim Bondi, has been a key architect on numerous design projects at Texas Instruments ranging from embedded military systems to Pentium-class x86 processors to ultra low power DSP platforms for medical applications. The architect, whether a single individual or several, is responsible for specifying a solution to customer product requirements that captures the initial design intent of the solution. The resultant specification is iteratively refined during the first three stages of design.</p>
<p>In addition to authoring the original design intent, the second role of the architect in the verification process is preserving that intent and contributing to its precise conveyance throughout the remainder of the design process.<a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=I0ZWQ01B">[2]</a> This begins during verification planning, where the scope of the verification problem is quantified and its solution specified. Verification planning itself begins with specification analysis, where the features of the design are identified and quantified. The complexity of most designs requires a top down analysis of the specification—first, because of its size (&gt;20 pages) and second, because behavioral requirements must be distilled. This analysis is performed in a series of brainstorming meetings wherein each of the stakeholders of the design contribute: architect, system engineer, verification engineer, software engineer, hardware designer and project manager.</p>
<p>A brainstorming session is guided by someone familiar with the planning process. The architect describes each design feature and—through Q&amp;A—its attributes are illuminated. These attributes and their associated values—registers, data paths, control logic, opcodes—are initially recorded in an <a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9Jc2hpa2F3YV8gZGlhZ3JhbQ==">Ishikawa diagram</a> (also known as a &#8220;fish bone diagram&#8221;) for organizational purposes and then transferred to a coverage model design table as they are refined. Ultimately, each coverage model is implemented using a high level verification language (HVL), as part of the verification environment, and used to measure verification progress.</p>
<p>The seasoned architect knows that, even though modeling is mentioned only in the first design step above, it is most effective not only when started early but also continued iteratively throughout most of the design process. It is quite true that system modeling should be started early—as soon as possible and ideally before any RTL is written—when modeling can have its biggest impact on the design and offer its biggest return on model investment. In this early stage, modeling can best help tune the nascent architecture to the application, with the biggest resultant possible improvements in system performance and power. When used right, models are developed first and then actually drive the development of RTL in later design steps. This is contrary to the all- to-common tendency to jump prematurely to RTL representations of the design, and then perhaps use modeling mostly thereafter in attempts to help check and improve the RTL. Used in this fashion, the ability of modeling to improve the design is limited. More experienced architects have learned that modeling is best applied &#8220;up front&#8221; because it is here, before the design is cast in RTL, that up to 75% of the overall possible improvements in system performance and power can be realized.  The architect knows that a design process that jumps prematurely to RTL leaves much of this potential performance and power improvement on the table.</p>
<p>The seasoned architect also knows that, even though started early, modeling should be continued iteratively throughout most of the remainder of the design process. They know that, in fact, a set of models is needed to best support the design process. The first is typically an untimed functional model that becomes the design&#8217;s &#8220;golden&#8221; reference model, effectively an executable specification. As the design process continues, other models are derived from it, with, for example, timing added to derive performance models and power estimates added to derive power-aware models. In later stages, after modeling has been used &#8220;up front&#8221; to tune the architecture, optimal RTL can actually be derived from the models. Wherever verification is applied in the design process, whether before or after RTL appears, the models, as a natural form of executable golden reference, can support, or even drive, the verification process. Thus, in design flows that use modeling best, system modeling begins up front and is continued iteratively throughout most of the overall design process.</p>
<p>Indeed, the architect plays a crucial role in the overall design process and in the functional verification of the design derived from that process. They are heavily involved in all design phases affecting and involving verification, from authoring the initial design intent to ensuring its preservation throughout the rest of the design process.  The seasoned architect leverages a special set of system models to help perform this crucial role. Despite the verification engineer&#8217;s well-deserved reputation as a jack-of-all-trades, they cannot verify the design alone and may not even be represented in a small design team.  The architect is the &#8220;intent glue&#8221; that holds the design together until it is complete!</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<a name="ESL">[1]</a> <a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VsZWN0cm9uaWNzeXN0ZW1sZXZlbC5jb20vQm9vay1EVi5odG0=">ESL Design and Verification</a>, Bailey, Martin and Piziali, Elsevier, 2007<br />
<a name="FVCMA">[2]</a> <a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5zcHJpbmdlci5jb20vZW5naW5lZXJpbmcvY2lyY3VpdHMrJmFtcDsrc3lzdGVtcy9ib29rLzk3OC0xLTQwMjAtODAyNS04">Functional Verification Coverage Measurement and Analysis</a>, Piziali, Springer, 2004</p>
 <img src="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?view=1&post_id=1141" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vmmcentral.org/vmartialarts/2010/03/verification-for-the-rest-of-us/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Verification in the trenches: Implementing Complex Synchronization Between Components Using VMM1.2</title>
		<link>http://www.vmmcentral.org/vmartialarts/2010/02/verification-in-the-trenches-creating-your-verification-components-using-vmm1-2-2/</link>
		<comments>http://www.vmmcentral.org/vmartialarts/2010/02/verification-in-the-trenches-creating-your-verification-components-using-vmm1-2-2/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 21:04:35 +0000</pubDate>
		<dc:creator>Ambar Sarkar</dc:creator>
				<category><![CDATA[Communication]]></category>
		<category><![CDATA[Modeling]]></category>
		<category><![CDATA[Phasing]]></category>
		<category><![CDATA[Reuse]]></category>
		<category><![CDATA[VMM 1.2]]></category>

		<guid isPermaLink="false">http://www.vmmcentral.org/vmartialarts/?p=910</guid>
		<description><![CDATA[Dr. Ambar Sarkar, Chief Verification Technologist, Paradigm Works Inc. Why is it tricky to get transactors and other verification components to work in sync with each other, especially  if they come from different projects?  It is likely that they worked well within their source projects,  but their phases (build, configure, reset, start, shutdown etc) were [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvd3AtY29udGVudC91cGxvYWRzLzIwMDkvMTIvYW1iYXIuanBn"><img style="margin-left: 0px; margin-right: 0px; border-width: 0px;" src="http://www.vmmcentral.org/vmartialarts/wp-content/uploads/2009/12/ambar_thumb.jpg" border="0" alt="ambar" width="108" height="87" align="left" /></a> Dr. Ambar Sarkar, Chief Verification Technologist, Paradigm Works Inc.</p>
<p>Why is it tricky to get transactors and other verification components to work in sync with each other, especially  if they come from different projects?  It is likely that they worked well within their source projects,  but their phases (build, configure, reset, start, shutdown etc) were implemented quite differently compared to other components. These differences are usually driven by the inherent protocol requirements or team preferences. For example, consider the verification of an SOC with an AXI  host interface and a PCIe Root Complex. You will likely get your host interface transactor out of reset and execute a configuration sequence before you let your PCIe end point transactor send in requests. So you would not want to run the phases of these two transactors in lock step.</p>
<p>While there are countless ways to implement the phases and their sequencing, one can broadly classify a component  as being either explicitly or implicitly driven, depending on how its phases are invoked.</p>
<p><strong>Implicit phasing</strong>: In my <a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvP3A9OTA5">earlier post</a>, we discussed how one can often easily coordinate the execution of various verification components. Simply put, as long as one is able to distribute the execution of the component between predetermined methods (called phases), the components can execute in lock-step with one another without requiring any additional coding by the verification engineer. This is called implicit phasing. Implicit phasing may suffice in many cases, but the challenge is to agree on the same set of phases and their sequencing. You basically will need a way to define additional  phases and potentially even rearrange their implicit calling sequence.</p>
<p><strong>Explicit phasing</strong>: In contrast, explicit phasing requires the environment writer to explicitly call and synchronize the phases of the components. Typically, it takes some work to get such components to play well with one another.  This happens more often for legacy or externally developed components. In such cases, the  developers may not have known about the predetermined phases so they could not have broken down the implementation quite the way the target environment expects. Explicit phasing is often unavoidable in environments with components from multiple sources, since you may need to carefully control and coordinate the phases by hand to accommodate their differing implementation assumptions.</p>
<p>So the challenge we are discussing today is really about making these explicit and implicit phased components get their phases to match and cooperate during their phase transitions.</p>
<p>This is where vmm_timeline helps. Simply put, vmm_timeline object encapsulates your implicitly phased object and allows it to be called as an explicitly phased object.  It lets you define your own phases and the sequence in which you want to execute them. The ability to customize phases is critical, as you may need to define additional phases to fit in with the way the explicitly phased target  environment expects its phases to execute.</p>
<p>Here is an example that shows how an implicitly-phased component(<strong>my_implicit_comp</strong>) is being executed within an explicitly-phased <strong>my_env.</strong> Notice how the <strong>my_tl</strong>(derived from <strong>vmm_timeline</strong>) is used.</p>
<p><strong>Step a. Create a vmm_timeline object and instantiate the components</strong></p>
<table border="1" cellspacing="1" cellpadding="2" width="656">
<tbody>
<tr>
<td width="652" valign="top"><strong>// Implicitly phased comp<br />
</strong>class <strong>my_implicit_comp</strong> extends <strong>vmm_group</strong>;<br />
<strong> `vmm_typename</strong>(<strong>my_implicit_comp</strong>)<br />
…<br />
function new(string name = &#8220;&#8221;,<br />
vmm_object parent = null);<br />
super.new(&#8220;my_implicit_comp&#8221;, name, null);<br />
super.set_parent_object(parent);<br />
endfunctionvirtual function void build_ph();<br />
super.build_ph();<br />
…</p>
<p>endfunction<br />
…</p>
<p>endclass</p>
<p><strong>// Create a vmm_timeline class to wrap this implicitly phased component</strong></p>
<p>class <strong>my_tl</strong> extends <strong>vmm_timeline</strong>;<br />
`vmm_typename(my_tl)<br />
<strong>my_implicit_comp comp1;<br />
</strong></p>
<p><strong> </strong>function new(string name = &#8220;&#8221;,<br />
vmm_object parent = null);<br />
super.new(&#8220;my_tl&#8221;, name, parent);<br />
endfunction</p>
<p>virtual function void build_ph();<br />
super.build_ph();</p>
<p><strong> // Create an instance<br />
</strong><strong>this.comp1 = my_implicit_comp::create_instance(this, “comp1”);<br />
</strong> endfunction</p>
<p>endclass</td>
</tr>
</tbody>
</table>
<p><strong>Step b. Instantiate in top-level vmm_env and call out the implicit methods</strong></p>
<table border="1" cellspacing="1" cellpadding="2" width="626">
<tbody>
<tr>
<td width="622" valign="top"><strong>// Instantiate the vmm_timeline object in the top environment and call its phases explicitly.</strong><strong>class my_env extends vmm_env</strong>;<br />
`vmm_typename(my_env)<br />
<strong> my_tl tl;<br />
</strong></p>
<p>function new();<br />
super.new(&#8220;env&#8221;);<br />
endfunction</p>
<p><strong> virtual function void build();<br />
</strong> super.build();<br />
<strong> this.tl = new(&#8220;tl&#8221;, this);<br />
</strong> endfunction</p>
<p><strong> virtual task start();<br />
</strong> super.start();<br />
<strong> tl.run_phase(&#8220;start&#8221;);<br />
</strong> `vmm_note(log, &#8220;Started&#8230;&#8221;);<br />
endtask</p>
<p><strong> virtual task wait_for_end();<br />
</strong> super.wait_for_end();<br />
fork<br />
// run_test phase corresponds best here<br />
<strong> tl.run_phase(&#8220;run_test&#8221;);<br />
</strong> begin<br />
`vmm_note(log, &#8220;Running&#8230;&#8221;);<br />
#100;<br />
end<br />
join<br />
endtask</p>
<p><strong> virtual task stop();<br />
</strong> super.stop();</p>
<p>// shutdown phase corresponds best here<br />
<strong> tl.run_phase(&#8220;shutdown&#8221;);<br />
</strong> `vmm_note(log, &#8220;Stopped&#8230;&#8221;);<br />
endtask</td>
</tr>
</tbody>
</table>
<p>Note that the converse is also true. Explicitly phased components can be incorporated into implicitly driven environments. You need to encapsulate them in a parent class derived from the <strong>vmm_subenv</strong> class and define how each implicit phase of the parent class can be mapped to the proper explicit phase(s) of the original component. Then you can simply instantiate this parent class in the target environment. For further details, search the string “Mixed Phasing” in the VMM 1.2 User Guide.<strong> </strong></p>
<p>In summary, vmm_timeline helps you manage different phasing and sequencing needs of verification components by making it easier for explicitly and implicitly phased components to interact. No wonder that under the hood of VMM1.2, vmm_timeline is used to implement advanced features such as multi-test concatenation.</p>
<p>This article is the 4<sup>th</sup> in the <a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvP3A9NDgx"><em>Verification in the trenches</em></a><em> series</em>. Hope you found this article useful. If you would like to hear about any other related topic, please comment or drop me a line at ambar.sarkar@paradigm-works.com. Also, if you are starting out fresh, please check out the free VMM1.2 environment generator at <a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Jlc291cmNld29ya3MucGFyYWRpZ20td29ya3MuY29tL3N2ZnRnL3ZtbQ=="><em>http://resourceworks.paradigm-works.com/svftg/vmm</em></a><em> . </em></p>
 <img src="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?view=1&post_id=910" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vmmcentral.org/vmartialarts/2010/02/verification-in-the-trenches-creating-your-verification-components-using-vmm1-2-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Explicitly-Phased Components in an Implicitly-Phased Testbench</title>
		<link>http://www.vmmcentral.org/vmartialarts/2009/12/using-explicitly-phased-components-in-an-implicitly-phased-testbench/</link>
		<comments>http://www.vmmcentral.org/vmartialarts/2009/12/using-explicitly-phased-components-in-an-implicitly-phased-testbench/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 17:35:05 +0000</pubDate>
		<dc:creator>JL Gray</dc:creator>
				<category><![CDATA[Communication]]></category>
		<category><![CDATA[Modeling]]></category>
		<category><![CDATA[Phasing]]></category>
		<category><![CDATA[Reuse]]></category>
		<category><![CDATA[VMM]]></category>
		<category><![CDATA[VMM 1.2]]></category>

		<guid isPermaLink="false">http://www.vmmcentral.org/vmartialarts/?p=714</guid>
		<description><![CDATA[In my last post, I described the new VMM 1.2 implicit phasing capabilities.  I also recommended developing any new code based off of implicit phasing.  Obviously, though, companies that have been using the VMM for quite some time will have developed all of their existing testbench components using explicit phasing.  It is relatively straightforward (and [...]]]></description>
			<content:encoded><![CDATA[<p>In my last post, I described the <a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvP3A9NTA2">new VMM 1.2 implicit phasing capabilities</a>.  I also recommended developing any new code based off of implicit phasing.  Obviously, though, companies that have been using the VMM for quite some time will have developed all of their existing testbench components using explicit phasing.  It is relatively straightforward (and in some sense almost trivial) to use an explicitly phased component in an implicitly phased testbench.</p>
<p>Remember that the whole point of explicit phasing is that users cycle components through the desired phases by manually calling functions and tasks within the component itself. <span style="font-family: Consolas;">vmm_env</span> contains the following methods:</p>
<ul>
<li><span style="font-family: Consolas;">gen_cfg</span></li>
<li><span style="font-family: Consolas;">build</span></li>
<li><span style="font-family: Consolas;">reset</span></li>
<li><span style="font-family: Consolas;">config_dut</span></li>
<li><span style="font-family: Consolas;">start</span></li>
<li><span style="font-family: Consolas;">wait_for_end</span></li>
<li><span style="font-family: Consolas;">stop</span></li>
<li><span style="font-family: Consolas;">cleanup</span></li>
<li><span style="font-family: Consolas;">report</span></li>
</ul>
<p><span style="font-family: consolas;">vmm_subenv</span> contains the following relevant methods:</p>
<ul>
<li><span style="font-family: Consolas;">new</span></li>
<li><span style="font-family: Consolas;">configure</span></li>
<li><span style="font-family: Consolas;">start</span></li>
<li><span style="font-family: Consolas;">stop</span></li>
<li><span style="font-family: Consolas;">cleanup</span></li>
<li><span style="font-family: Consolas;">report</span></li>
</ul>
<p>In an explicitly-phased environment, <span style="font-family: consolas;">subenv</span> methods are called manually by integrators, usually from the equivalent method in <span style="font-family: consolas;">vmm_env</span>. There are two approaches for instantiating a <span style="font-family: consolas;">vmm_subenv</span>-based component in an implicitly-phased testbench. The default approach is to simply allow the implicit phasing mechanism to call these explicit phases for you. Explicitly phased components are identified by the implicit phasing mechanism, and methods are called using a standard (and not entirely unexpected) mapping:</p>
<table border="0" cellspacing="0" cellpadding="2" width="253">
<tbody>
<tr>
<td width="109" valign="top"><strong>Implicit Phase</strong></td>
<td width="142" valign="top"><strong>Explicit Phase Called</strong></td>
</tr>
<tr>
<td width="109" valign="top"><span style="font-family: consolas;">build_ph</span></td>
<td width="142" valign="top"><span style="font-family: consolas;">vmm_subenv::new[1]</span></td>
</tr>
<tr>
<td width="109" valign="top"><span style="font-family: consolas;">configure_ph</span></td>
<td width="142" valign="top"><span style="font-family: consolas;">vmm_subenv::configure</span></td>
</tr>
<tr>
<td width="109" valign="top"><span style="font-family: consolas;">start_ph</span></td>
<td width="142" valign="top"><span style="font-family: consolas;">vmm_subenv::start</span></td>
</tr>
<tr>
<td width="109" valign="top"><span style="font-family: consolas;">stop_ph</span></td>
<td width="142" valign="top"><span style="font-family: consolas;">vmm_subenv::stop</span></td>
</tr>
<tr>
<td width="109" valign="top"><span style="font-family: consolas;">cleanup_ph</span></td>
<td width="142" valign="top"><span style="font-family: consolas;">vmm_subenv::cleanup</span></td>
</tr>
<tr>
<td width="109" valign="top"><span style="font-family: consolas;">report_ph</span></td>
<td width="142" valign="top"><span style="font-family: consolas;">vmm_subenv::report</span></td>
</tr>
</tbody>
</table>
<p>[1] Users must call vmm_subenv::new manually.</p>
<p>Now, you might want to phase your vmm_subenv in a non-standard way. If that’s the case, the first thing you’ll need to do is disable the automatic phasing. Here’s how. First, instantiate a null phase:</p>
<p><span style="font-family: Consolas;">vmm_null_phase_def null_ph = new();</span></p>
<p>Next, override the phases you don’t want to start automatically. For example:</p>
<p><span style="font-family: Consolas;">my_group.override_phase(“start”, null_ph);<br />
my_group.override_phase(“stop”, null_ph);</span></p>
<p>Finally, call the explicit phases from the parent object’s implicit phases.  A complete example is shown below.</p>
<p>class testbench_top extends vmm_group;<br />
bus_master_subenv bus_master;<br />
vmm_null_phase_def null_ph = new();</p>
<p>function void build_ph();<br />
bus_master = bus_master_subenv::create_instance(this, “bus_master”);<br />
bus_master.override_phase(“start”, null_ph);<br />
bus_master.override_phase(“stop”, null_ph);<br />
endfunction: build_ph</p>
<p>task reset_ph();<br />
bus_master.start();<br />
// wait 1000 clocks…<br />
bus_master.stop();<br />
endtask: reset_ph</p>
<p>endclass: testbench_top</p>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
 <img src="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?view=1&post_id=714" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vmmcentral.org/vmartialarts/2009/12/using-explicitly-phased-components-in-an-implicitly-phased-testbench/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

