<p>The <b>Design Technology Rules (DTR)</b> format was developped as a part of the Chams Project (<ahref="http://www-soc.lip6.fr/recherche/cian/chams/">http://www-soc.lip6.fr/recherche/cian/chams/</a>). It aims at offering a generic description of layout design rules for CMOS technologies.<br/>
<p>Only simple rules are supported at the moment. For example the minimum width of a metal layer has only one value, although it should depends on the length of the wire drawned.</p>
<li><aclass="el"href="class_d_t_r_1_1_techno.html">DTR::Techno</a> contains generic informations such as the name of the technology and the unit used, and the list of all technologic rules.</li>
<li><aclass="el"href="class_d_t_r_1_1_rule.html">DTR::Rule</a>&<aclass="el"href="class_d_t_r_1_1_a_rule.html">DTR::ARule</a> respectively describe a symmetrical and an asymmetrical rule.</li>
</ul>
<p>The library also use the <aclass="el"href="class_d_t_r_1_1_d_t_r_exception.html">DTR::DTRException</a> class to throw excptions.</p>
<h2><aclass="anchor"id="dtrParser"></a>
Using the parser</h2>
<p>Simply load a technology with static function <aclass="el"href="class_d_t_r_1_1_techno.html#acf863c2bdb7f1aacc4422c8155c60d17"title="creates and returns a Techno object based on a database source file. ">DTR::Techno::readFromFile()</a> and then get rules (<aclass="el"href="class_d_t_r_1_1_techno.html#a4d56a05b47bd6c51e4e18120f49b584b"title="returns the rule uniquely identified by its name and layers. ">DTR::Techno::getRule()</a>) or directly values (<aclass="el"href="class_d_t_r_1_1_techno.html#ac08e2e60dd16750551221ca908001057"title="returns the value of a rule uniquely identified by its name and layers. ">DTR::Techno::getValue()</a>).</p>
<h2><aclass="anchor"id="dtrDriver"></a>
Using the driver</h2>
<p>Using the driver is very simple, user has to create a <aclass="el"href="class_d_t_r_1_1_techno.html">DTR::Techno</a> object and simply add <aclass="el"href="class_d_t_r_1_1_rule.html">DTR::Rule</a> or <aclass="el"href="class_d_t_r_1_1_a_rule.html">DTR::ARule</a> to it. The adding methods return the newly created Rule so user can set the rule type (<aclass="el"href="class_d_t_r_1_1_rule.html#a3568407d7a7890c39b8c9acc1e608535"title="sets the type of a rule. ">DTR::Rule::setType()</a>) if necessary. Finally use the <aclass="el"href="class_d_t_r_1_1_techno.html#a26b05539dd3345963b8708788b82e2cb"title="writes the database to file. ">DTR::Techno::writeToFile()</a> method to dump the database to file.</p>
<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 simple code examples to parse and drive a DTR file using C++ or Python. The DTR file considered is the same for all examples: <code>example.dtr.xml</code></p><divclass="fragment"><divclass="line"><<spanclass="keywordtype">technology</span><spanclass="keyword">name</span>=<spanclass="stringliteral">"example"</span><spanclass="keyword">unit</span>=<spanclass="stringliteral">"micro"</span><spanclass="keyword">version</span>=<spanclass="stringliteral">"rev.A"</span>></div><divclass="line"><<spanclass="keywordtype">physical_rules</span>></div><divclass="line"><spanclass="comment"><!-- transistor --></span></div><divclass="line"><<spanclass="keywordtype">rule</span><spanclass="keyword">name</span>=<spanclass="stringliteral">"transistorMinL"</span><spanclass="keyword">value</span>=<spanclass="stringliteral">"0.10"</span><spanclass="keyword">ref</span>=<spanclass="stringliteral">"ref1"</span>/></div><divclass="line"><<spanclass="keywordtype">rule</span><spanclass="keyword">name</span>=<spanclass="stringliteral">"transistorMinW"</span><spanclass="keyword">value</span>=<spanclass="stringliteral">"0.20"</span><spanclass="keyword">ref</span>=<spanclass="stringliteral">"ref2"</span>/></div><divclass="line"></div><divclass="line"><spanclass="comment"><!-- minWidth --></span></div><divclass="line"><<spanclass="keywordtype">rule</span><spanclass="keyword">name</span>=<spanclass="stringliteral">"minWidth"</span><spanclass="keyword">layer</span>=<spanclass="stringliteral">"metal1"</span><spanclass="keyword">value</span>=<spanclass="stringliteral">"0.15"</span><spanclass="keyword">ref</span>=<spanclass="stringliteral">"ref3"</span>/></div><divclass="line"></div><divclass="line"><spanclass="comment"><!-- minSpacing --></span></div><divclass="line"><<spanclass="keywordtype">rule</span><spanclass="keyword">name</span>=<spanclass="stringliteral">"minSpacing"</span><spanclass="keyword">layer</span>=<spanclass="stringliteral">"metal1"</span><spanclass="keyword">value</span>=<spanclass="stringliteral">"0.20"</span><spanclass="keyword">ref</span>=<spanclass="stringliteral">"ref4"</span>/></div><divclass="line"><<spanclass="keywordtype">rule</span><spanclass="keyword">name</span>=<spanclass="stringliteral">"minSpacing"</span><spanclass="keyword">layer1</span>=<spanclass="stringliteral">"active"</span><spanclass="keyword">layer2</span>=<spanclass="stringliteral">"poly"</span><spanclass="keyword">value</span>=<spanclass="stringliteral">"0.10"</span><spanclass="keyword">ref</span>=<spanclass="stringliteral">"ref5"</span>/></div><divclass="line"></div><divclass="line"><spanclass="comment"><!-- minExtension --></span></div><divclass="line"><<spanclass="keywordtype">arule</span><spanclass="keyword">name</span>=<spanclass="stringliteral">"minExtension"</span><spanclass="keyword">layer1</span>=<spanclass="stringliteral">"poly"</span><spanclass="keyword">layer2</span>=<spanclass="stringliteral">"active"</span><spanclass="keyword">value</span>=<spanclass="stringliteral">"0.20"</span><spanclass="keyword">ref</span>=<spanclass="stringliteral">"ref6"</span>/></div><divclass="line"></div><divclass="line"><spanclass="comment"><!-- minArea --></span></div><divclass="line"><<spanclass="keywordtype">rule</span><sp
<p>The following python script (<code>parseDtr.py</code>) is an example of how to parse a DTR file using python module. </p><divclass="fragment"><divclass="line"><spanclass="keyword">from</span> DTR <spanclass="keyword">import</span> *</div><divclass="line"><spanclass="keyword">from</span> decimal <spanclass="keyword">import</span> Decimal</div><divclass="line"></div><divclass="line">techno = Techno.readFromFile(<spanclass="stringliteral">"./example.dtr.xml"</span>)</div><divclass="line"></div><divclass="line"><spanclass="keywordflow">print</span><spanclass="stringliteral">"+-----------------------------+"</span></div><divclass="line"><spanclass="keywordflow">print</span><spanclass="stringliteral">"| technology: "</span>+techno.get) + <spanclass="stringliteral">" |"</span></div><divclass="line"><spanclass="keywordflow">print</span><spanclass="stringliteral">"| units: "</span>+techno.getUnit() +<spanclass="stringliteral">" |"</span></div><divclass="line"><spanclass="keywordflow">print</span><spanclass="stringliteral">"| version: "</span>+techno.getVersion()+<spanclass="stringliteral">" |"</span></div><divclass="line"><spanclass="keywordflow">print</span><spanclass="stringliteral">"+-----------------------------+\n\n"</span></div><divclass="line"></div><divclass="line"><spanclass="keywordflow">print</span><spanclass="stringliteral">"transistorMinL = %s"</span>%techno.getValue(<spanclass="stringliteral">"transistorMinL"</span>)</div><divclass="line"><spanclass="keywordflow">print</span><spanclass="stringliteral">"transistorMinW = %s"</span>%Decimal(techno.getValueAsString(<spanclass="stringliteral">"transistorMinW"</span>))</div><divclass="line"><spanclass="keywordflow">print</span><spanclass="stringliteral">"minWidth of metal1 = %s"</span>%techno.getValue(<spanclass="stringliteral">"minWidth"</span>, <spanclass="stringliteral">"metal1"</span>)</div><divclass="line"><spanclass="keywordflow">print</span><spanclass="stringliteral">"minSpacing of metal1 = %s"</span>%techno.getValue(<spanclass="stringliteral">"minWidth"</span>, <spanclass="stringliteral">"metal1"</span>)</div><divclass="line"><spanclass="keywordflow">print</span><spanclass="stringliteral">"minSpacing of active vs poly = %s"</span>%techno.getValue(<spanclass="stringliteral">"minSpacing"</span>, <spanclass="stringliteral">"active"</span>, <spanclass="stringliteral">"poly"</span>)</div><divclass="line"><spanclass="keywordflow">print</span><spanclass="stringliteral">"minExtension active over poly = %s"</span>%techno.getValue(<spanclass="stringliteral">"minExtension"</span>, <spanclass="stringliteral">"poly"</span>, <spanclass="stringliteral">"active"</span>)</div><divclass="line"><spanclass="keywordflow">print</span><spanclass="stringliteral">"minArea of metal1 = %s"</span>%techno.getValue(<spanclass="stringliteral">"minArea"</span>, <spanclass="stringliteral">"metal1"</span>)</div><divclass="line"></div><divclass="line"><spanclass="comment"># an example of why it is important to use Decimal in python:</span></div><divclass="line"><spanclass="keywordflow">print</span> techno.getValue(<spanclass="stringliteral">"minArea"</span>, <spanclass="stringliteral">"metal1"</span>)*3-0.3 <spanclass="comment"># returns 5.55111512313e-17</span></div><divclass="line"><spanclass="keywordflow">print</span> Decimal(techno.getValueAsString(<spanclass="stringliteral">"minArea"</span>, <spanclass="stringliteral">"metal1"</span>))*3-Decimal(<spanclass="stringliteral">'0.3'</span>) <spanclass="comment"># returns 0.000</span></div></div><!-- fragment -->