<?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; SystemC/C/C++</title>
	<atom:link href="http://www.vmmcentral.org/vmartialarts/category/systemc/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>Blocking and Non-blocking Communication Using the TLI</title>
		<link>http://www.vmmcentral.org/vmartialarts/2011/03/blocking-and-non-blocking-communication-using-the-tli/</link>
		<comments>http://www.vmmcentral.org/vmartialarts/2011/03/blocking-and-non-blocking-communication-using-the-tli/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 15:36:17 +0000</pubDate>
		<dc:creator>John Aynsley</dc:creator>
				<category><![CDATA[SystemC/C/C++]]></category>
		<category><![CDATA[SystemVerilog]]></category>
		<category><![CDATA[Transaction Level Modeling (TLM)]]></category>
		<category><![CDATA[VMM 1.2]]></category>

		<guid isPermaLink="false">http://www.vmmcentral.org/vmartialarts/2011/03/blocking-and-non-blocking-communication-using-the-tli/</guid>
		<description><![CDATA[John Aynsley, CTO, Doulos In the previous blog post I introduced the VCS TLI Adapters for transaction-level communication between SystemVerilog and SystemC. Now let&#8217;s look at the various coding styles supported by the TLI Adapters, and at the same time review the various communication options available in VMM 1.2. We will start with the options [...]]]></description>
			<content:encoded><![CDATA[<h3>John Aynsley, CTO, Doulos</h3>
<p><span style="font-family: Verdana;">In the <a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvMjAxMS8wMy92bW0tdG8tc3lzdGVtYy1jb21tdW5pY2F0aW9uLXVzaW5nLXRoZS10bGkv">previous blog</a> post I introduced the VCS TLI Adapters for transaction-level communication between SystemVerilog and SystemC. Now let&#8217;s look at the various coding styles supported by the TLI Adapters, and at the same time review the various communication options available in VMM 1.2.<br />
</span><span style="font-family: Verdana;"><br />
We will start with the options for sending transactions from SystemVerilog to SystemC. VMM 1.2 allows transactions to be sent through the classic VMM channel or through the new-style TLM ports, which come in blocking- and non-blocking flavors. Blocking means that the entire transaction completes in one function call, whereas non-blocking interfaces may required multiple function calls in both directions to complete a single transaction: </span></p>
<p><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvd3AtY29udGVudC91cGxvYWRzLzIwMTEvMDMvaW1hZ2UyLnBuZw=="><img style="border-width: 0px;" src="http://www.vmmcentral.org/vmartialarts/wp-content/uploads/2011/03/image_thumb2.png" border="0" alt="image" width="722" height="495" /></a></p>
<p><span style="font-family: Verdana;">On the SystemVerilog side, transactions can be sent out through blocking or non-blocking TLM ports, through VMM channels or through TLM analysis ports. On the SystemC side, transactions can be received by b_transport or nb_transport, representing the loosely-timed (LT) and approximately-timed (AT) coding styles, respectively, or through analysis exports. In the TLM-2.0 standard any socket supports both the LT and AT coding styles, although SystemVerilog does not offer quite this level of flexibility, and hence neither does the TLI. </span></p>
<p><span style="font-family: Verdana;">Now we will look at the options for sending transactions from SystemC back to SystemVerilog. Not surprisingly, they mirror the previous case: </span></p>
<p><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvd3AtY29udGVudC91cGxvYWRzLzIwMTEvMDMvaW1hZ2UzLnBuZw=="><img style="border-width: 0px;" src="http://www.vmmcentral.org/vmartialarts/wp-content/uploads/2011/03/image_thumb3.png" border="0" alt="image" width="718" height="490" /></a></p>
<p><span style="font-family: Verdana;">On the SystemC side, transactions can be sent out from LT or from AT initiators or through analysis ports. On the SystemVerilog side, transactions can be received by exports for blocking- or non-blocking transport, by vmm_channels, or by analysis subscribers. </span></p>
<p><span style="font-family: Verdana;">Note the separation of the transport interfaces from the analysis interfaces in either direction. The transport interfaces are used for modeling transactions in the target application domain, whereas the analysis interfaces are typically used internally within the verification environment for coverage collection or checking. </span></p>
<p><span style="font-family: Verdana;">In the SystemVerilog and SystemC source code, the choice of which TLI interface to use is made when binding ports, exports, or sockets to the TLI Adapter, for example: </span></p>
<p><span style="font-family: Verdana;"><br />
</span><span style="font-family: Courier;">// SystemVerilog<br />
`include &#8220;tli_sv_bindings.sv&#8221;<br />
import vmm_tlm_binds::*;           // For port/export<br />
import vmm_channel_binds::*;       // For channel </span></p>
<p><span style="font-family: Courier;">tli_tlm_bind(m_xactor.m_b_port,    vmm_tlm::TLM_BLOCKING_EXPORT,    &#8220;sv_tlm_lt&#8221;);<br />
tli_tlm_bind(m_xactor.m_nb_port,   vmm_tlm::TLM_NONBLOCKING_EXPORT, &#8220;sv_tlm_at&#8221;);<br />
tli_tlm_bind(m_xactor.m_b_export,  vmm_tlm::TLM_BLOCKING_PORT,      &#8220;sc_tlm_lt&#8221;);<br />
tli_tlm_bind(m_xactor.m_nb_export, vmm_tlm::TLM_NONBLOCKING_PORT,   &#8220;sc_tlm_at&#8221;);<br />
tli_channel_bind(m_xactor.m_out_at_chan, &#8220;sv_chan_at&#8221;, SV_2_SC_NB); </span></p>
<p><span style="font-family: Verdana;"><span style="font-family: Courier;">// SystemC<br />
#include &#8220;tli_sc_bindings.h&#8221;<br />
tli_tlm_bind_initiator(m_scmod-&gt;init_socket_lt, LT, &#8220;sc_tlm_lt&#8221;,true);<br />
tli_tlm_bind_initiator(m_scmod-&gt;init_socket_at, AT, &#8220;sc_tlm_at&#8221;,true);<br />
tli_tlm_bind_target   (m_scmod-&gt;targ_socket_lt, LT, &#8220;sv_tlm_lt&#8221;,true);<br />
tli_tlm_bind_target   (m_scmod-&gt;targ_socket_at, AT, &#8220;sv_tlm_at&#8221;,true);<br />
tli_tlm_bind_target   (m_scmod-&gt;targ_socket_chan_at, AT, &#8220;sv_chan_at&#8221;,true);<br />
</span><br />
</span></p>
<p><span style="font-family: Verdana;"><br />
Note how the tli_tlm_bind calls require you to specify in each case whether the LT or AT coding style is being used. The root cause of this inflexibility is certain language restrictions in SystemVerilog, in particular the lack of multiple inheritance, which makes it harder to create sockets that support multiple interfaces. Hence, in SystemVerilog, the blocking- and non-blocking interfaces get partitioned across multiple ports and exports. In the SystemC TLM-2.0 standard there is only a single kind of initiator socket and a single kind of target socket, each able to forward method calls of any of the core interfaces, namely, the blocking transport, non-blocking transport, direct memory, and debug interfaces. </span></p>
<p><span style="font-family: Verdana;">In summary, the VCS TLI provides a simple and straightforward mechanism for passing transaction in both directions between SystemVerilog and SystemC by exploiting the TLM-2.0 standard. </span></p>
 <img src="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?view=1&post_id=2333" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vmmcentral.org/vmartialarts/2011/03/blocking-and-non-blocking-communication-using-the-tli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMM-to-SystemC Communication Using the TLI</title>
		<link>http://www.vmmcentral.org/vmartialarts/2011/03/vmm-to-systemc-communication-using-the-tli/</link>
		<comments>http://www.vmmcentral.org/vmartialarts/2011/03/vmm-to-systemc-communication-using-the-tli/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 18:12:32 +0000</pubDate>
		<dc:creator>John Aynsley</dc:creator>
				<category><![CDATA[SystemC/C/C++]]></category>
		<category><![CDATA[Transaction Level Modeling (TLM)]]></category>
		<category><![CDATA[VMM 1.2]]></category>

		<guid isPermaLink="false">http://www.vmmcentral.org/vmartialarts/2011/03/vmm-to-systemc-communication-using-the-tli/</guid>
		<description><![CDATA[John Aynsley, CTO, Doulos I have said several times on this blog that the presence of TLM-2.0 features in VMM 1.2 should ease the task of communicating between a SystemVerilog test bench and a SystemC reference model. Now, at last, let&#8217;s see how to do this – using the VCS TLI or Transaction Level Interface [...]]]></description>
			<content:encoded><![CDATA[<h3>John Aynsley, CTO, Doulos</h3>
<p><span style="font-family: Verdana;">I have said several times on this blog that the presence of TLM-2.0 features in VMM 1.2 should ease the task of communicating between a SystemVerilog test bench and a SystemC reference model. Now, at last, let&#8217;s see how to do this – using the VCS TLI or Transaction Level Interface from Synopsys. </span></p>
<p><span style="font-family: Verdana;">The parts of the TLI in question are the VCS TLI Adapters between SystemVerilog and SystemC. These adapters exploit the TLM-2.0-inspired features introduced into VMM 1.2 on the SystemVerilog side and the OSCI TLM-2.0 standard itself on the SystemC side in order to pass transactions between the two language domains within a VCS simulation run. The TLI Adapters do not provide a completely general solution out-of-the-box for passing transactions between languages in that they are restricted to passing TLM-2.0 generic payload transactions (as discussed in a previous blog post). However, the Adapters can be extended by the user with a little work. </span></p>
<p><span style="font-family: Verdana;">Clearly, the VCS TLI solution will only be of interest to VCS users. As an alternative to the VCS TLI, it is possible to pass transactions between SystemVerilog and SystemC using the SystemVerilog DPI as described in </span><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5kb3Vsb3MuY29tL2tub3dob3cvc3lzdmVyaWxvZy9EVkNvbjEwX2RwaV9wYXBlci8="><em>SystemVerilog Meets C++: Re-use of Existing C/C++ Models Just Got Easier</em></a><span style="font-family: Verdana;">, and the Accellera VIP Technical Subcommittee are discussing a proposal to add a similar capability to UVM. </span></p>
<p><span style="font-family: Verdana;">If you want to pass user-defined transactions between SystemVerilog and SystemC you are going to have to jump through some hoops, whether you choose to use the VCS TLI or the DPI. However, for the TLM-2.0 generic payload, the VCS TLI provides a simple ready-to-use solution. Let&#8217;s see how it works. </span></p>
<p><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvd3AtY29udGVudC91cGxvYWRzLzIwMTEvMDMvaW1hZ2UxLnBuZw=="><img style="border-width: 0px;" src="http://www.vmmcentral.org/vmartialarts/wp-content/uploads/2011/03/image_thumb1.png" border="0" alt="image" width="696" height="434" /></a></p>
<p><span style="font-family: Verdana;">The TLI Adapters are provided as part of VCS. All you have to do is to include the appropriate file headers in your source code on both the SystemVerilog and SystemC sides, as shown on the diagram. The adapters themselves get compiled and instantiated automatically. The SystemVerilog side needs to use the VMM TLM ports, exports, or channels (as described in previous blog posts). The SystemC side needs to use the standard TLM-2.0 sockets. You then need to add a few extra lines of code on each side to bind the two sets of sockets together, and the TLI Adapters take care of the rest.<br />
From the point of view of the source code, the adapter is invisible apart from the presence of the header files. Each binding needs to be identified by giving it a name, with identical names being used on the SystemVerilog and SystemC sides to tie the two sets of ports or sockets together. Here is a trivial example: </span></p>
<p><span style="font-family: Verdana;">// SystemVerilog<br />
`include &#8220;tli_sv_bindings.sv&#8221;<br />
&#8230;<br />
vmm_tlm_b_transport_port #(my_xactor, vmm_tlm_generic_payload) m_b_port;<br />
&#8230;<br />
tli_tlm_bind(m_xactor.m_b_port, vmm_tlm::TLM_BLOCKING_EXPORT, &#8220;abc&#8221;); </span></p>
<p><span style="font-family: Verdana;">// SystemC<br />
#include &#8220;tli_sc_bindings.h&#8221;<br />
&#8230;<br />
tlm_utils::simple_target_socket&lt;scmod&gt;  targ_socket_lt;<br />
&#8230;<br />
tli_tlm_bind_target (m_scmod-&gt;targ_socket_lt, LT, &#8220;abc&#8221;, true); </span></p>
<p><span style="font-family: Verdana;"><br />
Note that the same name &#8220;abc&#8221; has been used on both the SystemVerilog and SystemC sides to tie the two ports/sockets together. On the SystemVerilog side we can now construct transactions and send them out through the TLM port: </span></p>
<p><span style="font-family: Verdana;">// SystemVerilog<br />
tx = new;<br />
assert( tx.randomize() with { m_command != 2; } );<br />
m_b_port.b_transport(tx, delay); </span></p>
<p><span style="font-family: Verdana;"><br />
On the SystemC side, we receive the incoming transaction: </span></p>
<p><span style="font-family: Verdana;">// SystemC<br />
void scmod::b_transport(tlm::tlm_generic_payload&amp; tx, sc_time&amp; delay) {<br />
&#8230;<br />
tx.set_response_status(tlm::TLM_OK_RESPONSE);<br />
} </span></p>
<p><span style="font-family: Verdana;"> </span></p>
<p><span style="font-family: Verdana;">The TLI Adapter takes care of converting the generic payload transaction from SystemVerilog to SystemC, and also takes care of the synchronization between the two languages. The VCS TLI provides a great ready-made solution for this particular use case. In the next blog post I will look at the VCS TLI support for various TLM modeling styles.</span></p>
<p><span style="font-family: Verdana;"> </span></p>
 <img src="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?view=1&post_id=2327" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vmmcentral.org/vmartialarts/2011/03/vmm-to-systemc-communication-using-the-tli/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Verification in the trenches: Transform your sc_module into a vmm_xactor</title>
		<link>http://www.vmmcentral.org/vmartialarts/2011/01/verification-in-the-trenches-transform-your-sc_module-into-a-vmm_xactor/</link>
		<comments>http://www.vmmcentral.org/vmartialarts/2011/01/verification-in-the-trenches-transform-your-sc_module-into-a-vmm_xactor/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 12:30:00 +0000</pubDate>
		<dc:creator>Ambar Sarkar</dc:creator>
				<category><![CDATA[Interoperability]]></category>
		<category><![CDATA[SystemC/C/C++]]></category>
		<category><![CDATA[VMM]]></category>

		<guid isPermaLink="false">http://www.vmmcentral.org/vmartialarts/?p=2086</guid>
		<description><![CDATA[Dr. Ambar Sarkar, Chief Verification Technologist, Paradigm Works Inc. Say you have SystemC VIP lying around, tried and true. More likely than not, they are BFMs that connect at the signal level to the DUT and have a procedural API supporting transaction level abstraction. What would be the best way to hook these components up [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: verdana;font-size: 10pt">Dr. Ambar Sarkar, Chief Verification Technologist, Paradigm Works Inc. <br /></span></p>
<p><font face="Verdana"><img style="margin: 5px" alt="" align="left" src="http://www.vmmcentral.org/vmartialarts/wp-content/uploads/2010/06/062810_1233_Verificatio1.jpg" width="131" height="98"></font></p>
<p>Say you have SystemC VIP lying around, tried and true. More likely than not, they are BFMs that connect at the signal level to the DUT and have a procedural API supporting transaction level abstraction.</p>
<p>What would be the best way to hook these components up with a VMM environment? With VMM now being available in SystemC as well, you really want to make these models look and behave as vmm_xactor derived objects that interact seamlessly across the SystemC/SystemVerilog language boundary. Your VMM environment can thus take full advantage of your existing SystemC components. And your sc_module can still be used, just as before, in other non VMM environments! </p>
<p>Enough motivation. Can this be done? Since Syst<br />emC is really C++, and it supports multiple inheritance, is there a way to just create a class that inherits from both your SystemC component as well vmm_xactor? </p>
<p>Here is an example.. </p>
<p>Originally, suppose you had a consumer bfm defined(keeping the example simple for illustration purposes). </p>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span>SC_MODULE(consumer) {</pre>
<pre><span class="lnum">   2:  </span>  sc_out&lt;sc_logic&gt;   reset;</pre>
<pre><span class="lnum">   3:  </span>  sc_out&lt;sc_lv&lt;32&gt; &gt; sample;</pre>
<pre><span class="lnum">   4:  </span>  </pre>
<pre><span class="lnum">   5:  </span>  sc_in_clk    clk;</pre>
<pre><span class="lnum">   6:  </span>    SC_CTOR(consumer_wrapper):    clk(<span class="str">"clk"</span>),    reset(<span class="str">"reset"</span>),   sample(<span class="str">"sample"</span>) {</pre>
<pre><span class="lnum">   7:  </span>  }</pre>
<pre><span class="lnum">   8:  </span>  </pre>
<pre><span class="lnum">   9:  </span>  . . .  </pre>
<pre><span class="lnum">  10:  </span>};</pre>
</div>
<p><strong>Solution Attempt 1) </strong>The first thing to try would be to simply create a new class called consumer_vmm as follows and define the required vmm_xactor methods. </p>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span><span class="kwrd">class</span> consumer_vmm : <span class="kwrd">public</span> consumer, <span class="kwrd">public</span> vmm_xactor </pre>
<pre><span class="lnum">   2:  </span>{</pre>
<pre><span class="lnum">   3:  </span>  consumer(vmm_object* parent, sc_module_name _nm) </pre>
<pre><span class="lnum">   4:  </span>         : vmm_xactor(_nm,<span class="str">"consumer"</span>,0,parent)</pre>
<pre><span class="lnum">   5:  </span>            ,reset(<span class="str">"reset"</span>) </pre>
<pre><span class="lnum">   6:  </span>            ,sample(<span class="str">"sample"</span>) </pre>
<pre><span class="lnum">   7:  </span>            ,clk(<span class="str">"clk"</span>)   </pre>
<pre><span class="lnum">   8:  </span>     {   </pre>
<pre><span class="lnum">   9:  </span>         SC_METHOD(entry);</pre>
<pre><span class="lnum">  10:  </span>         sensitive &lt;&lt; clk.pos();</pre>
<pre><span class="lnum">  11:  </span>        . . .</pre>
<pre><span class="lnum">  13:  </span>      </pre>
<pre><span class="lnum">  14:  </span>     }</pre>
<pre><span class="lnum">  15:  </span>    . . . define the remaining vmm_xactor methods as needed . . .</pre>
<pre><span class="lnum">  16:  </span>};</pre>
<pre><font face="Arial">Unfortunately, this does not work. Reason? As it turns out, vmm_xactor also inherits from sc_module.So consumer_vmm will end up inheriting same sc_module through two separate classes, the consumer and the vmm_xactor. This is known as the Diamond Problem.  Check out for some fun reading </font></pre>
<pre><font face="Arial">at </font><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9EaWFtb25kX3Byb2JsZW0="><font face="Arial">http://en.wikipedia.org/wiki/Diamond_problem</font></a><font face="Arial">. </font></pre>
<pre>&nbsp;</pre>
<pre><font face="Arial">Okay, so what can be done? Well, luckily, we can get all of this to work reasonably well with some additional tweaks/steps. Yes, you will need to very slightly modify the original source code, but in a backward compatible way. </font></pre>
<pre><font face="Arial">&nbsp;</font></pre>
<p><font face="Arial"><strong>Solution Attempt 2)</strong> Make the original consumer class&nbsp; derive from vmm_xactor instead of sc_module. This is the only change to existing code, and this will be backward compatible since vmm_xactor inherits from sc_module as well. Of course, add any further vmm_xactor:: derived methods using the old api as needed. </font></p>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span><span class="kwrd">class</span> consumer: <span class="kwrd">public</span> vmm_xactor</pre>
<pre><span class="lnum">   2:  </span>{</pre>
<pre><span class="lnum">   3:  </span> <span class="kwrd">public</span>:</pre>
<pre><span class="lnum">   4:  </span>  sc_out&lt;sc_logic&gt;   reset;</pre>
<pre><span class="lnum">   5:  </span>  sc_out&lt;sc_lv&lt;32&gt; &gt; sample;</pre>
<pre><span class="lnum">   6:  </span>  sc_in_clk    clk;</pre>
<pre><span class="lnum">   7:  </span>  . . . </pre>
<pre><span class="lnum">   8:  </span>}</pre>
<pre>&nbsp;</pre>
<pre>&nbsp;</pre>
</div>
<pre><font face="Arial"><strong>Solution)</strong> Here are all the steps. It looks like quite a few steps, but other than creating the </font></pre>
<pre><font face="Arial">wrappers and hooking them, the rest of the steps remain the same regardless of whether you use </font></pre>
<pre><font face="Arial">the sc_module or the vmm_xactor. </font></pre>
<p><font face="Arial">Step 1. Make the original consumer class&nbsp; derive from vmm_xactor instead of sc_module. This is the only change to existing code, and this will be backward compatible since vmm_xactor inherits from sc_module as well. Of course, add any further vmm_xactor:: derived methods using the old api as needed. </font></p>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span><span class="kwrd">class</span> consumer: <span class="kwrd">public</span> vmm_xactor</pre>
<pre><span class="lnum">   2:  </span>{</pre>
<pre><span class="lnum">   3:  </span> <span class="kwrd">public</span>:</pre>
<pre><span class="lnum">   4:  </span>  sc_out&lt;sc_logic&gt;   reset;</pre>
<pre><span class="lnum">   5:  </span>  sc_out&lt;sc_lv&lt;32&gt; &gt; sample;</pre>
<pre><span class="lnum">   6:  </span>  sc_in_clk    clk;</pre>
<pre><span class="lnum">   7:  </span>  . . . </pre>
<pre><span class="lnum">   8:  </span>}</pre>
</div>
<p><font face="Arial">step 2. define sc_module(consumer_wrapper) declare class that has the same set of pins as needed by consumer. </font></p>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span>sc_module(consumer_wrapper) {</pre>
<pre><span class="lnum">   2:  </span>  sc_out&lt;sc_logic&gt;   reset;</pre>
<pre><span class="lnum">   3:  </span>  sc_out&lt;sc_lv&lt;32&gt; &gt; sample;</pre>
<pre><span class="lnum">   4:  </span>  sc_in_clk    clk;</pre>
<pre><span class="lnum">   5:  </span>  </pre>
<pre><span class="lnum">   6:  </span>  sc_ctor(consumer_wrapper):    clk(<span class="str">"clk"</span>),    reset(<span class="str">"reset"</span>),   sample(<span class="str">"sample"</span>) {</pre>
<pre><span class="lnum">   7:  </span>  }</pre>
<pre><span class="lnum">   8:  </span>    </pre>
<pre><span class="lnum">   9:  </span>};</pre>
<pre>&nbsp;</pre>
<pre>step 3. declare pointers to instances(not instances)&nbsp; to these wrappers in env class</pre>
</div>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span><span class="kwrd">class</span> env: <span class="kwrd">public</span> vmm_group</pre>
<pre><span class="lnum">   2:  </span>{</pre>
<pre><span class="lnum">   3:  </span><span class="kwrd">public</span>:</pre>
<pre><span class="lnum">   4:  </span>   consumer *consumer_inst0;</pre>
<pre><span class="lnum">   5:  </span>   consumer *consumer_inst1;</pre>
<pre><span class="lnum">   6:  </span>   consumer_wrapper *wrapper0, *wrapper1;</pre>
<pre><span class="lnum">   7:  </span> . . .</pre>
<pre><span class="lnum">   8:  </span>}</pre>
</div>
<p>step 4. in the connect_ph phase, connect the pins of consumer instances and the corresponding wrappers instances</p>
<div class="csharpcode">
<div class="csharpcode">
<pre><span class="lnum">   1:  </span><span class="kwrd">virtual</span> <span class="kwrd">void</span> env::connect_ph() {</pre>
<pre><span class="lnum">   2:  </span>    consumer_inst0-&gt;reset(wrapper0-&gt;reset);</pre>
<pre><span class="lnum">   3:  </span>    consumer_inst0-&gt;clk(wrapper0-&gt;clk);</pre>
<pre><span class="lnum">   4:  </span>    consumer_inst0-&gt;sample(wrapper0-&gt;sample);</pre>
<pre><span class="lnum">   5:  </span>&nbsp;</pre>
<pre><span class="lnum">   6:  </span>    consumer_inst1-&gt;reset(wrapper1-&gt;reset);</pre>
<pre><span class="lnum">   7:  </span>    consumer_inst1-&gt;clk(wrapper1-&gt;clk);</pre>
<pre><span class="lnum">   8:  </span>    consumer_inst1-&gt;sample(wrapper1-&gt;sample);</pre>
<pre><span class="lnum">   9:  </span>}</pre>
<pre><span class="lnum">  10:  </span>   </pre>
</div>
</div>
<p>Step 5. In the constructor for sc_top, after the&nbsp; vmmm_env instance is created, make sure the pointers in the env point to the these wrappers</p>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span><span class="kwrd">class</span> sc_top : <span class="kwrd">public</span> sc_module</pre>
<pre><span class="lnum">   2:  </span>{</pre>
<pre><span class="lnum">   3:  </span><span class="kwrd">public</span>: </pre>
<pre><span class="lnum">   4:  </span>  </pre>
<pre><span class="lnum">   5:  </span>  vmm_timeline*  t1;</pre>
<pre><span class="lnum">   6:  </span>  env*           e1;</pre>
<pre><span class="lnum">   7:  </span>&nbsp;</pre>
<pre><span class="lnum">   8:  </span>  sc_out&lt;sc_logic&gt;   reset0;</pre>
<pre><span class="lnum">   9:  </span>  sc_out&lt;sc_lv&lt;32&gt; &gt; sample0;</pre>
<pre><span class="lnum">  10:  </span>  sc_in_clk    clk;</pre>
<pre><span class="lnum">  11:  </span>&nbsp;</pre>
<pre><span class="lnum">  12:  </span>  sc_out&lt;sc_logic&gt;   reset1;</pre>
<pre><span class="lnum">  13:  </span>  sc_out&lt;sc_lv&lt;32&gt; &gt; sample1;</pre>
<pre><span class="lnum">  14:  </span>    </pre>
<pre><span class="lnum">  15:  </span>  consumer_wrapper wrapper0;</pre>
<pre><span class="lnum">  16:  </span>  consumer_wrapper wrapper1;</pre>
<pre><span class="lnum">  17:  </span>&nbsp;</pre>
<pre><span class="lnum">  18:  </span>  SC_CTOR(sc_top):</pre>
<pre><span class="lnum">  19:  </span>    wrapper0(<span class="str">"wrapper0"</span>)</pre>
<pre><span class="lnum">  20:  </span>    ,wrapper1(<span class="str">"wrapper1"</span>)</pre>
<pre><span class="lnum">  21:  </span>    ,reset0(<span class="str">"reset0"</span>)</pre>
<pre><span class="lnum">  22:  </span>    ,sample0(<span class="str">"sample0"</span>)</pre>
<pre><span class="lnum">  23:  </span>    ,reset1(<span class="str">"reset1"</span>)</pre>
<pre><span class="lnum">  24:  </span>    ,sample1(<span class="str">"sample1"</span>)</pre>
<pre><span class="lnum">  25:  </span>    ,clk(<span class="str">"clk"</span>)</pre>
<pre><span class="lnum">  26:  </span>   {</pre>
<pre><span class="lnum">  27:  </span>      t1 = <span class="kwrd">new</span> vmm_timeline(<span class="str">"timeline"</span>,<span class="str">"t1"</span>);</pre>
<pre><span class="lnum">  28:  </span>      e1 = <span class="kwrd">new</span> env(<span class="str">"env"</span>,<span class="str">"e1"</span>,t1);</pre>
<pre><span class="lnum">  29:  </span>&nbsp;</pre>
<pre><span class="lnum">  30:  </span>      e1-&gt;wrapper0 = &amp;wrapper0;</pre>
<pre><span class="lnum">  31:  </span>      e1-&gt;wrapper1 = &amp;wrapper1;</pre>
<pre><span class="lnum">  32:  </span>&nbsp;</pre>
<pre><span class="lnum">  33:  </span>      vmm_simulation::run_tests();</pre>
<pre><span class="lnum">  34:  </span>&nbsp;</pre>
<pre><span class="lnum">  35:  </span>      wrapper0.clk(clk);</pre>
<pre><span class="lnum">  36:  </span>      wrapper0.reset(reset0);</pre>
<pre><span class="lnum">  37:  </span>      wrapper0.sample(sample0);</pre>
<pre><span class="lnum">  38:  </span>&nbsp;</pre>
<pre><span class="lnum">  39:  </span>      wrapper1.clk(clk);</pre>
<pre><span class="lnum">  40:  </span>      wrapper1.reset(reset1);</pre>
<pre><span class="lnum">  41:  </span>      wrapper1.sample(sample1);</pre>
<pre><span class="lnum">  42:  </span>&nbsp;</pre>
<pre><span class="lnum">  43:  </span>   }</pre>
<pre><span class="lnum">  44:  </span>&nbsp;</pre>
<pre><span class="lnum">  45:  </span>};</pre>
<pre><span class="lnum"></span></pre>
</div>
<pre>&nbsp;</pre>
<pre>&nbsp;</pre>
<pre><font face="Arial">So while it looks like a few more than we had hoped, you do it only once, and mechanically. Small price to pay for reuse. Maybe someone can create a simple script. </font></pre>
<pre><font face="Arial">

&nbsp;</pre>
<p></font>
<pre><font face="Arial">Also, contact me if you want the complete example. The example also shows how you can add tlm ports as well.</font></pre>
<pre>&nbsp;</pre>
<p><span style="font-family: verdana;font-size: 9pt"><font size="1">This article is the 10<sup>th</sup> in the </font><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvP3A9NDgx"><span style="color: #669966;text-decoration: underline"><em><font size="1">Verification in the trenches</font></em></span></a><font size="1"><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 </font><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Jlc291cmNld29ya3MucGFyYWRpZ20td29ya3MuY29tL3N2ZnRnL3ZtbQ=="><span style="color: #669966;text-decoration: underline"><em><font size="1">http://resourceworks.paradigm-works.com/svftg/vmm</font></em></span></a><font size="1"><em> . </em><br /></font></span></p>
<pre><font face="Arial">&nbsp;</font></pre>
<div style="padding-bottom: 0px;margin: 0px;padding-left: 0px;padding-right: 0px;float: none;padding-top: 0px" class="wlWriterEditableSmartContent">
<div style="padding-bottom: 0px;margin: 0px;padding-left: 0px;padding-right: 0px;float: none;padding-top: 0px" class="wlWriterSmartContent"></div>
 <img src="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?view=1&post_id=2086" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vmmcentral.org/vmartialarts/2011/01/verification-in-the-trenches-transform-your-sc_module-into-a-vmm_xactor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Verification in the trenches: A SystemC implementation of VMM1.2</title>
		<link>http://www.vmmcentral.org/vmartialarts/2010/12/verification-in-the-trenches-a-systemc-implementation-of-vmm1-2/</link>
		<comments>http://www.vmmcentral.org/vmartialarts/2010/12/verification-in-the-trenches-a-systemc-implementation-of-vmm1-2/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 16:00:00 +0000</pubDate>
		<dc:creator>Ambar Sarkar</dc:creator>
				<category><![CDATA[SystemC/C/C++]]></category>
		<category><![CDATA[Transaction Level Modeling (TLM)]]></category>
		<category><![CDATA[VMM 1.2]]></category>

		<guid isPermaLink="false">http://www.vmmcentral.org/vmartialarts/?p=2085</guid>
		<description><![CDATA[Dr. Ambar Sarkar, Chief Verification Technologist, Paradigm Works Inc. VMM1.2 class library is now also implemented in SystemC(VMM-SC). Will it help your project? Please take a few minutes to consider this, especially if you have been using or thinking about C/C++/SystemC models in your environment. Following are the some use cases that I have come [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: verdana; font-size: 10pt;">Dr. Ambar Sarkar, Chief Verification Technologist, Paradigm Works Inc.<br />
</span></p>
<p><span style="font-family: Verdana;"><img style="margin: 5px;" src="http://www.vmmcentral.org/vmartialarts/wp-content/uploads/2010/06/062810_1233_Verificatio1.jpg" alt="" width="131" height="98" align="left" /></span></p>
<p><span style="font-size: medium; font-family: Verdana;">VMM1.2 class library is now also implemented in SystemC(<em>VMM-SC</em>). </span></p>
<p><span style="font-size: medium; font-family: Verdana;"><strong><em>Will it help your project?</em></strong> </span><span style="font-family: Verdana;">Please take a few minutes to consider this, especially if you have been using or thinking about C/C++/SystemC models in your environment. </span></p>
<p><span style="font-family: Verdana;">Following are the some use cases that I have come across or can anticipate among our clients. With each use case, I have put down some thoughts on why VMM-SC may(or may not) be of any benefit. Do you agree?</span></p>
<h4><span style="font-family: Verdana;">Use Case 1. Using SystemC as the primary verification language for unit level verification </span></h4>
<p><span style="font-family: Verdana;">Many teams today use SystemC as their primary verification language for all unit and system-level tests. However, with the increasing popularity of SystemVerilog, they often adopt a hybrid model. They do use C++/SystemC as the primary language for testbench creation, but complement it using SystemVerilog language features for assertions, functional coverage analysis, and constrained random generation. </span></p>
<p><span style="font-family: Verdana;">Such teams often consider moving to SystemVerilog based environments, but are concerned about the reuse of their existing code, and cannot justify the ROI against the resources needed to make the transition to SystemVerilog completely. Ideally, they would like to have a multi-language solution that can mix and match SystemVerilog and SystemC components. </span></p>
<p><span style="font-family: Verdana;">For this class of users, VMM-SystemC can ease their adoption of a multi-language solution. First, they can create newer environments in VMM-SC, and encapsulate preexisting VIP within VMM-SC components using thin wrappers. Once transitioned to VMM-SC, they can easily interoperate with other VMM-SV based environments and components. As an added benefit of the SystemVerilog-SystemC interoperability, the VMM-SV applications such as RAL/Scoreboarding etc. can now be made available to the SystemC side.</span></p>
<h4><span style="font-family: Verdana;">Use Case 2. Using SystemC as the primary verification language for system-level verification</span></h4>
<p><span style="font-family: Verdana;">Some teams decide to write their system level verification environments primarily in C/C++, as it is often used by the SW team or in the lab. Depending on the sophistication of these teams, these environments may range from being simple directed C testbenches to those that are highly sophisticated and use SystemC. Adopting VMM-SC as the system-level methodology can make it easier to cleanly pull in various environments and components by encapsulating them as VMM objects and making them work together taking advantage of VMM-SC support for phasing, TLM ports etc. </span></p>
<p><span style="font-family: Verdana;">For this class of users, adopting VMM-SC as the top-level glue environment will be a big win. </span></p>
<h4><span style="font-family: Verdana;">Use Case 3. Planning to move to SystemVerilog and adopt industry standard practices. </span></h4>
<p><span style="font-family: Verdana;">Often, teams are willing to start from scratch for new projects as they realize their existing environments have become outdated and simply cannot scale. With the maturity of SystemVerilog, they would likely adopt it as the primary HVL language of choice. However, they would still like to preserve a number of previously developed components.</span></p>
<p><span style="font-family: Verdana;">This is an ideal application for using VMM-SC. Pre-existing transactors can be converted to VMM-SC components by deriving them from vmm_xactor/vmm_unit classes(see 4.3 below). The new environment can now be written in VMM-SV, which can pull in the legacy components using VMM-SC/SV interoperability solution. All VMM features, such as cross language option setting, communicating transactions in a language agnostic way between source and target components using TLM, coordinated phasing etc. make the SystemVerilog adoption process much easier.</span></p>
<h4><span style="font-family: Verdana;">Use Case 4.  Using SystemC to develop ESL environments and reference models.</span></h4>
<p><span style="font-family: Verdana;">There are users who are primarily interested in creating models at various levels of abstraction. These models can be used in multiple applications, such as performance modeling and architectural exploration. In some cases, such models may not be of sufficient detail to use in functional verification. </span></p>
<p><span style="font-family: Verdana;">At the minimum, such models should be created using TLM2.0 ports to enable easy plug and play in ESL contexts. Adopting VMM-SC as the primary methodology for developing such components can be of benefit, since it offers a rich set of features that can help in controlling and coordinating the components, while maintaining strong interoperability with verification environments.</span></p>
<p><span style="font-family: Verdana;"> </span></p>
<p><span style="font-family: Verdana;">So, to which one of these use cases do you belong? Any other use case that I missed?</span></p>
<p><span style="font-family: verdana; font-size: 9pt;"><span style="font-size: xx-small;">This article is the 9<sup>th</sup> in the </span><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvP3A9NDgx"><span style="color: #669966; text-decoration: underline;"><em><span style="font-size: xx-small;">Verification in the trenches</span></em></span></a><span style="font-size: xx-small;"><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 </span><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Jlc291cmNld29ya3MucGFyYWRpZ20td29ya3MuY29tL3N2ZnRnL3ZtbQ=="><span style="color: #669966; text-decoration: underline;"><em><span style="font-size: xx-small;">http://resourceworks.paradigm-works.com/svftg/vmm</span></em></span></a><span style="font-size: xx-small;"><em> . </em><br />
</span></span></p>
 <img src="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?view=1&post_id=2085" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vmmcentral.org/vmartialarts/2010/12/verification-in-the-trenches-a-systemc-implementation-of-vmm1-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>You can also “C” with RAL.</title>
		<link>http://www.vmmcentral.org/vmartialarts/2010/11/you-can-also-%e2%80%9cc%e2%80%9d-with-ral-3/</link>
		<comments>http://www.vmmcentral.org/vmartialarts/2010/11/you-can-also-%e2%80%9cc%e2%80%9d-with-ral-3/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 10:35:40 +0000</pubDate>
		<dc:creator>S. Varun</dc:creator>
				<category><![CDATA[Register Abstraction Model with RAL]]></category>
		<category><![CDATA[SystemC/C/C++]]></category>
		<category><![CDATA[SystemVerilog]]></category>
		<category><![CDATA[VMM]]></category>

		<guid isPermaLink="false">http://www.vmmcentral.org/vmartialarts/?p=2058</guid>
		<description><![CDATA[The RAL C interface provides a convenient way for verification engineers to develop firmware code which can be debugged on a RTL simulation of the design. This interface provides a rich set of C API&#8217;s using which one can access fields, registers and memories included within the RAL model. The developed firmware code can be [...]]]></description>
			<content:encoded><![CDATA[<p>The RAL C interface provides a convenient way for verification engineers to develop firmware code which can be debugged on a RTL simulation of the design. This interface provides a rich set of C API&#8217;s using which one can access fields, registers and memories included within the RAL model. The developed firmware code can be used to interface with the RAL model running on a SystemVerilog simulator using DPI (Direct Programming Interface) and can also be re-used as application-level code to be compiled on the target processor in the final application as illustrated in the figure below.</p>
<p><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvd3AtY29udGVudC91cGxvYWRzLzIwMTAvMTEvaW1hZ2UyLnBuZw=="><img style="float: none; margin-left: auto; margin-right: auto; border: 0px;" src="http://www.vmmcentral.org/vmartialarts/wp-content/uploads/2010/11/image_thumb2.png" border="0" alt="image" width="592" height="372" /></a></p>
<p>The “-gen_c” option available with “ralgen“ has to be used for this and that would cause the generator to generate the necessary files containing the API’s to interface to the C domain. The generated API’s can be used in one of two forms.</p>
<p>1. To interface to the System Verilog RAL model running on a System Verilog simulator using DPI and</p>
<p>2. As a pure standalone-C code designed to compile on the target processor.</p>
<p>Typically firmware runs a set of pre-defined sequences of writes/reads to the registers on a device performing functions for boot-up, servicing interrupts etc. You generally have these functions coded in C, and these would need to access the registers in the DUT. Using the RAL C model, these functions can be generated so that the firmware can now perform the register access through the SystemVerilog RAL model. Thus, this allows firmware and application-level code to be developed and debugged on a simulation of the design and the same functions can later be used as part of the device drivers to perform the same tasks on the hardware.</p>
<p>In the first scenario, when executing the C code within a simulation, it is necessary for the C code to be called by the simulation to be executed and hence the application software’s main() routine must be replaced by one or more entry points known to the simulation. All entry points must take at least one argument that will receive the base address of the RAL model to be used by the C code. The C-side reference is then used by the RAL C API to access required fields, registers or memories.</p>
<p><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvd3AtY29udGVudC91cGxvYWRzLzIwMTAvMTEvaW1hZ2UzLnBuZw=="><img style="float: none; margin-left: auto; margin-right: auto; border: 0px;" src="http://www.vmmcentral.org/vmartialarts/wp-content/uploads/2010/11/image_thumb3.png" border="0" alt="image" width="356" height="371" /></a></p>
<p>Consider a sequence of register accesses performed at the boot time of a router as defined in function system_bootup() shown below,</p>
<p>File : router_test.c</p>
<p><em>#ifdef VMM_RAL_PURE_C_MODEL </em></p>
<p><em>/*<strong>when used as a pure C model for the target processor</strong> */</em></p>
<p><em>int main() {</em></p>
<p><em>void *blk = calloc(410024,1);</em></p>
<p><em>system_bootup((void *) (((size_t)blk)&gt;&gt;2)+1);</em></p>
<p><em>}</em></p>
<p><em>#endif</em></p>
<p><em>void system_bootup (unsigned int blk){</em></p>
<p><em>unsigned int dev_id = 0xABCD; </em></p>
<p><em>unsigned int ver_num = 0&#215;1234;</em></p>
<p><em>/* <strong>Invoking the generated RAL C APIs */</strong></em></p>
<p><em>ral_write_DEV_ID_in_ROUTER_BLK(blk, &amp;dev_id); </em></p>
<p><em>ral_write_VER_NUM_in_ROUTER_BLK(blk, &amp;ver_num);</em></p>
<p><em>}</em></p>
<p>In the above example “ral_write_DEV_ID_in_ROUTER_BLK()” &amp; “ral_write_VER_NUM_in_ROUTER_BLK()” are C API’s generated by “ralgen” to access registers named “DEV_ID” &amp; “VER_NUM” located in a block named “ROUTER_BLK”. In general registers can be accessed using “ral_read_&lt;reg&gt;_in_&lt;blk&gt;” &amp; “ral_write_&lt;reg&gt;_in_&lt;blk&gt;” macros present within the RAL-C interface.</p>
<p>The above C function can also be called from within a System Verilog testbench via DPI</p>
<p>File : ral_boot_seq_test.sv</p>
<p><em>import &#8220;DPI-C&#8221; context task system_bootup(int unsigned ral_model_ID);</em></p>
<p><em>program boot_seq_test();</em></p>
<p><em>initial</em></p>
<p><em>begin</em></p>
<p><em>router_blk_env env = new();</em></p>
<p><em>// Configuring the DUT</em></p>
<p><em>env.cfg_dut();</em></p>
<p><em>// Calling the C function using DPI</em></p>
<p><em>system_bootup(env.ral_model.get_block_ID()); // ‘ral_model ‘is the instance of the generated SV model in the env class</em></p>
<p><em>… </em></p>
<p><em>end</em></p>
<p><em>endprogram</em></p>
<p>In the example above, <em>system_bootup </em>is the service entry point which is called from the SV simulation and is passed the RAL Model reference. The ‘<em>C’ </em>code that is executed and simulation freezes till one of the registers accesses is made which then shifts the execution to the SV side.</p>
<p><a href="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy52bW1jZW50cmFsLm9yZy92bWFydGlhbGFydHMvd3AtY29udGVudC91cGxvYWRzLzIwMTAvMTEvaW1hZ2U1LnBuZw=="><img style="float: none; margin-left: auto; margin-right: auto; border: 0px;" src="http://www.vmmcentral.org/vmartialarts/wp-content/uploads/2010/11/image_thumb4.png" border="0" alt="image" width="464" height="91" /></a></p>
<p>The entire execution in ‘C’ is in ‘0’ time in the simulation timeline. The RAL C API hides the physical addresses of registers and the position and size of fields. The hiding is performed by functions and macros rather than an object-oriented structure like the native RAL model in SystemVerilog. This eliminates the need to compile a complete object-oriented model in an embedded processor object code with a limited amount of memory</p>
<p>Thus by using the RAL C interface one can develop a compact and efficient firmware code, while preserving as much as possible of the abstraction offered by RAL. I hope this was useful and do let me know your thoughts on the same if you plan to use this flow to meet some of your requirements of having your firmware and application-level code to be developed and debugged on a simulation of the design.</p>
<p>Please refer to the RAL userguide for more information. You can also refer to the example present within VCS installation located at $VCS_HOME/doc/examples/vmm/applications/vmm_ral/C_api_ex.</p>
 <img src="http://www.vmmcentral.org/vmartialarts/wp-content/plugins/feed-statistics.php?view=1&post_id=2058" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vmmcentral.org/vmartialarts/2010/11/you-can-also-%e2%80%9cc%e2%80%9d-with-ral-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

