coriolis/vlsisapd/doc/html/agds.html

180 lines
13 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.5 -->
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">AGDS Format </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="agdsPres"></a>
Presentation</h1>
<p>The <b>Ascii Graphic Database System (AGDS)</b> format is an ascii (text) version of the wellknown and industry standard GDS II binary format. This format hierarchicaly represents geometric shapes, labels and other layout informations (see <a href="http://en.wikipedia.org/wiki/GDSII">http://en.wikipedia.org/wiki/GDSII</a> for more informations). <br/>
The ascii format has several advantages versus binary format:</p>
<ul>
<li>human readable,</li>
<li>easy to edit manually or with dedicated tools,</li>
<li>easy to search or grep into,</li>
<li>easy to compare and understand differences between two files,</li>
<li>easy to convert.</li>
</ul>
<p>The conversion from Ascii GDS to binary GDS and vice versa can be done with <b>OwlVision GDSII Viewer</b> available at <a href="http://owlvision.org">http://owlvision.org</a><br/>
Since it has been developped in java, it can be run on all platforms.</p>
<h2><a class="anchor" id="agdsAutrhos"></a>
Author</h2>
<p>Damien Dupuis: damien.dupuis(at)lip6(.)fr</p>
<h2><a class="anchor" id="agdsLimits"></a>
Limitations</h2>
<p>Currently the only supported shape in this driver is the rectangle.</p>
<h1><a class="anchor" id="agdsDB"></a>
Stand alone database structure</h1>
<p>The database conists in for simple objects :</p>
<ul>
<li><a class="el" href="class_a_g_d_s_1_1_library.html">AGDS::Library</a> contains all AGDS library informations such as the name, the units used (user and physical) and the list of all Structures.</li>
<li><a class="el" href="class_a_g_d_s_1_1_structure.html">AGDS::Structure</a> describes a GDS Structure with a name and a list of Elements.</li>
<li><a class="el" href="class_a_g_d_s_1_1_element.html">AGDS::Element</a> is an abstract class from which derived the <a class="el" href="class_a_g_d_s_1_1_rectangle.html">AGDS::Rectangle</a>.</li>
<li><a class="el" href="class_a_g_d_s_1_1_rectangle.html">AGDS::Rectangle</a> describes a rectangle element of a structure.</li>
</ul>
<h2><a class="anchor" id="agdsDriver"></a>
Using the driver</h2>
<p>To drive an AGDS file, user has to create one <a class="el" href="class_a_g_d_s_1_1_library.html">AGDS::Library</a> and add <a class="el" href="class_a_g_d_s_1_1_structure.html">AGDS::Structure</a> objects to it with the <a class="el" href="class_a_g_d_s_1_1_library.html#a93d333a20154e0b688ff3ff213039171" title="adds a Structure to the Library. ">AGDS::Library::addStructure()</a> method. Each <a class="el" href="class_a_g_d_s_1_1_structure.html">AGDS::Structure</a> contains at least one <a class="el" href="class_a_g_d_s_1_1_element.html">AGDS::Element</a> added with <a class="el" href="class_a_g_d_s_1_1_structure.html#a2dd203e6770f7d15d6f706867c919a60" title="adds an Element to the Structure. ">AGDS::Structure::addElement()</a> method.<br/>
All objects can be independently created as far as they are correctly added to their parent. <br/>
Once the library is completely specified, simply call the <a class="el" href="class_a_g_d_s_1_1_library.html#a33b9d989b84857f46034085664ff3fa2" title="writes the database to file. ">AGDS::Library::writeToFile()</a> method to drive the database to file.</p>
<h1><a class="anchor" id="agdsExamples"></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 AGDS file using C++ or Python. These two examples drive the same file <code>transistor.agds:</code> </p>
<div class="fragment"><div class="line">HEADER 5;</div>
<div class="line">BGNLIB;</div>
<div class="line"> LASTMOD {10-06-11 14:02:15};</div>
<div class="line"> LASTACC {10-06-11 14:02:15};</div>
<div class="line">LIBNAME myTestLib.DB;</div>
<div class="line">UNITS;</div>
<div class="line"> USERUNITS 0.001;</div>
<div class="line"> PHYSUNITS 1.000000e-09;</div>
<div class="line"></div>
<div class="line">BGNSTR;</div>
<div class="line"> CREATION {10-06-11 14:02:15};</div>
<div class="line"> LASTMOD {10-06-11 14:02:15};</div>
<div class="line">STRNAME Transistor;</div>
<div class="line"></div>
<div class="line">BOUNDARY;</div>
<div class="line">LAYER 17;</div>
<div class="line">DATATYPE 0;</div>
<div class="line">XY 5;</div>
<div class="line"> X: 305; Y: 150;</div>
<div class="line"> X: 305; Y: 830;</div>
<div class="line"> X: 365; Y: 830;</div>
<div class="line"> X: 365; Y: 150;</div>
<div class="line"> X: 305; Y: 150;</div>
<div class="line">ENDEL;</div>
<div class="line"></div>
<div class="line">BOUNDARY;</div>
<div class="line">LAYER 6;</div>
<div class="line">DATATYPE 0;</div>
<div class="line">XY 5;</div>
<div class="line"> X: 130; Y: 290;</div>
<div class="line"> X: 130; Y: 690;</div>
<div class="line"> X: 540; Y: 690;</div>
<div class="line"> X: 540; Y: 290;</div>
<div class="line"> X: 130; Y: 290;</div>
<div class="line">ENDEL;</div>
<div class="line"></div>
<div class="line">ENDSTR;</div>
<div class="line">ENDLIB;</div>
</div><!-- fragment --><div class="image">
<img src="transistorCif.png" alt="transistorCif.png"/>
<div class="caption">
AGDS example layout</div></div>
<h2><a class="anchor" id="agdsC"></a>
C++</h2>
<p>Here is the C++ code (<code>driveAgds.cpp</code>) used to generate the transistor.agds 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>std;</div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/agds/Library.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/agds/Structure.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/agds/Rectangle.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_a_g_d_s_1_1_library.html">AGDS::Library</a>* lib = <span class="keyword">new</span> <a class="code" href="class_a_g_d_s_1_1_library.html">AGDS::Library</a>(<span class="keywordtype">string</span>(<span class="stringliteral">&quot;myTestLib&quot;</span>));</div>
<div class="line"></div>
<div class="line"> lib-&gt;<a class="code" href="class_a_g_d_s_1_1_library.html#a0d0e972bb142f892c462bb8d7f04a50b">setUserUnits</a>(0.001);</div>
<div class="line"> lib-&gt;<a class="code" href="class_a_g_d_s_1_1_library.html#a938acb6eb8d14aade9dba7331c75ff0a">setPhysUnits</a>(1.0E-9);</div>
<div class="line"></div>
<div class="line"> <a class="code" href="class_a_g_d_s_1_1_rectangle.html">AGDS::Rectangle</a>* poly = <span class="keyword">new</span> <a class="code" href="class_a_g_d_s_1_1_rectangle.html">AGDS::Rectangle</a>( 17, 305, 150, 365, 830 );</div>
<div class="line"> <a class="code" href="class_a_g_d_s_1_1_rectangle.html">AGDS::Rectangle</a>* active = <span class="keyword">new</span> <a class="code" href="class_a_g_d_s_1_1_rectangle.html">AGDS::Rectangle</a>( 6, 130, 290, 540, 690 );</div>
<div class="line"></div>
<div class="line"> <a class="code" href="class_a_g_d_s_1_1_structure.html">AGDS::Structure</a>* str = <span class="keyword">new</span> <a class="code" href="class_a_g_d_s_1_1_structure.html">AGDS::Structure</a>(<span class="stringliteral">&quot;Transistor&quot;</span>);</div>
<div class="line"></div>
<div class="line"> str-&gt;<a class="code" href="class_a_g_d_s_1_1_structure.html#a2dd203e6770f7d15d6f706867c919a60">addElement</a>(poly);</div>
<div class="line"> str-&gt;<a class="code" href="class_a_g_d_s_1_1_structure.html#a2dd203e6770f7d15d6f706867c919a60">addElement</a>(active);</div>
<div class="line"></div>
<div class="line"> lib-&gt;<a class="code" href="class_a_g_d_s_1_1_library.html#a93d333a20154e0b688ff3ff213039171">addStructure</a>(str);</div>
<div class="line"></div>
<div class="line"> lib-&gt;<a class="code" href="class_a_g_d_s_1_1_library.html#a33b9d989b84857f46034085664ff3fa2">writeToFile</a>(<span class="stringliteral">&quot;./transistor.agds&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="agdsPython"></a>
Python</h2>
<p>Here is the Python code (<code>driveAgds.py</code>) used to generate the transistor.agds file. (Source is available in examples directory). </p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;import AGDS</div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;lib = <a class="code" href="class_a_g_d_s_1_1_library.html">AGDS.Library</a>(<span class="stringliteral">&quot;myTestLib&quot;</span>)</div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;lib.setUserUnits(0.001)</div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;lib.setPhysUnits(1.0e-9)</div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;</div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;active = <a class="code" href="class_a_g_d_s_1_1_rectangle.html">AGDS.Rectangle</a>( 6, 120, 290, 540, 690) <span class="comment"># layer 6 corresponds to active</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;poly = <a class="code" href="class_a_g_d_s_1_1_rectangle.html">AGDS.Rectangle</a>(17, 305, 150, 365, 830) <span class="comment"># layer 17 corresponds to polysilicium</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;</div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;str = <a class="code" href="class_a_g_d_s_1_1_structure.html">AGDS.Structure</a>(<span class="stringliteral">&quot;Transistor&quot;</span>)</div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;str.addElement(active)</div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;str.addElement(poly)</div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;</div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;lib.addStructure(str)</div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;lib.writeToFile(<span class="stringliteral">&quot;./transistor.agds&quot;</span>)</div>
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>In order to run the <code>driveAgds.py</code> script, user must ensure that $PYTHONPATH variable points to the directory containing AGDS.so module. </dd></dl>
</div></div><!-- contents -->
<br>
<hr>
<table class="footer1">
<tr>
<td class="LFooter"><small>Generated by doxygen 1.8.5 on Sat Aug 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>