<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.2" -->
<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/"
	>

<channel>
	<title>THE VLSI HOMEPAGE</title>
	<link>http://vlsihomepage.com</link>
	<description>A Practical guide to VLSI Design and Verification..</description>
	<pubDate>Tue, 22 Apr 2008 06:30:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>
	<language>en</language>
			<item>
		<title>ECOs in Design</title>
		<link>http://vlsihomepage.com/2008/04/22/ecos-in-design/</link>
		<comments>http://vlsihomepage.com/2008/04/22/ecos-in-design/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 06:30:12 +0000</pubDate>
		<dc:creator>Nigam</dc:creator>
		
		<category><![CDATA[Digital Design]]></category>

		<guid isPermaLink="false">http://vlsihomepage.com/2008/04/22/ecos-in-design/</guid>
		<description><![CDATA[I stumbled upon Steve Golson&#8217;s very informative and elaborate paper on ECOs (Engineering Change Order) in design. I am adding this paper to the recommended reading section, please do check it out.
Share This
]]></description>
			<content:encoded><![CDATA[<p style="float: left;margin: 4px;"><script type="text/javascript"><!--
google_ad_client = "pub-8460874768052118";
google_ad_width = 120;
google_ad_height = 90;
google_ad_format = "120x90_0ads_al";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "7DA921";
google_color_text = "000000";
google_color_url = "008000";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p> <p>I stumbled upon Steve Golson&#8217;s very informative and elaborate paper on ECOs (Engineering Change Order) in design. I am adding this paper to the recommended reading section, please do check it <a href="http://www.trilobyte.com/pdf/golson_snug04.pdf" title="Human ECO Compiler"><strong>out</strong></a>.</p>
<p class="akst_link"><a href="http://vlsihomepage.com/?p=114&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_114" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://vlsihomepage.com/2008/04/22/ecos-in-design/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Primetime Reports Generation</title>
		<link>http://vlsihomepage.com/2007/12/08/primetime-reports-generation/</link>
		<comments>http://vlsihomepage.com/2007/12/08/primetime-reports-generation/#comments</comments>
		<pubDate>Sat, 08 Dec 2007 13:23:45 +0000</pubDate>
		<dc:creator>Nigam</dc:creator>
		
		<category><![CDATA[Static Timing Analysis]]></category>
<category>Static Timing Analysis</category>
		<guid isPermaLink="false">http://vlsihomepage.com/2007/12/08/primetime-reports-generation/</guid>
		<description><![CDATA[


 Primetime offers several constructs to report design statistics  such as clocks,  max fanout, transition and capacitance, constraint checks and timing. This post will cover constructs that are used often to extract useful information from Primetime for design analysis.
Design Information

  report_design  provides a summary on operating conditions, derating factors, wire load [...]]]></description>
			<content:encoded><![CDATA[<p>Primetime offers several constructs to report design statistics  such as clocks,  max fanout, transition and capacitance, constraint checks and timing. This post will cover constructs that are used often to extract useful information from Primetime for design analysis.</p>
<h2>Design Information</h2>
<ul>
<li>  <font color="#008080"><strong>report_design </strong></font> provides a summary on operating conditions, derating factors, wire load models, and design rules like maximum capacitance, transition and fanout.</li>
</ul>
<ul>
<li><font color="#008080"><strong>report_clock </strong> </font>provides a summary of all clocks in the design including generated clocks with their sources and their attributes   (propagated or ideal clocks).</li>
</ul>
<ul>
<li><font color="#008080"><strong>report_disable_timing</strong></font> provides a summary of all the timing arcs that are disabled in the design.</li>
</ul>
<ul>
<li><font color="#008080"><strong>report_case_analysis</strong></font> reports all the nets or pins that are constrained to appropriate values for proper propagation.</li>
</ul>
<h2>Constraint Checking</h2>
<ul>
<li><font color="#008080"><strong>check_timing</strong> <strong>-verbose</strong> </font>  is a powerful construct in Primetime and is recommended to run on all designs to check the constraints. Primetime can report unconstrained clocks in the design, combinational timing loops, inputs or outputs that are not constrained, multiple clocks clocking the same flop or flops that do not have a clock defined on them.  This aids the designer to identify incorrect or undefined constraints earlier in the cycle.</li>
</ul>
<ul>
<li><font color="#008080"><strong>report_constraint </strong></font>generates a summary of all the constraint violations including setup/hold and the amount by which the design violates the constraint. Usage and offers available in this construct are</li>
</ul>
<p align="center"><font color="#008080"><strong>report_constraint -all_violators -verbose</strong></font></p>
<p align="left">By default, <font color="#008080"><strong>report_constraint</strong> </font>generates all the violations in the design and the reports can be segregated by using appropriate switches. For example, to report only max fanout violations, a <font color="#008080"><strong>-max_fanout</strong></font> switch can be added.</p>
<p align="center"><font color="#008080"><strong>report_constraint -all_violators -verbose -max_fanout</strong><br />
<strong>report_constraint -all_violators -verbose -max_delay</strong><br />
<strong>report_constraint -all_violators -verbose -min_delay</strong><br />
<strong>report_constraint -all_violators -verbose -max_capacitance</strong><br />
<strong>report_constraint -all_violators -verbose -recovery</strong><br />
<strong>report_constraint -all_violators -verbose -removal</strong></font></p>
<h2>Timing Reports</h2>
<ul>
<li><font color="#008080"><strong>report_timing </strong></font>reports design timing information for each path group (or clock group) and offers several switches to segregate the timing results based on max delay, min delay, recovery, removal etc. The level of detail that can be viewed in the reports can also be customized. Simple syntax for this construct is</li>
</ul>
<p># To report timing from one clock group to another (max_delay, setup)<br />
<font color="#008080"><strong>report_timing -from [get_clocks clk1] -to [get_clocks clk2] -delay max</strong></font></p>
<p># To report flop to flop timing (min_delay timing, hold)<br />
<font color="#008080"><strong>report_timing -from [get_pins my_count_lden_reg/clk] -to  [get_pins  count_0_reg/lden] -delay min</strong></font></p>
<p># Detailed timing report that traces clocks at both launch and capture flops with all nets, input pins and a maximum of 1000 paths.<br />
<font color="#008080"><strong>report_timing -from [get_clocks clk] -to [get_clocks clk] -path full_clock_expanded -nets  \<br />
-input_pins -capacitance -transition -max_paths 1000 -nworst 100 -delay max </strong></font></p>
<p>Switches that are often used in report_timing include</p>
<p align="left"><font color="#008080"><strong>report_timing</strong></font>        # Report timing paths<br />
[<font color="#008080"><strong>-from</strong></font> from_list]      (From pins, ports, nets, or clocks)<br />
[<font color="#008080"><strong>-rise_from</strong></font> rise_from_list] (Rising from pins, ports, nets, or clocks)<br />
[<font color="#008080"><strong>-fall_from</strong></font> fall_from_list] (Falling from pins, ports, nets, or clocks)<br />
[<font color="#008080"><strong>-through</strong></font> through_list] (Through pins, ports, or nets)<br />
[<font color="#008080"><strong>-to</strong></font> to_list] (To pins, ports, nets, or clocks)<br />
[<font color="#008080"><strong>-rise_to</strong></font> rise_to_list] (Rising to pins, ports, nets, or clocks)<br />
[<font color="#008080"><strong>-fall_to</strong></font> fall_to_list] (Falling to pins, ports, nets, or clocks)<br />
[<font color="#008080"><strong>-delay_type</strong></font> delay_type] (Type of path delay:<br />
Values: max, min, min_max, max_rise, max_fall, min_rise, min_fall)<br />
[<font color="#008080"><strong>-nworst</strong></font> paths_per_endpoint] (List N worst paths to endpoint:Value &gt;= 1)<br />
[<font color="#008080"><strong>-max_paths </strong></font>count]     (Maximum number of paths per path group to output: Value &gt;= 1)<br />
[<font color="#008080"><strong>-path_type</strong></font> format]    (Format for path report:Values: full, full_clock, short, end, summary, full_clock_expanded)<br />
[<font color="#008080"><strong>-input_pins</strong></font>]          (Show input pins in path)<br />
[<font color="#008080"><strong>-nets</strong></font>]                (List net names)<br />
[<font color="#008080"><strong>-transition_time</strong></font>]     (Display transition time for each pin)<br />
[<font color="#008080"><strong>-capacitance</strong></font>]         (Display total capacitance for each net)<br />
[<font color="#008080"><strong>-slack_lesser_than</strong></font> slack_limit] (Display paths with slack less than this)<br />
[<font color="#008080"><strong>-slack_greater_than</strong></font> slack_limit] (Display paths with slack greater than this)</p>
<p align="left">Example timing reports can be found in <a href="http://vlsihomepage.com/wp-content/uploads/2007/09/ocvstinks_boston02_paper.pdf">Matt Weber&#8217;s paper on OCV</a> in the Recommended Reading section</p>
<p class="akst_link"><a href="http://vlsihomepage.com/?p=113&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_113" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://vlsihomepage.com/2007/12/08/primetime-reports-generation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Constraining clocks in Primetime</title>
		<link>http://vlsihomepage.com/2007/12/01/constraining-clocks-in-primetime/</link>
		<comments>http://vlsihomepage.com/2007/12/01/constraining-clocks-in-primetime/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 09:10:33 +0000</pubDate>
		<dc:creator>Nigam</dc:creator>
		
		<category><![CDATA[Static Timing Analysis]]></category>
<category>Static Timing Analysis</category>
		<guid isPermaLink="false">http://vlsihomepage.com/2007/12/01/constraining-clocks-in-primetime/</guid>
		<description><![CDATA[Synopsys Primetime supports several constructs to constrain clocks in a design. In this post, we will cover a few of the most commonly used commands and their usage while running STA on a design.
Clock definitions
All clock characteristics such as the period (default is ns), duty cycle and clock source can be specified using create_clock command. [...]]]></description>
			<content:encoded><![CDATA[<p>Synopsys Primetime supports several constructs to constrain clocks in a design. In this post, we will cover a few of the most commonly used commands and their usage while running STA on a design.</p>
<h2>Clock definitions</h2>
<p>All clock characteristics such as the period (default is ns), duty cycle and clock source can be specified using <font color="#008080"><strong>create_clock</strong></font> command. The syntax is as shown below</p>
<p align="center"><font color="#008080"><strong>create_clock -name &lt;clk_name&gt; -period &lt;clk_period&gt; -waveform \<br />
{rise_edge fall_edge} &lt;clock_source&gt;</strong></font></p>
<p>For example to create a clock running at 125 MHz with 50% duty cycle at a PLL output,</p>
<p align="center"><font color="#008080"><strong>create_clock -name clk -period 8.0 -waveform {0 4} [get_pins pll/clkout]</strong></font></p>
<p align="left">Internally generated clocks such as divide_by_2, (or multiply_by) can be specified using the <font color="#008080"><strong>create_generated_clock</strong></font> construct.</p>
<p align="center"><font color="#008080"><strong>create_generated_clock -name clk_div2 -source [get_pins pll/clkout] \<br />
-divide_by 2 [get_pins clk_divider_reg/q] </strong></font></p>
<p align="left">Note that we define the clock source using the -source switch at the pin instead of using the clock source name itself.</p>
<p align="left"> Sometimes it may be necessary to define divided down clocks using edges such as divide_by_3  clock without 50% duty cycle. Primetime offers &#8220;-edges&#8221; switch to line up the divided down clock edge with it&#8217;s source edge.</p>
<p align="center"> <font color="#008080">create_generated_clock -name clk_div2 -source [get_pins pll/clkout]<strong> -edges {0 16 24} </strong> \<br />
[get_pins clk_divider_reg/q]</font></p>
<p align="center">&nbsp;</p>
<p align="center">In addition, Primetime also allows definition of an inverted clock wrt the clock source using the <font color="#008080"><strong>-invert</strong></font> switch</p>
<p align="center"><font color="#008080">create_generated_clock -name clk_div2 -source [get_pins pll/clkout] \<br />
-divide_by 2 [get_pins clk_divider_reg/q] <strong>-invert</strong></font></p>
<p align="left">Primetime also offers the capability to define <strong>virtual clocks</strong> in the design. A virtual clock has no source and is helpful in constraining inputs and outputs where we use ideal clocks with no insertion delay.</p>
<p align="center"><font color="#008080"><strong>create_clock -name clk -period 8.0 -waveform {0 4}</strong></font></p>
<h2>Clock latency, uncertainty and propagated clocks</h2>
<p>A clock tree insertion delay can be specified using <strong>set_clock_latency</strong> command - this construct would be useful in timing a design during early stages of design where the clock tree is not yet inserted and all you have are estimates.</p>
<p align="center"><font color="#008080"><strong>set_clock_latency &lt;insertion_delay&gt;  &lt;-source&gt; &lt;-early or -late&gt; \<br />
-rise or -fall&gt; [get_clocks &lt;clk_name&gt;]</strong></font></p>
<p align="center"><font color="#008080"><strong>set_clock_latency 3.0 -source -early -rise [get_clocks clk_div2]</strong></font></p>
<p align="center"><font color="#008080"><strong> set_clock_latency 5.0 -source -late -rise [get_clocks clk_div2] </strong></font></p>
<p>Using the &#8220;-source&#8221; switch, one can specify the clock source latency at the clock pin (for example, in the divide_by_2 clock case, a source latency to the clk_divider_reg/clk flop<strong> </strong>can be specified<strong> </strong>from the pll output). The -early and -late switches are to account for uncertainty in the clock latency (primetime uses the conservative number for each startpoint/endpoint). In addition, we can specify separate source latencies for rise and fall edges.</p>
<p align="left"> Clock uncertainty accounts for clock jitter, marginal errors in backannotation and any skew between two clocks.</p>
<p align="center"><font color="#008080"><strong>set_clock_uncertainty -setup 0.2 [all_clocks]</strong></font></p>
<p align="center"><font color="#008080"><strong>set_clock_uncertainty -hold 0.1 [all_clocks]</strong></font></p>
<p align="center"><font color="#008080"><strong>set_clock_uncertainty 2.0 -from [get_clocks clka] -to [get_clocks clkb]</strong></font></p>
<p align="left">Finally, you can also make the clocks propagate through the clock tree and Primetime can calculate the insertion delay or create an ideal clock with clock latency while timing the design.</p>
<p align="center"><font color="#008080"><strong>set_propagated_clock [all_clocks]</strong></font></p>
<p align="center"><font color="#008080"><strong>set_ideal_clock [get_clocks clk]</strong></font></p>
<h2> Clock gating checks and exclusive groups</h2>
<p align="left"> For gated clocks, Primetime supports constraints for setup or hold violations on the gated clock to ensure that the clock is not clipped off. This ensures that the controlling signal remains stable much before or after the clock edge goes active.</p>
<p align="center"><font color="#008080"><strong>set_clock_gating_check  -setup 0.5 -hold 0.1 [get_clocks clk] </strong></font></p>
<p align="left">Apart from this,  when there is no interaction between two different clocks, they can be defined as exclusive to each other for faster timing analysis. For example, to declare that clk and clk2 are exclusive to clk3 or clk4,</p>
<p align="center"><font color="#008080"><strong>set_clock_groups -exclusive -group {clk clk2} -group {clk3 clk4} </strong></font></p>
<p class="akst_link"><a href="http://vlsihomepage.com/?p=112&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_112" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://vlsihomepage.com/2007/12/01/constraining-clocks-in-primetime/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Static Timing Analysis using Primetime</title>
		<link>http://vlsihomepage.com/2007/11/18/static-timing-analysis-using-primetime/</link>
		<comments>http://vlsihomepage.com/2007/11/18/static-timing-analysis-using-primetime/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 05:45:29 +0000</pubDate>
		<dc:creator>Nigam</dc:creator>
		
		<category><![CDATA[Static Timing Analysis]]></category>
<category>Static Timing Analysis</category>
		<guid isPermaLink="false">http://vlsihomepage.com/2007/11/18/static-timing-analysis-using-primetime/</guid>
		<description><![CDATA[Synopsys Primetime is widely used in static timing analysis of full chip gate level designs to close timing prior to tapeout.  A typical primetime flow with design inputs is shown below.
 
Static Timing Analysis Flow using Primetime
 Primetime is capable of analyzing multi-clock asynchronous/synchronous designs with internally generated clocks and timing exceptions. Multi-corner analysis [...]]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#660000">Synopsys Primetime</font></strong> is widely used in static timing analysis of full chip gate level designs to close timing prior to tapeout.  A typical primetime flow with design inputs is shown below.</p>
<p align="center"> <a href="http://vlsihomepage.com/wp-content/uploads/2007/11/pt_flow.gif" title="STA Flow using Primetime"><img src="http://vlsihomepage.com/wp-content/uploads/2007/11/pt_flow.thumbnail.gif" alt="STA Flow using Primetime" /></a></p>
<p align="center"><strong>Static Timing Analysis Flow using Primetime</strong></p>
<p align="left"> Primetime is capable of analyzing multi-clock asynchronous/synchronous designs with internally generated clocks and timing exceptions. Multi-corner analysis (fast, slow, bc/wc) and on-chip variation with signal integrity checks (crosstalk) is also supported in Primetime.  Primetime supports</p>
<ul>
<li>Maximum/minimum capacitance, fanout and transition checks</li>
<li> Setup/hold/recovery and removal checks</li>
<li> Reports clock insertion delays, skew, clock gating check violations and data checks</li>
</ul>
<p>Primetime inputs include</p>
<ul>
<li>Library database in standard .db format - the library elements include technology standard cell and IO library (65 nm/130 nm), hard macros like PLLs, SERDES and any custom cells. The libraries are characterized in slow and fast corners to run analysis in multiple corners.</li>
</ul>
<ul>
<li>Design constraints in SDC format - clock definitions, timing exceptions, case analysis and IO constraints. Usually, a design supports multiple modes where the clock can run at different frequencies depending on the mode. Case analysis constraints propagate the appropriate path for each mode, also DFT mode runs are also supported.</li>
</ul>
<ul>
<li>Timing models for blocks or analog blocks like PLL  to make run times faster and factor in timing characteristics. Timing models can be
<ul>
<li><strong><font color="#660000">Quick Timing Model</font></strong> - a preliminary timing model created using PT.</li>
<li><font color="#660000"><strong>ILM</strong> </font>(interface logic model which includes only the first stage of flops surrounding the IOs  and the guts of the block is all blackboxed),</li>
<li><font color="#660000"><strong>Extracted timing model</strong> </font> that includes only timing arcs between inputs and outputs</li>
<li><font color="#660000"><strong>Stamp model</strong> </font> that defines the timing in a standard descriptive format.</li>
</ul>
</li>
<li>Routed netlist from physical design in VHDL/<a href="http://www.amazon.com/exec/obidos/redirect?link_code=ur2&amp;camp=1789&amp;tag=thvlho-20&amp;creative=9325&amp;path=external-search%3Fsearch-type=ss%26keyword=Verilog%26index=blended"  class="alinks_links" onclick="return alinks_click(this);"  style="padding-right: 13px; background: url(http://vlsihomepage.com/wp-content/plugins/alinks/images/external.png) center right no-repeat;" title="Verilog" rel="external">Verilog</a><img class="amazon_image" src="http://www.assoc-amazon.com/e/ir?t=thvlho-20&amp;l=ur2&amp;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> or db format.</li>
</ul>
<ul>
<li>Parasitics - Interconnect Delay in <font color="#660000">SPEF/DSPF </font> format and cell delay in <font color="#660000">SDF </font> format.</li>
</ul>
<ul>
<li>Incremental delays in SDF format from crosstalk analysis</li>
</ul>
<p>Primetime breaks down the design into multiple timing paths with one startpoint (flop/input port) and one endpoint (flop/output port).  Setup/Hold checks and IO checks are covered in earlier posts, we will cover commonly used primetime commands in our next post.</p>
<p class="akst_link"><a href="http://vlsihomepage.com/?p=110&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_110" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://vlsihomepage.com/2007/11/18/static-timing-analysis-using-primetime/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Interfaces in SystemVerilog - 2</title>
		<link>http://vlsihomepage.com/2007/10/23/interfaces-in-systemverilog-2/</link>
		<comments>http://vlsihomepage.com/2007/10/23/interfaces-in-systemverilog-2/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 17:38:44 +0000</pubDate>
		<dc:creator>Nigam</dc:creator>
		
		<category><![CDATA[SystemVerilog]]></category>
<category>SystemVerilog</category>
		<guid isPermaLink="false">http://vlsihomepage.com/2007/10/23/interfaces-in-systemverilog-2/</guid>
		<description><![CDATA[SystemVerilog allows tasks and functions to be declared within interface definitions known as interface methods. The task or function has the same syntax as when declared in a module. Using these interface methods, the communication protocol details can be embedded within the interface definition itself.
PLAIN TEXT
SV:




interface ahb_bus &#40;input logic ahb_hclk, ahb_hresetn&#41;; // Interface can have [...]]]></description>
			<content:encoded><![CDATA[<p>SystemVerilog allows tasks and functions to be declared within interface definitions known as interface methods. The task or function has the same syntax as when declared in a module. Using these interface methods, the communication protocol details can be embedded within the interface definition itself.</p>
<div class="igBar"><span id="lsv-4"><a href="#" onclick="javascript:showPlainTxt('sv-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SV:</span>
<div id="sv-4">
<div class="sv">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #7DA921; font-weight: bold;">interface</span> ahb_bus <span style="color: #000000;">&#40;</span><span style="color: #0000ff;font-weight: bold;">input</span> <span style="color: #0000ff;font-weight: bold;">logic</span> ahb_hclk, ahb_hresetn<span style="color: #000000;">&#41;</span>; <span style="color: #ff0000;">// Interface can have ports.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">wire</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">31</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span>&nbsp; &nbsp; &nbsp;ahb_hdata;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">wire</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">31</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span>&nbsp; &nbsp; &nbsp;ahb_addr;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">logic</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ahb_hwrite;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">logic</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">1</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span>&nbsp; &nbsp; &nbsp; ahb_htrans;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">logic</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">2</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span>&nbsp; &nbsp; &nbsp; ahb_hsize;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">logic</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">2</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span>&nbsp; &nbsp; &nbsp; ahb_hburst;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">logic</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ahb_hready;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">logic</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">1</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span>&nbsp; &nbsp; &nbsp; ahb_hresp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff0000;">// Task defined internal to interface</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #7DA921; font-weight: bold;">task</span> slave_read <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;font-weight: bold;">input</span> <span style="color: #0000ff;font-weight: bold;">logic</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">31</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span> raddr<span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #ff0000;">// ...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #7DA921; font-weight: bold;">endtask</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #7DA921; font-weight: bold;">endinterface</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Interface methods can also be imported if  they are not defined within the interface definition itself. If an interface is connected using <strong><font color=#008080>modport</font></strong> construct, then the <strong><font color=#008080>import</font></strong> keyword is used to specify the method. Alternative way is to add the <strong><font color=#008080>task</font></strong> keyword next to the <strong><font color=#008080>import</font></strong> and also include function arguments - this is required if the task is exported from an external module. </p>
<div class="igBar"><span id="lsv-5"><a href="#" onclick="javascript:showPlainTxt('sv-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SV:</span>
<div id="sv-5">
<div class="sv">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #7DA921; font-weight: bold;">interface</span> ahb_bus <span style="color: #000000;">&#40;</span><span style="color: #0000ff;font-weight: bold;">input</span> <span style="color: #0000ff;font-weight: bold;">logic</span> ahb_hclk, ahb_hresetn<span style="color: #000000;">&#41;</span>; <span style="color: #ff0000;">// Interface can have ports.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">wire</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">31</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span>&nbsp; &nbsp; &nbsp;ahb_hdata;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">wire</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">31</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span>&nbsp; &nbsp; &nbsp;ahb_addr;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">logic</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ahb_hwrite;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">logic</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">1</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span>&nbsp; &nbsp; &nbsp; ahb_htrans;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">logic</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">2</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span>&nbsp; &nbsp; &nbsp; ahb_hsize;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">logic</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">2</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span>&nbsp; &nbsp; &nbsp; ahb_hburst;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">logic</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ahb_hready;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">logic</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">1</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span>&nbsp; &nbsp; &nbsp; ahb_hresp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #6C2DC7;font-weight: bold;">modport</span> slave <span style="color: #000000;">&#40;</span> <span style="color: #6C2DC7;font-weight: bold;">import</span> slave_read,&nbsp; &nbsp;<span style="color: #ff0000;">// simplest way of importing tasks</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;font-weight: bold;">inout</span> ahb_hdata,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;font-weight: bold;">input</span> ahb_haddr,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;font-weight: bold;">input</span> ahb_hsize,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;font-weight: bold;">output</span> ahb_hready,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ---</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff0000;">// Alternative explicit way</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #6C2DC7;font-weight: bold;">modport</span> slave <span style="color: #000000;">&#40;</span> <span style="color: #6C2DC7;font-weight: bold;">import</span> <span style="color: #7DA921; font-weight: bold;">task</span> slave_read <span style="color: #000000;">&#40;</span><span style="color: #0000ff;font-weight: bold;">input</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">31</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span> addr<span style="color: #000000;">&#41;</span>,&nbsp; &nbsp;<span style="color: #ff0000;">// explicit</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">inout</span> ahb_hdata,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">input</span> ahb_haddr,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">input</span> ahb_hsize,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">output</span> ahb_hready,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ---</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Importing a task or a function through a modport gives the module access to that task by prepending the interface port name to the task name as with other variables. The imported function/task must be declared as automatic in order to be synthesizable.</p>
<p>SV also includes a way to export a task defined in one module to be available to other modules through an interface. For example, if a function is defined in module A and is exported in the modport construct within interface definition using the <strong<font color=#008080>export</font></strong> keyword, then the task is available to module B that uses that modport. However, this is not synthesizable and we cannot export the same function from multiple instances of a module.</p>
<p>It is also possible to define a task or function using <strong><font color=#008080>extern</font></strong> keyword without associating it with the modport construct.</p>
<div class="igBar"><span id="lsv-6"><a href="#" onclick="javascript:showPlainTxt('sv-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SV:</span>
<div id="sv-6">
<div class="sv">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #7DA921; font-weight: bold;">interface</span> shb_bus <span style="color: #000000;">&#40;</span>....<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">---</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;font-weight: bold;">extern</span> check_parity <span style="color: #000000;">&#40;</span><span style="color: #0000ff;font-weight: bold;">input</span> <span style="color: #0000ff;font-weight: bold;">logic</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">31</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span> data<span style="color: #000000;">&#41;</span>; <span style="color: #ff0000;">// Not associated with modport</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #6C2DC7;font-weight: bold;">modport</span> ahb_slave <span style="color: #000000;">&#40;</span>...<span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #7DA921; font-weight: bold;">endinterface</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #7DA921; font-weight: bold;">module</span> A <span style="color: #000000;">&#40;</span>...<span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #7DA921; font-weight: bold;">task</span> check_parity <span style="color: #000000;">&#40;</span><span style="color: #0000ff;font-weight: bold;">input</span> <span style="color: #0000ff;font-weight: bold;">logic</span> <span style="color: #000000;">&#91;</span><span style="color: #0000dd;color:#800000;">31</span>:<span style="color: #0000dd;color:#800000;">0</span><span style="color: #000000;">&#93;</span> data<span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #ff0000;">// --</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #7DA921; font-weight: bold;">endtask</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #7DA921; font-weight: bold;">endmodule</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Interfaces can also contain procedural blocks like <strong>always</strong>, <strong>always_ff</strong>, <strong>parameter</strong>s and <strong>generate</strong> statements similar to modules.</p>
<p class="akst_link"><a href="http://vlsihomepage.com/?p=108&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_108" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://vlsihomepage.com/2007/10/23/interfaces-in-systemverilog-2/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
