coriolis/vlsisapd/doc/html/cif.html

81 lines
10 KiB
HTML

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>VLSI SAPD Documentation</title>
<link href="stylesheet.css" rel="stylesheet" type="text/css">
</head>
<h1 id="pagetop" class="header">VLSI SAPD Documentation</h1>
<center class="header">
<table class="header">
<tr>
<td><a href="index.html">Presentation</a></td>
<td><a href="agds.html">AGDS</a></td>
<td><a href="cif.html">CIF</a></td>
<td><a href="dtr.html">DTR</a></td>
<td><a href="openchams.html">OPENCHAMS</a></td>
<td><a href="spice.html">SPICE</a></td>
<td><a href="contact.html">Links & Contact</a></td>
</tr>
</table>
</center>
<br>
<hr>
<body>
<!-- Generated by Doxygen 1.8.14 -->
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">CIF Format </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="cifPres"></a>
Presentation</h1>
<p>The <b>Caltech Intermediate Format (CIF)</b> consists in a limited set of graphic primitives used to describe the shapes on each layer of an integrated circuit (see <a href="http://en.wikipedia.org/wiki/Caltech_Intermediate_Form">http://en.wikipedia.org/wiki/Caltech_Intermediate_Form</a> for more informations). <br />
</p>
<h2><a class="anchor" id="cifAutrhos"></a>
Author</h2>
<p>Damien Dupuis: damien.dupuis(at)lip6(.)fr</p>
<h2><a class="anchor" id="cifLimits"></a>
Limitations</h2>
<p>Although the CIF format allows hierarchical description and supports several shapes, in this driver, we do not use hierarchy and only use Polygons.</p>
<h1><a class="anchor" id="cifDB"></a>
Stand alone database structure</h1>
<p>The database consists in two simple objects :</p><ul>
<li><a class="el" href="class_c_i_f_1_1_circuit.html">CIF::Circuit</a> contains all CIF circuit informations such as the name, the unit used, the scale and the list of all Polygons.</li>
<li><a class="el" href="class_c_i_f_1_1_polygon.html">CIF::Polygon</a> describes a Polygon (a set of points).</li>
</ul>
<h2><a class="anchor" id="cifDriver"></a>
Using the driver</h2>
<p>To drive a CIF file, user has to create one <a class="el" href="class_c_i_f_1_1_circuit.html">CIF::Circuit</a> and as many <a class="el" href="class_c_i_f_1_1_polygon.html">CIF::Polygon</a> as the number of shapes of the layout. The <a class="el" href="class_c_i_f_1_1_polygon.html">CIF::Polygon</a> objects can be created independently from for the <a class="el" href="class_c_i_f_1_1_circuit.html">CIF::Circuit</a> but must be finally added to the <a class="el" href="class_c_i_f_1_1_circuit.html">CIF::Circuit</a> using <a class="el" href="class_c_i_f_1_1_circuit.html#a5b37e86206e2a128ba6db4987dc09a39" title="adds a Polygon to the Circuit. ">CIF::Circuit::addPolygon()</a>.<br />
Once the <a class="el" href="class_c_i_f_1_1_circuit.html">CIF::Circuit</a> is complete, simply call the <a class="el" href="class_c_i_f_1_1_circuit.html#a90c823b70c4984f302c19ceca604d101" title="writes the database to file. ">CIF::Circuit::writeToFile()</a> method to drive the database to file.</p>
<h1><a class="anchor" id="cifExamples"></a>
Examples</h1>
<p>As said is the global presentation, VLSI SAPD project provides C++ libraries and Python modules for each supported format. In this section we present two simple code examples to drive a CIF file using C++ or Python. These two examples drive the same file <code>transistor.cif:</code> </p><div class="fragment"><div class="line">(CIF file written on 11-Jun-2010 13:49:44 by VLSISAPD_CIF_DRIVER);</div><div class="line">(Units: micro - UU/DB Scale: 0.001);</div><div class="line">DS 1 1 1;</div><div class="line">9 Transistor;</div><div class="line">L 6; P 130,290 540,290 540,690 130,690;</div><div class="line">L 17; P 305,150 365,150 365,830 305,830;</div><div class="line">DF;</div><div class="line">C 1;</div><div class="line">E</div></div><!-- fragment --><div class="image">
<img src="transistorCif.png" alt="transistorCif.png"/>
<div class="caption">
CIF example layout</div></div>
<h2><a class="anchor" id="cifC"></a>
C++</h2>
<p>Here is the C++ code (<code>driveCif.cpp</code>) used to generate the transistor.cif file. (Source is available in examples directory). </p><div class="fragment"><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="keyword">using namespace </span><a class="code" href="namespacestd.html">std</a>;</div><div class="line"></div><div class="line"><span class="preprocessor">#include &quot;vlsisapd/cif/Circuit.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;vlsisapd/cif/Polygon.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> * argv[]) {</div><div class="line"> <a class="code" href="class_c_i_f_1_1_circuit.html">CIF::Circuit</a>* circuit = <span class="keyword">new</span> <a class="code" href="class_c_i_f_1_1_circuit.html">CIF::Circuit</a>(<span class="keywordtype">string</span>(<span class="stringliteral">&quot;Transistor&quot;</span>), <span class="keywordtype">string</span>(<span class="stringliteral">&quot;micro&quot;</span>), 0.001);</div><div class="line"></div><div class="line"> <span class="comment">// Layer #6 corresponds to active</span></div><div class="line"> <a class="code" href="class_c_i_f_1_1_polygon.html">CIF::Polygon</a>* poly = <span class="keyword">new</span> <a class="code" href="class_c_i_f_1_1_polygon.html">CIF::Polygon</a>(6);</div><div class="line"> poly-&gt;<a class="code" href="class_c_i_f_1_1_polygon.html#ab3047469780327f18539907e1303ea15">addPoint</a>(130, 290);</div><div class="line"> poly-&gt;<a class="code" href="class_c_i_f_1_1_polygon.html#ab3047469780327f18539907e1303ea15">addPoint</a>(540, 290);</div><div class="line"> poly-&gt;<a class="code" href="class_c_i_f_1_1_polygon.html#ab3047469780327f18539907e1303ea15">addPoint</a>(540, 690);</div><div class="line"> poly-&gt;<a class="code" href="class_c_i_f_1_1_polygon.html#ab3047469780327f18539907e1303ea15">addPoint</a>(130, 690);</div><div class="line"> circuit-&gt;<a class="code" href="class_c_i_f_1_1_circuit.html#a5b37e86206e2a128ba6db4987dc09a39">addPolygon</a>(poly);</div><div class="line"></div><div class="line"> <span class="comment">// Layer #17 corresponds to polysilicium</span></div><div class="line"> poly = <span class="keyword">new</span> <a class="code" href="class_c_i_f_1_1_polygon.html">CIF::Polygon</a>(17);</div><div class="line"> poly-&gt;<a class="code" href="class_c_i_f_1_1_polygon.html#ab3047469780327f18539907e1303ea15">addPoint</a>(305, 150);</div><div class="line"> poly-&gt;<a class="code" href="class_c_i_f_1_1_polygon.html#ab3047469780327f18539907e1303ea15">addPoint</a>(365, 150);</div><div class="line"> poly-&gt;<a class="code" href="class_c_i_f_1_1_polygon.html#ab3047469780327f18539907e1303ea15">addPoint</a>(365, 830);</div><div class="line"> poly-&gt;<a class="code" href="class_c_i_f_1_1_polygon.html#ab3047469780327f18539907e1303ea15">addPoint</a>(305, 830);</div><div class="line"> circuit-&gt;<a class="code" href="class_c_i_f_1_1_circuit.html#a5b37e86206e2a128ba6db4987dc09a39">addPolygon</a>(poly);</div><div class="line"></div><div class="line"> circuit-&gt;<a class="code" href="class_c_i_f_1_1_circuit.html#a90c823b70c4984f302c19ceca604d101">writeToFile</a>(<span class="stringliteral">&quot;./transistor.cif&quot;</span>);</div><div class="line"> </div><div class="line"> <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>In order to compile this code, a CMakeLists.txt file is provided. User must set the $VLSISAPD_TOP variable before running these commands in the directory containing the CMakeLists.txt file: <div class="fragment"><div class="line">%&gt; mkdir build; cd build</div><div class="line">%&gt; cmake ..</div><div class="line">%&gt; make</div></div><!-- fragment --></dd></dl>
<h2><a class="anchor" id="cifPython"></a>
Python</h2>
<p>Here is the Python code (<code>driveCif.py</code>) used to generate the transistor.cif file. (Source is available in examples directory). </p><div class="fragment"><div class="line"><span class="keyword">import</span> CIF</div><div class="line">circuit = <a class="code" href="class_c_i_f_1_1_circuit.html">CIF.Circuit</a>(<span class="stringliteral">&quot;Transistor&quot;</span>, <span class="stringliteral">&quot;micro&quot;</span>, 0.001)</div><div class="line">poly1 = <a class="code" href="class_c_i_f_1_1_polygon.html">CIF.Polygon</a>(6)</div><div class="line">poly1.addPoint(130, 290)</div><div class="line">poly1.addPoint(540, 290)</div><div class="line">poly1.addPoint(540, 690)</div><div class="line">poly1.addPoint(130, 690)</div><div class="line">circuit.addPolygon(poly1)</div><div class="line"> </div><div class="line">poly2 = <a class="code" href="class_c_i_f_1_1_polygon.html">CIF.Polygon</a>(17)</div><div class="line">poly2.addPoint(305, 150);</div><div class="line">poly2.addPoint(365, 150);</div><div class="line">poly2.addPoint(365, 830);</div><div class="line">poly2.addPoint(305, 830);</div><div class="line">circuit.addPolygon(poly2)</div><div class="line"></div><div class="line">circuit.writeToFile(<span class="stringliteral">&quot;./transistor.cif&quot;</span>)</div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>In order to run the <code>driveCif.py</code> script, user must ensure that $PYTHONPATH variable points to the directory containing CIF.so module. </dd></dl>
</div></div><!-- contents -->
<br>
<hr>
<table class="footer1">
<tr>
<td class="LFooter"><small>Generated by doxygen 1.8.14 on Thu Oct 18 2018</small></td>
<td class="RFooter"><a href='#pagetop'><small>Return to top of page</small></a></td>
</tr>
</table>
<table class="footer2">
<tr>
<td class="LFooter">VLSI SAPD Documentation</td>
<td class="RFooter"><small>Copyright &#169; 2010 - 2011 <a href="http://www.upmc.fr">UPMC</a> All rights reserved</small></td>
</tr>
</table>
</body>
</html>