coriolis/vlsisapd/doc/html/openchams.html

932 lines
137 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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">OPENCHAMS Format </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="openChamsPres"></a>
Presentation</h1>
<p>The <b>OpenCHAMS</b> format was developped as a part of the Chams Project (<a href="http://www-soc.lip6.fr/recherche/cian/chams/">http://www-soc.lip6.fr/recherche/cian/chams/</a>). It aims at offering a convenient way to describe analogic circuits' netlists and is based on XML. Some CHAMS specific informations, such as schematic properties, layout properties or sizing procedure, can be described in this format.<br/>
</p>
<h2><a class="anchor" id="openChamsAutrhos"></a>
Author</h2>
<p>Damien Dupuis: damien.dupuis(at)lip6(.)fr</p>
<h1><a class="anchor" id="openChamsDB"></a>
Stand alone database structure</h1>
<p>The database has many objects that can be arranged in five categories:</p>
<ul>
<li>General<ul>
<li><a class="el" href="class_open_chams_1_1_circuit.html">OpenChams::Circuit</a></li>
<li>OpenChams::Name</li>
<li><a class="el" href="class_open_chams_1_1_open_chams_exception.html">OpenChams::OpenChamsException</a></li>
</ul>
</li>
<li>Netlist<ul>
<li><a class="el" href="class_open_chams_1_1_netlist.html">OpenChams::Netlist</a></li>
<li><a class="el" href="class_open_chams_1_1_instance.html">OpenChams::Instance</a></li>
<li><a class="el" href="class_open_chams_1_1_device.html">OpenChams::Device</a></li>
<li><a class="el" href="class_open_chams_1_1_transistor.html">OpenChams::Transistor</a></li>
<li><a class="el" href="class_open_chams_1_1_parameters.html">OpenChams::Parameters</a></li>
<li><a class="el" href="class_open_chams_1_1_net.html">OpenChams::Net</a></li>
</ul>
</li>
<li>Sizing<ul>
<li><a class="el" href="class_open_chams_1_1_sizing.html">OpenChams::Sizing</a></li>
<li><a class="el" href="class_open_chams_1_1_operator.html">OpenChams::Operator</a></li>
<li><a class="el" href="class_open_chams_1_1_simul_model.html">OpenChams::SimulModel</a></li>
</ul>
</li>
<li>Schematic<ul>
<li><a class="el" href="class_open_chams_1_1_schematic.html">OpenChams::Schematic</a></li>
<li><a class="el" href="class_open_chams_1_1_port.html">OpenChams::Port</a></li>
<li><a class="el" href="class_open_chams_1_1_wire.html">OpenChams::Wire</a></li>
<li><a class="el" href="class_open_chams_1_1_wire_point.html">OpenChams::WirePoint</a></li>
<li><a class="el" href="class_open_chams_1_1_instance_point.html">OpenChams::InstancePoint</a></li>
<li><a class="el" href="class_open_chams_1_1_port_point.html">OpenChams::PortPoint</a></li>
<li><a class="el" href="class_open_chams_1_1_intermediate_point.html">OpenChams::IntermediatePoint</a></li>
</ul>
</li>
<li>Layout<ul>
<li><a class="el" href="class_open_chams_1_1_layout.html">OpenChams::Layout</a></li>
<li><a class="el" href="class_open_chams_1_1_node.html">OpenChams::Node</a></li>
<li><a class="el" href="class_open_chams_1_1_bloc.html">OpenChams::Bloc</a></li>
<li><a class="el" href="class_open_chams_1_1_group.html">OpenChams::Group</a></li>
</ul>
</li>
</ul>
<h2><a class="anchor" id="openChamsParser"></a>
Using the parser</h2>
<p>Simply load an OPENCHAMS file using the static function <a class="el" href="class_open_chams_1_1_circuit.html#ad0aa3183bdea59e62f69c295026b7fe7" title="creates and returns a Circuit object based on a database source file. ">OpenChams::Circuit::readFromFile()</a> and then get the netlist object (<a class="el" href="class_open_chams_1_1_circuit.html#a4085d6a7b6958ffdd7ab5df7e6d6e53f" title="returns the Netlist object associated to the circuit or NULL if it does not exist. ">OpenChams::Circuit::getNetlist()</a>) or the sizing procedure (<a class="el" href="class_open_chams_1_1_circuit.html#a0ce52bc8747f684ec0123faa8ff97b6d" title="returns the Sizing object associated to the circuit or NULL if it does not exist. ...">OpenChams::Circuit::getSizing()</a>, might be NULL) or any other useful information (see <a class="el" href="class_open_chams_1_1_circuit.html">OpenChams::Circuit</a>).</p>
<h2><a class="anchor" id="openChamsDriver"></a>
Using the driver</h2>
<p>Using the driver is very simple, user has to create an <a class="el" href="class_open_chams_1_1_circuit.html">OpenChams::Circuit</a> object and simply add <a class="el" href="class_open_chams_1_1_netlist.html">OpenChams::Netlist</a> (mandatory) and <a class="el" href="class_open_chams_1_1_sizing.html">OpenChams::Sizing</a> (optionnal) or <a class="el" href="class_open_chams_1_1_schematic.html">OpenChams::Schematic</a> (optionnal) or <a class="el" href="class_open_chams_1_1_layout.html">OpenChams::Layout</a> (optinnal) to it. Finally use the <a class="el" href="class_open_chams_1_1_circuit.html#a2eb07935ec946a07edcee2255b781193" title="writes the database to file. ">OpenChams::Circuit::writeToFile()</a> method to dump the database to file.</p>
<h1><a class="anchor" id="openChamsExamples"></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 simple code examples to parse and drive a OPENCHAMS file using C++ or Python. The OPENCHAMS files considered are the same for all examples: <code>inverter.xml</code> and <code>buffer.xml</code> </p>
<div class="fragment"><div class="line">&lt;?xml version=<span class="stringliteral">&quot;1.0&quot;</span> encoding=<span class="stringliteral">&quot;UTF-8&quot;</span>?&gt;</div>
<div class="line">&lt;circuit name=<span class="stringliteral">&quot;inverter&quot;</span> techno=<span class="stringliteral">&quot;myTech&quot;</span>&gt;</div>
<div class="line"> &lt;parameters&gt;</div>
<div class="line"> &lt;parameter name=<span class="stringliteral">&quot;temp&quot;</span> value=<span class="stringliteral">&quot;27.0&quot;</span>/&gt;</div>
<div class="line"> &lt;parameter name=<span class="stringliteral">&quot;Vdd&quot;</span> value=<span class="stringliteral">&quot;1.2&quot;</span>/&gt;</div>
<div class="line"> &lt;parameter name=<span class="stringliteral">&quot;Vss&quot;</span> value=<span class="stringliteral">&quot;0.0&quot;</span>/&gt;</div>
<div class="line"> &lt;parameter name=<span class="stringliteral">&quot;L&quot;</span> value=<span class="stringliteral">&quot;0.10e-6&quot;</span>/&gt;</div>
<div class="line"> &lt;parameter name=<span class="stringliteral">&quot;Ids&quot;</span> value=<span class="stringliteral">&quot;30e-6&quot;</span>/&gt;</div>
<div class="line"> &lt;parameter name=<span class="stringliteral">&quot;Veg&quot;</span> value=<span class="stringliteral">&quot;0.12&quot;</span>/&gt;</div>
<div class="line"> &lt;parameterEq name=<span class="stringliteral">&quot;complex&quot;</span> equation=<span class="stringliteral">&quot;myEq&quot;</span>/&gt;</div>
<div class="line"> &lt;/parameters&gt;</div>
<div class="line"> &lt;netlist&gt;</div>
<div class="line"> &lt;instances&gt;</div>
<div class="line"> &lt;instance name=<span class="stringliteral">&quot;nmos1&quot;</span> model=<span class="stringliteral">&quot;Transistor&quot;</span> order=<span class="stringliteral">&quot;1&quot;</span> mostype=<span class="stringliteral">&quot;NMOS&quot;</span> sourceBulkConnected=<span class="stringliteral">&quot;True&quot;</span>&gt;</div>
<div class="line"> &lt;connectors&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;G&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;D&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;S&quot;</span>/&gt;</div>
<div class="line"> &lt;/connectors&gt;</div>
<div class="line"> &lt;transistors&gt;</div>
<div class="line"> &lt;transistor name=<span class="stringliteral">&quot;m1&quot;</span>&gt;</div>
<div class="line"> &lt;connection gate=<span class="stringliteral">&quot;G&quot;</span> source=<span class="stringliteral">&quot;S&quot;</span> drain=<span class="stringliteral">&quot;D&quot;</span> bulk=<span class="stringliteral">&quot;S&quot;</span>/&gt;</div>
<div class="line"> &lt;/transistor&gt;</div>
<div class="line"> &lt;/transistors&gt;</div>
<div class="line"> &lt;/instance&gt;</div>
<div class="line"> &lt;instance name=<span class="stringliteral">&quot;pmos1&quot;</span> model=<span class="stringliteral">&quot;Transistor&quot;</span> order=<span class="stringliteral">&quot;2&quot;</span> mostype=<span class="stringliteral">&quot;PMOS&quot;</span> sourceBulkConnected=<span class="stringliteral">&quot;True&quot;</span>&gt;</div>
<div class="line"> &lt;connectors&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;G&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;D&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;S&quot;</span>/&gt;</div>
<div class="line"> &lt;/connectors&gt;</div>
<div class="line"> &lt;transistors&gt;</div>
<div class="line"> &lt;transistor name=<span class="stringliteral">&quot;m1&quot;</span>&gt;</div>
<div class="line"> &lt;connection gate=<span class="stringliteral">&quot;G&quot;</span> source=<span class="stringliteral">&quot;S&quot;</span> drain=<span class="stringliteral">&quot;D&quot;</span> bulk=<span class="stringliteral">&quot;S&quot;</span>/&gt;</div>
<div class="line"> &lt;/transistor&gt;</div>
<div class="line"> &lt;/transistors&gt;</div>
<div class="line"> &lt;/instance&gt;</div>
<div class="line"> &lt;/instances&gt;</div>
<div class="line"> &lt;nets&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;vdd&quot;</span> type=<span class="stringliteral">&quot;power&quot;</span> isExternal=<span class="stringliteral">&quot;True&quot;</span>&gt;</div>
<div class="line"> &lt;connector instance=<span class="stringliteral">&quot;pmos1&quot;</span> name=<span class="stringliteral">&quot;S&quot;</span>/&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;vss&quot;</span> type=<span class="stringliteral">&quot;ground&quot;</span> isExternal=<span class="stringliteral">&quot;True&quot;</span>&gt;</div>
<div class="line"> &lt;connector instance=<span class="stringliteral">&quot;nmos1&quot;</span> name=<span class="stringliteral">&quot;S&quot;</span>/&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;in&quot;</span> type=<span class="stringliteral">&quot;logical&quot;</span> isExternal=<span class="stringliteral">&quot;True&quot;</span>&gt;</div>
<div class="line"> &lt;connector instance=<span class="stringliteral">&quot;nmos1&quot;</span> name=<span class="stringliteral">&quot;G&quot;</span>/&gt;</div>
<div class="line"> &lt;connector instance=<span class="stringliteral">&quot;pmos1&quot;</span> name=<span class="stringliteral">&quot;G&quot;</span>/&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;out&quot;</span> type=<span class="stringliteral">&quot;logical&quot;</span> isExternal=<span class="stringliteral">&quot;True&quot;</span>&gt;</div>
<div class="line"> &lt;connector instance=<span class="stringliteral">&quot;nmos1&quot;</span> name=<span class="stringliteral">&quot;D&quot;</span>/&gt;</div>
<div class="line"> &lt;connector instance=<span class="stringliteral">&quot;pmos1&quot;</span> name=<span class="stringliteral">&quot;D&quot;</span>/&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;/nets&gt;</div>
<div class="line"> &lt;/netlist&gt;</div>
<div class="line"> &lt;schematic&gt;</div>
<div class="line"> &lt;instance name=<span class="stringliteral">&quot;nmos1&quot;</span> x=<span class="stringliteral">&quot;2490&quot;</span> y=<span class="stringliteral">&quot;2600&quot;</span> orient=<span class="stringliteral">&quot;ID&quot;</span>/&gt;</div>
<div class="line"> &lt;instance name=<span class="stringliteral">&quot;pmos1&quot;</span> x=<span class="stringliteral">&quot;2490&quot;</span> y=<span class="stringliteral">&quot;2490&quot;</span> orient=<span class="stringliteral">&quot;ID&quot;</span>/&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;vdd&quot;</span>&gt;</div>
<div class="line"> &lt;port type=<span class="stringliteral">&quot;inV&quot;</span> idx=<span class="stringliteral">&quot;0&quot;</span> x=<span class="stringliteral">&quot;2525&quot;</span> y=<span class="stringliteral">&quot;2430&quot;</span> orient=<span class="stringliteral">&quot;ID&quot;</span>/&gt;</div>
<div class="line"> &lt;wire&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;pmos1&quot;</span> plug=<span class="stringliteral">&quot;S&quot;</span>/&gt;</div>
<div class="line"> &lt;!--point x=<span class="stringliteral">&quot;&quot;</span> y=<span class="stringliteral">&quot;&quot;</span>/--&gt;</div>
<div class="line"> &lt;connector idx=<span class="stringliteral">&quot;0&quot;</span>/&gt;</div>
<div class="line"> &lt;/wire&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;vss&quot;</span>&gt;</div>
<div class="line"> &lt;port type=<span class="stringliteral">&quot;inV&quot;</span> idx=<span class="stringliteral">&quot;0&quot;</span> x=<span class="stringliteral">&quot;2525&quot;</span> y=<span class="stringliteral">&quot;2740&quot;</span> orient=<span class="stringliteral">&quot;MY&quot;</span>/&gt;</div>
<div class="line"> &lt;wire&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;nmos1&quot;</span> plug=<span class="stringliteral">&quot;S&quot;</span>/&gt;</div>
<div class="line"> &lt;connector idx=<span class="stringliteral">&quot;0&quot;</span>/&gt;</div>
<div class="line"> &lt;/wire&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;in&quot;</span>&gt;</div>
<div class="line"> &lt;port type=<span class="stringliteral">&quot;inH&quot;</span> idx=<span class="stringliteral">&quot;0&quot;</span> x=<span class="stringliteral">&quot;2415&quot;</span> y=<span class="stringliteral">&quot;2520&quot;</span> orient=<span class="stringliteral">&quot;ID&quot;</span>/&gt;</div>
<div class="line"> &lt;wire&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;pmos1&quot;</span> plug=<span class="stringliteral">&quot;G&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;nmos1&quot;</span> plug=<span class="stringliteral">&quot;G&quot;</span>/&gt;</div>
<div class="line"> &lt;/wire&gt;</div>
<div class="line"> &lt;wire&gt;</div>
<div class="line"> &lt;connector idx=<span class="stringliteral">&quot;0&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;pmos1&quot;</span> plug=<span class="stringliteral">&quot;G&quot;</span>/&gt;</div>
<div class="line"> &lt;/wire&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;out&quot;</span>&gt;</div>
<div class="line"> &lt;port type=<span class="stringliteral">&quot;outH&quot;</span> idx=<span class="stringliteral">&quot;0&quot;</span> x=<span class="stringliteral">&quot;2570&quot;</span> y=<span class="stringliteral">&quot;2590&quot;</span> orient=<span class="stringliteral">&quot;ID&quot;</span>/&gt;</div>
<div class="line"> &lt;wire&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;pmos1&quot;</span> plug=<span class="stringliteral">&quot;D&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;nmos1&quot;</span> plug=<span class="stringliteral">&quot;D&quot;</span>/&gt;</div>
<div class="line"> &lt;/wire&gt;</div>
<div class="line"> &lt;wire&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;nmos1&quot;</span> plug=<span class="stringliteral">&quot;D&quot;</span>/&gt;</div>
<div class="line"> &lt;connector idx=<span class="stringliteral">&quot;0&quot;</span>/&gt;</div>
<div class="line"> &lt;/wire&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;/schematic&gt;</div>
<div class="line"> &lt;sizing&gt;</div>
<div class="line"> &lt;instance name=<span class="stringliteral">&quot;pmos1&quot;</span> <span class="keyword">operator</span>=<span class="stringliteral">&quot;OPVG(Veg)&quot;</span> simulModel=<span class="stringliteral">&quot;BSIM3V3&quot;</span>&gt;</div>
<div class="line"> &lt;constraint param=<span class="stringliteral">&quot;Temp&quot;</span> ref=<span class="stringliteral">&quot;design&quot;</span> refParam=<span class="stringliteral">&quot;temp&quot;</span>/&gt;</div>
<div class="line"> &lt;constraint param=<span class="stringliteral">&quot;Ids&quot;</span> ref=<span class="stringliteral">&quot;design&quot;</span> refParam=<span class="stringliteral">&quot;Ids&quot;</span>/&gt;</div>
<div class="line"> &lt;constraint param=<span class="stringliteral">&quot;L&quot;</span> ref=<span class="stringliteral">&quot;design&quot;</span> refParam=<span class="stringliteral">&quot;L&quot;</span>/&gt;</div>
<div class="line"> &lt;constraint param=<span class="stringliteral">&quot;Veg&quot;</span> ref=<span class="stringliteral">&quot;design&quot;</span> refParam=<span class="stringliteral">&quot;Veg&quot;</span>/&gt;</div>
<div class="line"> &lt;constraint param=<span class="stringliteral">&quot;Vd&quot;</span> ref=<span class="stringliteral">&quot;design&quot;</span> refParam=<span class="stringliteral">&quot;Vdd&quot;</span> factor=<span class="stringliteral">&quot;0.5&quot;</span>/&gt;</div>
<div class="line"> &lt;constraint param=<span class="stringliteral">&quot;Vs&quot;</span> ref=<span class="stringliteral">&quot;design&quot;</span> refParam=<span class="stringliteral">&quot;Vdd&quot;</span>/&gt;</div>
<div class="line"> &lt;/instance&gt;</div>
<div class="line"> &lt;instance name=<span class="stringliteral">&quot;nmos1&quot;</span> <span class="keyword">operator</span>=<span class="stringliteral">&quot;OPW(Vg,Vs)&quot;</span> simulModel=<span class="stringliteral">&quot;BSIM3V3&quot;</span>&gt;</div>
<div class="line"> &lt;constraint param=<span class="stringliteral">&quot;Temp&quot;</span> ref=<span class="stringliteral">&quot;design&quot;</span> refParam=<span class="stringliteral">&quot;temp&quot;</span>/&gt;</div>
<div class="line"> &lt;constraint param=<span class="stringliteral">&quot;Ids&quot;</span> ref=<span class="stringliteral">&quot;design&quot;</span> refParam=<span class="stringliteral">&quot;Ids&quot;</span>/&gt;</div>
<div class="line"> &lt;constraint param=<span class="stringliteral">&quot;L&quot;</span> ref=<span class="stringliteral">&quot;design&quot;</span> refParam=<span class="stringliteral">&quot;L&quot;</span>/&gt;</div>
<div class="line"> &lt;constraint param=<span class="stringliteral">&quot;Vs&quot;</span> ref=<span class="stringliteral">&quot;design&quot;</span> refParam=<span class="stringliteral">&quot;Vdd&quot;</span>/&gt;</div>
<div class="line"> &lt;constraint param=<span class="stringliteral">&quot;Vg&quot;</span> ref=<span class="stringliteral">&quot;pmos1&quot;</span> refParam=<span class="stringliteral">&quot;Vg&quot;</span>/&gt;</div>
<div class="line"> &lt;constraint param=<span class="stringliteral">&quot;Vd&quot;</span> ref=<span class="stringliteral">&quot;pmos1&quot;</span> refParam=<span class="stringliteral">&quot;Vd&quot;</span>/&gt;</div>
<div class="line"> &lt;constraint param=<span class="stringliteral">&quot;another&quot;</span> refEquation=<span class="stringliteral">&quot;myEq&quot;</span> factor=<span class="stringliteral">&quot;-2.5&quot;</span>/&gt;</div>
<div class="line"> &lt;/instance&gt;</div>
<div class="line"> &lt;equations&gt;</div>
<div class="line"> &lt;eq name=<span class="stringliteral">&quot;myEq&quot;</span> equation=<span class="stringliteral">&quot;A/more+complex*equation&quot;</span>/&gt;</div>
<div class="line"> &lt;/equations&gt;</div>
<div class="line"> &lt;/sizing&gt;</div>
<div class="line"> &lt;layout&gt;</div>
<div class="line"> &lt;instance name=<span class="stringliteral">&quot;pmos1&quot;</span> style=<span class="stringliteral">&quot;Common transistor&quot;</span>/&gt;</div>
<div class="line"> &lt;instance name=<span class="stringliteral">&quot;nmos1&quot;</span> style=<span class="stringliteral">&quot;Rotate transistor&quot;</span>/&gt;</div>
<div class="line"> &lt;hbtree&gt;</div>
<div class="line"> &lt;group name=<span class="stringliteral">&quot;g1&quot;</span> align=<span class="stringliteral">&quot;vertical&quot;</span>&gt;</div>
<div class="line"> &lt;bloc name=<span class="stringliteral">&quot;nmos1&quot;</span>&gt;</div>
<div class="line"> &lt;bloc name=<span class="stringliteral">&quot;pmos1&quot;</span> position=<span class="stringliteral">&quot;top&quot;</span>/&gt;</div>
<div class="line"> &lt;/bloc&gt;</div>
<div class="line"> &lt;/group&gt;</div>
<div class="line"> &lt;/hbtree&gt;</div>
<div class="line"> &lt;/layout&gt;</div>
<div class="line">&lt;/circuit&gt;</div>
</div><!-- fragment --> <div class="fragment"><div class="line">&lt;?xml version=<span class="stringliteral">&quot;1.0&quot;</span> encoding=<span class="stringliteral">&quot;UTF-8&quot;</span>?&gt;</div>
<div class="line">&lt;circuit name=<span class="stringliteral">&quot;buffer&quot;</span> techno=<span class="stringliteral">&quot;myTech&quot;</span>&gt;</div>
<div class="line"> &lt;subCircuitsPaths&gt;</div>
<div class="line"> &lt;path path=<span class="stringliteral">&quot;.&quot;</span>/&gt;</div>
<div class="line"> &lt;/subCircuitsPaths&gt;</div>
<div class="line"> &lt;netlist&gt;</div>
<div class="line"> &lt;instances&gt;</div>
<div class="line"> &lt;instance name=<span class="stringliteral">&quot;inv1&quot;</span> model=<span class="stringliteral">&quot;inverter&quot;</span>&gt;</div>
<div class="line"> &lt;connectors&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;vdd&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;vss&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;in&quot;</span> /&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line"> &lt;/connectors&gt;</div>
<div class="line"> &lt;/instance&gt;</div>
<div class="line"> &lt;instance name=<span class="stringliteral">&quot;inv2&quot;</span> model=<span class="stringliteral">&quot;inverter&quot;</span>&gt;</div>
<div class="line"> &lt;connectors&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;vdd&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;vss&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;in&quot;</span> /&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line"> &lt;/connectors&gt;</div>
<div class="line"> &lt;/instance&gt;</div>
<div class="line"> &lt;/instances&gt;</div>
<div class="line"> &lt;nets&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;vdd&quot;</span> type=<span class="stringliteral">&quot;power&quot;</span> isExternal=<span class="stringliteral">&quot;True&quot;</span>&gt;</div>
<div class="line"> &lt;connector instance=<span class="stringliteral">&quot;inv1&quot;</span> name=<span class="stringliteral">&quot;vdd&quot;</span>/&gt;</div>
<div class="line"> &lt;connector instance=<span class="stringliteral">&quot;inv2&quot;</span> name=<span class="stringliteral">&quot;vdd&quot;</span>/&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;vss&quot;</span> type=<span class="stringliteral">&quot;ground&quot;</span> isExternal=<span class="stringliteral">&quot;True&quot;</span>&gt;</div>
<div class="line"> &lt;connector instance=<span class="stringliteral">&quot;inv1&quot;</span> name=<span class="stringliteral">&quot;vss&quot;</span>/&gt;</div>
<div class="line"> &lt;connector instance=<span class="stringliteral">&quot;inv2&quot;</span> name=<span class="stringliteral">&quot;vss&quot;</span>/&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;in&quot;</span> type=<span class="stringliteral">&quot;logical&quot;</span> isExternal=<span class="stringliteral">&quot;True&quot;</span>&gt;</div>
<div class="line"> &lt;connector instance=<span class="stringliteral">&quot;inv1&quot;</span> name=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;out&quot;</span> type=<span class="stringliteral">&quot;logical&quot;</span> isExternal=<span class="stringliteral">&quot;True&quot;</span>&gt;</div>
<div class="line"> &lt;connector instance=<span class="stringliteral">&quot;inv2&quot;</span> name=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;internal&quot;</span> type=<span class="stringliteral">&quot;logical&quot;</span> isExternal=<span class="stringliteral">&quot;False&quot;</span>&gt;</div>
<div class="line"> &lt;connector instance=<span class="stringliteral">&quot;inv1&quot;</span> name=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line"> &lt;connector instance=<span class="stringliteral">&quot;inv2&quot;</span> name=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;/nets&gt;</div>
<div class="line"> &lt;/netlist&gt;</div>
<div class="line"> &lt;schematic&gt;</div>
<div class="line"> &lt;instance name=<span class="stringliteral">&quot;inv1&quot;</span> x=<span class="stringliteral">&quot;2490&quot;</span> y=<span class="stringliteral">&quot;2600&quot;</span> orient=<span class="stringliteral">&quot;ID&quot;</span>/&gt;</div>
<div class="line"> &lt;instance name=<span class="stringliteral">&quot;inv2&quot;</span> x=<span class="stringliteral">&quot;2490&quot;</span> y=<span class="stringliteral">&quot;2300&quot;</span> orient=<span class="stringliteral">&quot;ID&quot;</span>/&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;in&quot;</span>&gt;</div>
<div class="line"> &lt;port type=<span class="stringliteral">&quot;inV&quot;</span> idx=<span class="stringliteral">&quot;0&quot;</span> x=<span class="stringliteral">&quot;2415&quot;</span> y=<span class="stringliteral">&quot;2700&quot;</span> orient=<span class="stringliteral">&quot;MY&quot;</span>/&gt;</div>
<div class="line"> &lt;wire&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;inv1&quot;</span> plug=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line"> &lt;connector idx=<span class="stringliteral">&quot;0&quot;</span>/&gt;</div>
<div class="line"> &lt;/wire&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;internal&quot;</span>&gt;</div>
<div class="line"> &lt;wire&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;inv1&quot;</span> plug=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;inv2&quot;</span> plug=<span class="stringliteral">&quot;in&quot;</span>/&gt;</div>
<div class="line"> &lt;/wire&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;out&quot;</span>&gt;</div>
<div class="line"> &lt;port type=<span class="stringliteral">&quot;outV&quot;</span> idx=<span class="stringliteral">&quot;0&quot;</span> x=<span class="stringliteral">&quot;2415&quot;</span> y=<span class="stringliteral">&quot;2200&quot;</span> orient=<span class="stringliteral">&quot;MY&quot;</span>/&gt;</div>
<div class="line"> &lt;wire&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;inv2&quot;</span> plug=<span class="stringliteral">&quot;out&quot;</span>/&gt;</div>
<div class="line"> &lt;connector idx=<span class="stringliteral">&quot;0&quot;</span>/&gt;</div>
<div class="line"> &lt;/wire&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;vdd&quot;</span>&gt;</div>
<div class="line"> &lt;port type=<span class="stringliteral">&quot;inH&quot;</span> idx=<span class="stringliteral">&quot;0&quot;</span> x=<span class="stringliteral">&quot;2200&quot;</span> y=<span class="stringliteral">&quot;2500&quot;</span> orient=<span class="stringliteral">&quot;ID&quot;</span>/&gt;</div>
<div class="line"> &lt;wire&gt;</div>
<div class="line"> &lt;connector idx=<span class="stringliteral">&quot;0&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;inv2&quot;</span> plug=<span class="stringliteral">&quot;vdd&quot;</span>/&gt;</div>
<div class="line"> &lt;/wire&gt;</div>
<div class="line"> &lt;wire&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;inv1&quot;</span> plug=<span class="stringliteral">&quot;vdd&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;inv2&quot;</span> plug=<span class="stringliteral">&quot;vdd&quot;</span>/&gt;</div>
<div class="line"> &lt;/wire&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;net name=<span class="stringliteral">&quot;vss&quot;</span>&gt;</div>
<div class="line"> &lt;port type=<span class="stringliteral">&quot;inH&quot;</span> idx=<span class="stringliteral">&quot;0&quot;</span> x=<span class="stringliteral">&quot;2700&quot;</span> y=<span class="stringliteral">&quot;2500&quot;</span> orient=<span class="stringliteral">&quot;MX&quot;</span>/&gt;</div>
<div class="line"> &lt;wire&gt;</div>
<div class="line"> &lt;connector idx=<span class="stringliteral">&quot;0&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;inv2&quot;</span> plug=<span class="stringliteral">&quot;vss&quot;</span>/&gt;</div>
<div class="line"> &lt;/wire&gt;</div>
<div class="line"> &lt;wire&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;inv1&quot;</span> plug=<span class="stringliteral">&quot;vss&quot;</span>/&gt;</div>
<div class="line"> &lt;connector name=<span class="stringliteral">&quot;inv2&quot;</span> plug=<span class="stringliteral">&quot;vss&quot;</span>/&gt;</div>
<div class="line"> &lt;/wire&gt;</div>
<div class="line"> &lt;/net&gt;</div>
<div class="line"> &lt;/schematic&gt;</div>
<div class="line">&lt;/circuit&gt;</div>
</div><!-- fragment --><p>All source codes are available in the <code>examples</code> directory.</p>
<h2><a class="anchor" id="openChamsC"></a>
C++</h2>
<h3><a class="anchor" id="openChamsParseC"></a>
Parser</h3>
<p>The following code (<code>parseOpenChams.cpp</code>) is an example of how to parse a OPENCHAMS file using C++ library. </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;map&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;vector&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/openChams/Circuit.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Name.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Parameters.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Netlist.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Instance.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Device.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Net.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Transistor.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Schematic.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Sizing.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Operator.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Layout.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Node.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Port.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Wire.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/OpenChamsException.h&quot;</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> printHBTree(<a class="code" href="class_open_chams_1_1_node.html">OpenChams::Node</a>* node, <span class="keywordtype">unsigned</span> indent) {</div>
<div class="line"> <span class="keywordflow">if</span> (!node) <span class="keywordflow">return</span>; <span class="comment">// since we pass nnode-&gt;getRight and node-getTop without checking for NULL</span></div>
<div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> i = 0 ; i &lt; indent ; i++) {</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; |&quot;</span>;</div>
<div class="line"> }</div>
<div class="line"> <span class="keywordtype">string</span> pos = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"> <span class="keywordflow">switch</span>(node-&gt;<a class="code" href="class_open_chams_1_1_node.html#a2843ffc4a8a476bc6d96d9a155d3071e">getPosition</a>()) {</div>
<div class="line"> <span class="keywordflow">case</span> OpenChams::Node::TOP:</div>
<div class="line"> pos = <span class="stringliteral">&quot;top&quot;</span>;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> OpenChams::Node::RIGHT:</div>
<div class="line"> pos = <span class="stringliteral">&quot;right&quot;</span>;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">default</span>:</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> }</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_bloc.html">OpenChams::Bloc</a>* bloc = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="class_open_chams_1_1_bloc.html">OpenChams::Bloc</a>*<span class="keyword">&gt;</span>(node);</div>
<div class="line"> <span class="keywordflow">if</span> (bloc) {</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; bloc: &quot;</span> &lt;&lt; bloc-&gt;<a class="code" href="class_open_chams_1_1_node.html#aef436e6e20d1dbf2eb78b089ca9d0794">getName</a>().getString() &lt;&lt; <span class="stringliteral">&quot; - &quot;</span> &lt;&lt; pos &lt;&lt; endl;</div>
<div class="line"> printHBTree(bloc-&gt;<a class="code" href="class_open_chams_1_1_node.html#af59967a8c2d5a04ca0a58e2ef29bead1">getTop</a>() , indent+1);</div>
<div class="line"> printHBTree(bloc-&gt;<a class="code" href="class_open_chams_1_1_node.html#a9533ddcf078ddfc2a4e9bd9ffafa51cb">getRight</a>(), indent+1);</div>
<div class="line"> <span class="keywordflow">return</span>;</div>
<div class="line"> }</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_group.html">OpenChams::Group</a>* group = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="class_open_chams_1_1_group.html">OpenChams::Group</a>*<span class="keyword">&gt;</span>(node);</div>
<div class="line"> <span class="keywordflow">if</span> (group) {</div>
<div class="line"> <span class="keywordtype">string</span> align = <span class="stringliteral">&quot;none&quot;</span>;</div>
<div class="line"> <span class="keywordflow">switch</span>(group-&gt;<a class="code" href="class_open_chams_1_1_group.html#a7cff0c4a6957f23fb1ea4598f4b8a0b8">getAlign</a>()) {</div>
<div class="line"> <span class="keywordflow">case</span> OpenChams::Group::VERTICAL:</div>
<div class="line"> align = <span class="stringliteral">&quot;vertical&quot;</span>;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> OpenChams::Group::HORIZONTAL:</div>
<div class="line"> align = <span class="stringliteral">&quot;horizontal&quot;</span>;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">default</span>:</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> }</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; group: &quot;</span> &lt;&lt; group-&gt;<a class="code" href="class_open_chams_1_1_node.html#aef436e6e20d1dbf2eb78b089ca9d0794">getName</a>().getString() &lt;&lt; <span class="stringliteral">&quot; - &quot;</span> &lt;&lt; pos &lt;&lt; <span class="stringliteral">&quot; - align: &quot;</span> &lt;&lt; align &lt;&lt; <span class="stringliteral">&quot; - isolated: &quot;</span> &lt;&lt; group-&gt;<a class="code" href="class_open_chams_1_1_group.html#ab5ae4a4550c418c974ff6e59967eeec2">isIsolated</a>() &lt;&lt; <span class="stringliteral">&quot; - paired: &quot;</span> &lt;&lt; group-&gt;<a class="code" href="class_open_chams_1_1_group.html#aee0abf07a6e9d41f511c648e6eaecea3">isPaired</a>() &lt;&lt; endl; </div>
<div class="line"> printHBTree(group-&gt;getRootNode(), indent+1);</div>
<div class="line"> printHBTree(group-&gt;<a class="code" href="class_open_chams_1_1_node.html#af59967a8c2d5a04ca0a58e2ef29bead1">getTop</a>() , indent+1);</div>
<div class="line"> printHBTree(group-&gt;<a class="code" href="class_open_chams_1_1_node.html#a9533ddcf078ddfc2a4e9bd9ffafa51cb">getRight</a>() , indent+1);</div>
<div class="line"> <span class="keywordflow">return</span>;</div>
<div class="line"> }</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot;[ERROR] printHBTree: node is nor a bloc nor a group !&quot;</span> &lt;&lt; endl;</div>
<div class="line"> <span class="keywordflow">return</span>;</div>
<div class="line">}</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"> <span class="keywordtype">string</span> file = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"> <span class="keywordflow">if</span> (argc == 1)</div>
<div class="line"> file = <span class="stringliteral">&quot;./inverter.xml&quot;</span>;</div>
<div class="line"> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (argc == 2)</div>
<div class="line"> file = argv[1];</div>
<div class="line"> <span class="keywordflow">else</span> {</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot;Usage: openChamsParser [filename]&quot;</span> &lt;&lt; endl;</div>
<div class="line"> exit(1);</div>
<div class="line"> }</div>
<div class="line"></div>
<div class="line"> <a class="code" href="class_open_chams_1_1_circuit.html">OpenChams::Circuit</a>* circuit = NULL;</div>
<div class="line"> <span class="keywordflow">try</span> {</div>
<div class="line"> circuit = <a class="code" href="class_open_chams_1_1_circuit.html#ad0aa3183bdea59e62f69c295026b7fe7">OpenChams::Circuit::readFromFile</a>(file);</div>
<div class="line"> } <span class="keywordflow">catch</span> (<a class="code" href="class_open_chams_1_1_open_chams_exception.html">OpenChams::OpenChamsException</a>&amp; e) {</div>
<div class="line"> cerr &lt;&lt; e.what() &lt;&lt; endl;</div>
<div class="line"> exit(48);</div>
<div class="line"> }</div>
<div class="line"></div>
<div class="line"> cerr &lt;&lt; circuit-&gt;<a class="code" href="class_open_chams_1_1_circuit.html#a2858c0c4e8b5108f041237cf5a802029">getName</a>().getString() &lt;&lt; endl;</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; + parameters&quot;</span> &lt;&lt; endl;</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_parameters.html">OpenChams::Parameters</a> params = circuit-&gt;<a class="code" href="class_open_chams_1_1_circuit.html#a2e51ad4344607fc279c5c8cda4edae02">getParameters</a>();</div>
<div class="line"> <span class="keywordflow">if</span> (!params.<a class="code" href="class_open_chams_1_1_parameters.html#af337ffd75e4f019ce15302c60715d84b">isEmpty</a>()) {</div>
<div class="line"> <span class="keywordflow">for</span> (map&lt;OpenChams::Name, string&gt;::const_iterator it = params.<a class="code" href="class_open_chams_1_1_parameters.html#a0f890d16c3b2a0bcbdf060854ea07877">getValues</a>().begin() ; it != params.<a class="code" href="class_open_chams_1_1_parameters.html#a0f890d16c3b2a0bcbdf060854ea07877">getValues</a>().end() ; ++it) {</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | &quot;</span> &lt;&lt; ((*it).first).getString() &lt;&lt; <span class="stringliteral">&quot; : &quot;</span> &lt;&lt; (*it).second &lt;&lt; endl;</div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; + netlist&quot;</span> &lt;&lt; endl;</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | + instances&quot;</span> &lt;&lt; endl;</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_netlist.html">OpenChams::Netlist</a>* netlist = circuit-&gt;<a class="code" href="class_open_chams_1_1_circuit.html#a4085d6a7b6958ffdd7ab5df7e6d6e53f">getNetlist</a>();</div>
<div class="line"> <span class="keywordflow">if</span> (netlist &amp;&amp; !netlist-&gt;<a class="code" href="class_open_chams_1_1_netlist.html#adab62a25face462baec9a7fffb2b6158">hasNoInstances</a>()) {</div>
<div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0 ; i &lt; netlist-&gt;<a class="code" href="class_open_chams_1_1_netlist.html#a8e6e58ffab876152a740092520c35d73">getInstances</a>().size() ; i++) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_instance.html">OpenChams::Instance</a>* inst = netlist-&gt;<a class="code" href="class_open_chams_1_1_netlist.html#a8e6e58ffab876152a740092520c35d73">getInstances</a>()[i];</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_device.html">OpenChams::Device</a>* dev = NULL;</div>
<div class="line"> <span class="keywordflow">if</span> (dynamic_cast&lt;OpenChams::Device*&gt;(inst)) {</div>
<div class="line"> dev = <span class="keyword">static_cast&lt;</span><a class="code" href="class_open_chams_1_1_device.html">OpenChams::Device</a>*<span class="keyword">&gt;</span>(inst);</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | + &quot;</span> &lt;&lt; dev-&gt;getName().getString() &lt;&lt; <span class="stringliteral">&quot; : &quot;</span> &lt;&lt; dev-&gt;getModel().getString() &lt;&lt; <span class="stringliteral">&quot; - &quot;</span> &lt;&lt; dev-&gt;getOrder() &lt;&lt; <span class="stringliteral">&quot; - &quot;</span> &lt;&lt; dev-&gt;<a class="code" href="class_open_chams_1_1_device.html#a831ce553c23908f447a5be332ecd5946">getMosType</a>().getString() &lt;&lt; <span class="stringliteral">&quot; - &quot;</span> &lt;&lt; (dev-&gt;<a class="code" href="class_open_chams_1_1_device.html#a29ed1982e1a8b3a634df8d0c70039669">isSourceBulkConnected</a>()?<span class="stringliteral">&quot;true&quot;</span>:<span class="stringliteral">&quot;false&quot;</span>) &lt;&lt; endl;</div>
<div class="line"> } <span class="keywordflow">else</span> {</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | + &quot;</span> &lt;&lt; inst-&gt;getName().getString() &lt;&lt; <span class="stringliteral">&quot; : &quot;</span> &lt;&lt; inst-&gt;getModel().getString() &lt;&lt; <span class="stringliteral">&quot; - &quot;</span> &lt;&lt; inst-&gt;getOrder() &lt;&lt; endl;</div>
<div class="line"> }</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | | + connectors&quot;</span> &lt;&lt; endl;</div>
<div class="line"> <span class="keywordflow">for</span> (map&lt;OpenChams::Name, OpenChams::Net*&gt;::const_iterator cit = inst-&gt;<a class="code" href="class_open_chams_1_1_instance.html#a745fe0a50eb770ce3bea36ef0e62c8ca">getConnectors</a>().begin() ; cit != inst-&gt;<a class="code" href="class_open_chams_1_1_instance.html#a745fe0a50eb770ce3bea36ef0e62c8ca">getConnectors</a>().end() ; ++cit) {</div>
<div class="line"> <span class="keywordflow">if</span> ((*cit).second)</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | | | &quot;</span> &lt;&lt; ((*cit).first).getString() &lt;&lt; <span class="stringliteral">&quot; : &quot;</span> &lt;&lt; ((*cit).second)-&gt;getName().getString() &lt;&lt; endl;</div>
<div class="line"> <span class="keywordflow">else</span></div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | | | &quot;</span> &lt;&lt; ((*cit).first).getString() &lt;&lt; endl; <span class="comment">// no net connected !</span></div>
<div class="line"> }</div>
<div class="line"> <span class="keywordflow">if</span> (dev) {</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | | + transistors&quot;</span> &lt;&lt; endl;</div>
<div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 0 ; j &lt; dev-&gt;<a class="code" href="class_open_chams_1_1_device.html#a4033525cab6387eb057f71f5feed9802">getTransistors</a>().size() ; j++) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_transistor.html">OpenChams::Transistor</a>* tr = dev-&gt;<a class="code" href="class_open_chams_1_1_device.html#a4033525cab6387eb057f71f5feed9802">getTransistors</a>()[j];</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | | | name: &quot;</span> &lt;&lt; tr-&gt;<a class="code" href="class_open_chams_1_1_transistor.html#a2858c0c4e8b5108f041237cf5a802029">getName</a>().getString() &lt;&lt; <span class="stringliteral">&quot; - gate: &quot;</span> &lt;&lt; tr-&gt;<a class="code" href="class_open_chams_1_1_transistor.html#a99f1449aa735ff6cb4927b4f6aa34d9d">getGate</a>().getString() &lt;&lt; <span class="stringliteral">&quot; - source: &quot;</span> &lt;&lt; tr-&gt;<a class="code" href="class_open_chams_1_1_transistor.html#aee4d52a0b13e6db247c1a6c051aede25">getSource</a>().getString() &lt;&lt; <span class="stringliteral">&quot; - drain: &quot;</span> &lt;&lt; tr-&gt;<a class="code" href="class_open_chams_1_1_transistor.html#a62ea0998b3a61310a8331873f5bcce58">getDrain</a>().getString() &lt;&lt; <span class="stringliteral">&quot; - bulk: &quot;</span> &lt;&lt; tr-&gt;<a class="code" href="class_open_chams_1_1_transistor.html#a27ba43f825f9243556ec65d306a2b1a7">getBulk</a>().getString() &lt;&lt; endl;</div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | + nets&quot;</span> &lt;&lt; endl;</div>
<div class="line"> <span class="keywordtype">bool</span> schematicNet = <span class="keyword">false</span>; <span class="comment">// define wether net sections are needed in schematic section</span></div>
<div class="line"> <span class="keywordflow">if</span> (!netlist-&gt;<a class="code" href="class_open_chams_1_1_netlist.html#a36089e1b3a3f2d3f7c9dcc8e3c3bd6d8">hasNoNets</a>()) {</div>
<div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0 ; i &lt; netlist-&gt;<a class="code" href="class_open_chams_1_1_netlist.html#abf36db82efb99a8ec8ae4b454be00019">getNets</a>().size() ; i++) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_net.html">OpenChams::Net</a>* net = netlist-&gt;<a class="code" href="class_open_chams_1_1_netlist.html#abf36db82efb99a8ec8ae4b454be00019">getNets</a>()[i];</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | + &quot;</span> &lt;&lt; net-&gt;<a class="code" href="class_open_chams_1_1_net.html#aef436e6e20d1dbf2eb78b089ca9d0794">getName</a>().getString() &lt;&lt; <span class="stringliteral">&quot; : &quot;</span> &lt;&lt; net-&gt;<a class="code" href="class_open_chams_1_1_net.html#a7a88ff26f0ba9cfbfa5059c565d1e30b">getType</a>().getString() &lt;&lt; <span class="stringliteral">&quot; - &quot;</span> &lt;&lt; (net-&gt;<a class="code" href="class_open_chams_1_1_net.html#ab2570574db49633f58f7b64099d6852c">isExternal</a>()?<span class="stringliteral">&quot;true&quot;</span>:<span class="stringliteral">&quot;false&quot;</span>) &lt;&lt; endl;</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | | + connections&quot;</span> &lt;&lt; endl;</div>
<div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 0 ; j &lt; net-&gt;<a class="code" href="class_open_chams_1_1_net.html#a87e7c71b25171dd479af0488865c8179">getConnections</a>().size() ; j++) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_net_1_1_connection.html">OpenChams::Net::Connection</a>* connect = net-&gt;<a class="code" href="class_open_chams_1_1_net.html#a87e7c71b25171dd479af0488865c8179">getConnections</a>()[j];</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | | | &quot;</span> &lt;&lt; connect-&gt;<a class="code" href="class_open_chams_1_1_net_1_1_connection.html#a44e43ff95d18d91abb9449a09e3c9d1f">getInstanceName</a>().getString() &lt;&lt; <span class="stringliteral">&quot;.&quot;</span> &lt;&lt; connect-&gt;<a class="code" href="class_open_chams_1_1_net_1_1_connection.html#a42f70d94ed3768e0342ae2bcb09ac0ed">getConnectorName</a>().getString() &lt;&lt; endl;</div>
<div class="line"> }</div>
<div class="line"> <span class="keywordflow">if</span> (!net-&gt;<a class="code" href="class_open_chams_1_1_net.html#a3eef7a6d1e945441f197f0918ab8895e">hasNoPorts</a>() || !net-&gt;<a class="code" href="class_open_chams_1_1_net.html#ac9470e72b26d4cddef3d13e69057ee54">hasNoWires</a>())</div>
<div class="line"> schematicNet = <span class="keyword">true</span>;</div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_schematic.html">OpenChams::Schematic</a>* schematic = circuit-&gt;<a class="code" href="class_open_chams_1_1_circuit.html#af6f967a5685ac92fe760f4eb95c8c51f">getSchematic</a>();</div>
<div class="line"> <span class="keywordflow">if</span> (schematic &amp;&amp; !schematic-&gt;<a class="code" href="class_open_chams_1_1_schematic.html#adab62a25face462baec9a7fffb2b6158">hasNoInstances</a>()) {</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; + schematic&quot;</span> &lt;&lt; endl;</div>
<div class="line"> <span class="keywordflow">for</span> (map&lt;OpenChams::Name, OpenChams::Schematic::Infos*&gt;::const_iterator sit = schematic-&gt;<a class="code" href="class_open_chams_1_1_schematic.html#afa015b02922d82de9c44e8ffe8dc5d56">getInstances</a>().begin() ; sit != schematic-&gt;<a class="code" href="class_open_chams_1_1_schematic.html#afa015b02922d82de9c44e8ffe8dc5d56">getInstances</a>().end() ; ++sit) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_schematic_1_1_infos.html">OpenChams::Schematic::Infos</a>* inf = (*sit).second;</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | + instance: name: &quot;</span> &lt;&lt; ((*sit).first).getString() &lt;&lt; <span class="stringliteral">&quot; - x: &quot;</span> &lt;&lt; inf-&gt;<a class="code" href="class_open_chams_1_1_schematic_1_1_infos.html#a2b69e4312b7814c6efce42f851893409">getX</a>() &lt;&lt; <span class="stringliteral">&quot; - y: &quot;</span> &lt;&lt; inf-&gt;<a class="code" href="class_open_chams_1_1_schematic_1_1_infos.html#a15f19cf52955c8c3406831b288681358">getY</a>() &lt;&lt; <span class="stringliteral">&quot; - orientation: &quot;</span> &lt;&lt; inf-&gt;<a class="code" href="class_open_chams_1_1_schematic_1_1_infos.html#ac7e0f89be2baffb526b2dca46da7aa47">getOrientation</a>().getString() &lt;&lt; endl;</div>
<div class="line"> }</div>
<div class="line"> <span class="keywordflow">if</span> (schematicNet) {</div>
<div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0 ; i &lt; netlist-&gt;<a class="code" href="class_open_chams_1_1_netlist.html#abf36db82efb99a8ec8ae4b454be00019">getNets</a>().size() ; i++) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_net.html">OpenChams::Net</a>* net = netlist-&gt;<a class="code" href="class_open_chams_1_1_netlist.html#abf36db82efb99a8ec8ae4b454be00019">getNets</a>()[i];</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | + net name: &quot;</span> &lt;&lt; net-&gt;<a class="code" href="class_open_chams_1_1_net.html#aef436e6e20d1dbf2eb78b089ca9d0794">getName</a>().getString() &lt;&lt; endl;</div>
<div class="line"> <span class="keywordflow">if</span> (!net-&gt;<a class="code" href="class_open_chams_1_1_net.html#a3eef7a6d1e945441f197f0918ab8895e">hasNoPorts</a>()) {</div>
<div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 0 ; j &lt; net-&gt;<a class="code" href="class_open_chams_1_1_net.html#ae9d241ec6dd833b6d7813e14ff2d9eca">getPorts</a>().size() ; j++) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_port.html">OpenChams::Port</a>* port = net-&gt;<a class="code" href="class_open_chams_1_1_net.html#ae9d241ec6dd833b6d7813e14ff2d9eca">getPorts</a>()[j];</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | + port type: &quot;</span> &lt;&lt; port-&gt;<a class="code" href="class_open_chams_1_1_port.html#a03950ba8678003d3a246bbd1d03cfbfb">getType</a>().getString() &lt;&lt; <span class="stringliteral">&quot; - idx: &quot;</span> &lt;&lt; port-&gt;<a class="code" href="class_open_chams_1_1_port.html#affe6668af1b3e04a80ff75e55f8024ef">getIndex</a>() &lt;&lt; <span class="stringliteral">&quot; - x: &quot;</span> &lt;&lt; port-&gt;<a class="code" href="class_open_chams_1_1_port.html#af71e522ec6aa935c2618819b54f20e02">getX</a>() &lt;&lt; <span class="stringliteral">&quot; - y: &quot;</span> &lt;&lt; port-&gt;<a class="code" href="class_open_chams_1_1_port.html#acd84440598b1da2a23c326ce371db4e4">getY</a>() &lt;&lt; <span class="stringliteral">&quot; - orientation: &quot;</span> &lt;&lt; port-&gt;<a class="code" href="class_open_chams_1_1_port.html#acbe891eaa3be07cacb7385362ab98ecc">getOrientation</a>().getString() &lt;&lt; endl;</div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"> <span class="keywordflow">if</span> (!net-&gt;<a class="code" href="class_open_chams_1_1_net.html#ac9470e72b26d4cddef3d13e69057ee54">hasNoWires</a>()) {</div>
<div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 0 ; j &lt; net-&gt;<a class="code" href="class_open_chams_1_1_net.html#a2f8bcf7cad7711850efeca408f146b8a">getWires</a>().size() ; j++) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_wire.html">OpenChams::Wire</a>* wire = net-&gt;<a class="code" href="class_open_chams_1_1_net.html#a2f8bcf7cad7711850efeca408f146b8a">getWires</a>()[j];</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | + wire &quot;</span>;</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_wire_point.html">OpenChams::WirePoint</a>* start = wire-&gt;<a class="code" href="class_open_chams_1_1_wire.html#ad68ddfcb6d4cbbe3c06d03fb4350dcdb">getStartPoint</a>();</div>
<div class="line"> <span class="keywordflow">if</span> (dynamic_cast&lt;OpenChams::InstancePoint*&gt;(start)) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_instance_point.html">OpenChams::InstancePoint</a>* iP = <span class="keyword">static_cast&lt;</span><a class="code" href="class_open_chams_1_1_instance_point.html">OpenChams::InstancePoint</a>*<span class="keyword">&gt;</span>(start);</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot;&lt;&quot;</span> &lt;&lt; iP-&gt;<a class="code" href="class_open_chams_1_1_instance_point.html#a2858c0c4e8b5108f041237cf5a802029">getName</a>().getString() &lt;&lt; <span class="stringliteral">&quot;,&quot;</span> &lt;&lt; iP-&gt;<a class="code" href="class_open_chams_1_1_instance_point.html#a646d464666fc56ab2e04a6b87fdd3279">getPlug</a>().getString() &lt;&lt; <span class="stringliteral">&quot;&gt; &quot;</span>;</div>
<div class="line"> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dynamic_cast&lt;OpenChams::PortPoint*&gt;(start)) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_port_point.html">OpenChams::PortPoint</a>* pP = <span class="keyword">static_cast&lt;</span><a class="code" href="class_open_chams_1_1_port_point.html">OpenChams::PortPoint</a>*<span class="keyword">&gt;</span>(start);</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot;&lt;&quot;</span> &lt;&lt; pP-&gt;<a class="code" href="class_open_chams_1_1_port_point.html#ab4018980dcd1fed5208e7a72846cd815">getIndex</a>() &lt;&lt; <span class="stringliteral">&quot;&gt; &quot;</span>;</div>
<div class="line"> }</div>
<div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> k = 0 ; k &lt; wire-&gt;<a class="code" href="class_open_chams_1_1_wire.html#aac2840e22e03db0ff2c0fe0f83c56fdd">getIntermediatePoints</a>().size() ; k++) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_intermediate_point.html">OpenChams::IntermediatePoint</a>* iP = wire-&gt;<a class="code" href="class_open_chams_1_1_wire.html#aac2840e22e03db0ff2c0fe0f83c56fdd">getIntermediatePoints</a>()[k];</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot;&lt;&quot;</span> &lt;&lt; iP-&gt;<a class="code" href="class_open_chams_1_1_intermediate_point.html#a2b69e4312b7814c6efce42f851893409">getX</a>() &lt;&lt; <span class="stringliteral">&quot;,&quot;</span> &lt;&lt; iP-&gt;<a class="code" href="class_open_chams_1_1_intermediate_point.html#a15f19cf52955c8c3406831b288681358">getY</a>() &lt;&lt; <span class="stringliteral">&quot;&gt; &quot;</span>;</div>
<div class="line"> }</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_wire_point.html">OpenChams::WirePoint</a>* end = wire-&gt;<a class="code" href="class_open_chams_1_1_wire.html#ab1c91025a4117cede119f53d9eb8093b">getEndPoint</a>();</div>
<div class="line"> <span class="keywordflow">if</span> (dynamic_cast&lt;OpenChams::InstancePoint*&gt;(end)) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_instance_point.html">OpenChams::InstancePoint</a>* iP = <span class="keyword">static_cast&lt;</span><a class="code" href="class_open_chams_1_1_instance_point.html">OpenChams::InstancePoint</a>*<span class="keyword">&gt;</span>(end);</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot;&lt;&quot;</span> &lt;&lt; iP-&gt;<a class="code" href="class_open_chams_1_1_instance_point.html#a2858c0c4e8b5108f041237cf5a802029">getName</a>().getString() &lt;&lt; <span class="stringliteral">&quot;,&quot;</span> &lt;&lt; iP-&gt;<a class="code" href="class_open_chams_1_1_instance_point.html#a646d464666fc56ab2e04a6b87fdd3279">getPlug</a>().getString() &lt;&lt; <span class="stringliteral">&quot;&gt; &quot;</span>;</div>
<div class="line"> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dynamic_cast&lt;OpenChams::PortPoint*&gt;(end)) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_port_point.html">OpenChams::PortPoint</a>* pP = <span class="keyword">static_cast&lt;</span><a class="code" href="class_open_chams_1_1_port_point.html">OpenChams::PortPoint</a>*<span class="keyword">&gt;</span>(end);</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot;&lt;&quot;</span> &lt;&lt; pP-&gt;<a class="code" href="class_open_chams_1_1_port_point.html#ab4018980dcd1fed5208e7a72846cd815">getIndex</a>() &lt;&lt; <span class="stringliteral">&quot;&gt; &quot;</span>;</div>
<div class="line"> }</div>
<div class="line"> cerr &lt;&lt; endl;</div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"></div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"></div>
<div class="line"> }</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_sizing.html">OpenChams::Sizing</a>* sizing = circuit-&gt;<a class="code" href="class_open_chams_1_1_circuit.html#a0ce52bc8747f684ec0123faa8ff97b6d">getSizing</a>();</div>
<div class="line"> <span class="keywordflow">if</span> (sizing) {</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; + sizing&quot;</span> &lt;&lt; endl;</div>
<div class="line"> <span class="keywordflow">if</span> (!sizing-&gt;<a class="code" href="class_open_chams_1_1_sizing.html#ac8a299add4fd32ff8bf99c889f4a79a6">hasNoOperators</a>()) {</div>
<div class="line"> <span class="keywordflow">for</span> (map&lt;OpenChams::Name, OpenChams::Operator*&gt;::const_iterator oit = sizing-&gt;<a class="code" href="class_open_chams_1_1_sizing.html#ad35c9083b30dac45186f4f0eb49b435d">getOperators</a>().begin() ; oit != sizing-&gt;<a class="code" href="class_open_chams_1_1_sizing.html#ad35c9083b30dac45186f4f0eb49b435d">getOperators</a>().end() ; ++oit) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_operator.html">OpenChams::Operator</a>* op = (*oit).second;</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | + instance name: &quot;</span> &lt;&lt; ((*oit).first).getString() &lt;&lt; <span class="stringliteral">&quot; - operator: &quot;</span> &lt;&lt; op-&gt;<a class="code" href="class_open_chams_1_1_operator.html#a2858c0c4e8b5108f041237cf5a802029">getName</a>().getString() &lt;&lt; <span class="stringliteral">&quot; - simulModel: &quot;</span> &lt;&lt; op-&gt;<a class="code" href="class_open_chams_1_1_operator.html#aa189a1b119b44a8877c478e2d2357a89">getSimulModel</a>().getString() &lt;&lt; endl;</div>
<div class="line"> <span class="keywordflow">if</span> (!op-&gt;<a class="code" href="class_open_chams_1_1_operator.html#a9ac68ad3e43b1649a8582c8685f4886d">hasNoConstraints</a>()) {</div>
<div class="line"> <span class="keywordflow">for</span> (map&lt;OpenChams::Name, OpenChams::Operator::Constraint*&gt;::const_iterator cit = op-&gt;<a class="code" href="class_open_chams_1_1_operator.html#a0002889b395185948d7c71b261343620">getConstraints</a>().begin() ; cit != op-&gt;<a class="code" href="class_open_chams_1_1_operator.html#a0002889b395185948d7c71b261343620">getConstraints</a>().end() ; ++cit) {</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_operator_1_1_constraint.html">OpenChams::Operator::Constraint</a>* cstr = (*cit).second;</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | + param: &quot;</span> &lt;&lt; ((*cit).first).getString() &lt;&lt; <span class="stringliteral">&quot; - ref: &quot;</span> &lt;&lt; cstr-&gt;<a class="code" href="class_open_chams_1_1_operator_1_1_constraint.html#a07cf74adaf661f0aaaa1818d24c2243d">getRef</a>().getString() &lt;&lt; <span class="stringliteral">&quot; - refParam: &quot;</span> &lt;&lt; cstr-&gt;<a class="code" href="class_open_chams_1_1_operator_1_1_constraint.html#a621539b1a4f31053649031c8034b0bd3">getRefParam</a>().getString() &lt;&lt; <span class="stringliteral">&quot; - factor: &quot;</span> &lt;&lt; cstr-&gt;<a class="code" href="class_open_chams_1_1_operator_1_1_constraint.html#a973fc85365f2d3f07007d88a90d7ab1d">getFactor</a>() &lt;&lt; endl;</div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"> <span class="comment">// To update to the new equations.</span></div>
<div class="line"> <span class="comment">// if (!sizing-&gt;hasNoEquations()) {</span></div>
<div class="line"> <span class="comment">// cerr &lt;&lt; &quot; | + equations&quot; &lt;&lt; endl;</span></div>
<div class="line"> <span class="comment">// for (map&lt;OpenChams::Name, string&gt;::const_iterator eit = sizing-&gt;getEquations().begin() ; eit != sizing-&gt;getEquations().end() ; ++eit) {</span></div>
<div class="line"> <span class="comment">// cerr &lt;&lt; &quot; | | &quot; &lt;&lt; ((*eit).first).getString() &lt;&lt; &quot; : &quot; &lt;&lt; (*eit).second &lt;&lt; endl;</span></div>
<div class="line"> <span class="comment">// }</span></div>
<div class="line"> <span class="comment">// }</span></div>
<div class="line"> }</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_layout.html">OpenChams::Layout</a>* layout = circuit-&gt;<a class="code" href="class_open_chams_1_1_circuit.html#a403a908943f9a3e820fd25a86d00531d">getLayout</a>();</div>
<div class="line"> <span class="keywordflow">if</span> (layout) {</div>
<div class="line"> <span class="keywordflow">if</span> (!layout-&gt;<a class="code" href="class_open_chams_1_1_layout.html#af27a31f10fcf22daa64f35c9c6bd2cda">hasNoInstance</a>()) {</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; + layout&quot;</span> &lt;&lt; endl;</div>
<div class="line"> <span class="keywordflow">for</span> (map&lt;OpenChams::Name, OpenChams::Name&gt;::const_iterator lit = layout-&gt;<a class="code" href="class_open_chams_1_1_layout.html#ab0550a9050b7e788b2a18452c9df21f7">getInstances</a>().begin() ; lit != layout-&gt;<a class="code" href="class_open_chams_1_1_layout.html#ab0550a9050b7e788b2a18452c9df21f7">getInstances</a>().end() ; ++lit) {</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | | instance name: &quot;</span> &lt;&lt; ((*lit).first).getString() &lt;&lt; <span class="stringliteral">&quot; - style: &quot;</span> &lt;&lt; ((*lit).second).getString() &lt;&lt; endl;</div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_node.html">OpenChams::Node</a>* root = layout-&gt;<a class="code" href="class_open_chams_1_1_layout.html#a13df4992219ef28a7dc014e9f5f0566a">getHBTreeRoot</a>();</div>
<div class="line"> <span class="keywordflow">if</span> (root) {</div>
<div class="line"> cerr &lt;&lt; <span class="stringliteral">&quot; | + hbtree&quot;</span> &lt;&lt; endl;</div>
<div class="line"> printHBTree(root, 2);</div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"></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 --><h3><a class="anchor" id="openChamsDriveC"></a>
Driver</h3>
<p>This C++ code (<code>driveOpenChams.cpp</code>) generates an inverter.xml file equivalent to the included one. </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/openChams/Circuit.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Netlist.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Instance.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Device.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Transistor.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Net.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Schematic.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Sizing.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Operator.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Layout.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Node.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Port.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;vlsisapd/openChams/Wire.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_open_chams_1_1_circuit.html">OpenChams::Circuit</a>* circuit = <span class="keyword">new</span> <a class="code" href="class_open_chams_1_1_circuit.html">OpenChams::Circuit</a>(OpenChams::Name(<span class="stringliteral">&quot;design&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;myTech&quot;</span>));</div>
<div class="line"> <span class="comment">// value parameters</span></div>
<div class="line"> circuit-&gt;addParameter(OpenChams::Name(<span class="stringliteral">&quot;temp&quot;</span>), <span class="stringliteral">&quot;27.0&quot;</span> );</div>
<div class="line"> circuit-&gt;addParameter(OpenChams::Name(<span class="stringliteral">&quot;Vdd&quot;</span>) , <span class="stringliteral">&quot;1.2&quot;</span> );</div>
<div class="line"> circuit-&gt;addParameter(OpenChams::Name(<span class="stringliteral">&quot;Vss&quot;</span>) , <span class="stringliteral">&quot;0.0&quot;</span> );</div>
<div class="line"> circuit-&gt;addParameter(OpenChams::Name(<span class="stringliteral">&quot;L&quot;</span>) , <span class="stringliteral">&quot;0.1e-6&quot;</span>);</div>
<div class="line"> circuit-&gt;addParameter(OpenChams::Name(<span class="stringliteral">&quot;Ids&quot;</span>) , <span class="stringliteral">&quot;30e-6&quot;</span> );</div>
<div class="line"> circuit-&gt;addParameter(OpenChams::Name(<span class="stringliteral">&quot;Veg&quot;</span>) , <span class="stringliteral">&quot;0.12&quot;</span> );</div>
<div class="line"> <span class="comment">// equation parameters</span></div>
<div class="line"> circuit-&gt;addParameter(OpenChams::Name(<span class="stringliteral">&quot;complex&quot;</span>), <span class="stringliteral">&quot;myEq&quot;</span>);</div>
<div class="line"></div>
<div class="line"> <span class="comment">// netlist</span></div>
<div class="line"> <a class="code" href="class_open_chams_1_1_netlist.html">OpenChams::Netlist</a>* netlist = circuit-&gt;<a class="code" href="class_open_chams_1_1_circuit.html#a3f11671c7ea7b4e2cc3487bd7954b667">createNetlist</a>();</div>
<div class="line"> <span class="comment">// instances</span></div>
<div class="line"> <span class="comment">// nmos1</span></div>
<div class="line"> <a class="code" href="class_open_chams_1_1_device.html">OpenChams::Device</a>* inst_nmos1 = netlist-&gt;<a class="code" href="class_open_chams_1_1_netlist.html#a8e1798a2516c32fbab629ce8d60d4b1d">addDevice</a>(OpenChams::Name(<span class="stringliteral">&quot;nmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;Transistor&quot;</span>), 1, OpenChams::Name(<span class="stringliteral">&quot;NMOS&quot;</span>), <span class="keyword">true</span>);</div>
<div class="line"> inst_nmos1-&gt;addConnector(OpenChams::Name(<span class="stringliteral">&quot;G&quot;</span>));</div>
<div class="line"> inst_nmos1-&gt;addConnector(OpenChams::Name(<span class="stringliteral">&quot;S&quot;</span>));</div>
<div class="line"> inst_nmos1-&gt;addConnector(OpenChams::Name(<span class="stringliteral">&quot;D&quot;</span>));</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_transistor.html">OpenChams::Transistor</a>* tr_nmos1 = inst_nmos1-&gt;<a class="code" href="class_open_chams_1_1_device.html#ad45d34f8765dd113a5b12289efe66c07">addTransistor</a>(OpenChams::Name(<span class="stringliteral">&quot;m1&quot;</span>));</div>
<div class="line"> tr_nmos1-&gt;<a class="code" href="class_open_chams_1_1_transistor.html#a705b53a51f0e265533b228f6e8beaf50">setGate</a> (OpenChams::Name(<span class="stringliteral">&quot;G&quot;</span>)); <span class="comment">// the name of the connector of inst_nmos1</span></div>
<div class="line"> tr_nmos1-&gt;<a class="code" href="class_open_chams_1_1_transistor.html#abc4a5d86e639ea13e27551722e2f9c17">setSource</a>(OpenChams::Name(<span class="stringliteral">&quot;S&quot;</span>));</div>
<div class="line"> tr_nmos1-&gt;<a class="code" href="class_open_chams_1_1_transistor.html#a72ff8491040e3fdc1c8bd62b2392ab82">setDrain</a> (OpenChams::Name(<span class="stringliteral">&quot;D&quot;</span>));</div>
<div class="line"> tr_nmos1-&gt;<a class="code" href="class_open_chams_1_1_transistor.html#a1484abe63e3f8ffbc2911c5230fa7091">setBulk</a> (OpenChams::Name(<span class="stringliteral">&quot;S&quot;</span>));</div>
<div class="line"> <span class="comment">// pmos1</span></div>
<div class="line"> <a class="code" href="class_open_chams_1_1_device.html">OpenChams::Device</a>* inst_pmos1 = netlist-&gt;<a class="code" href="class_open_chams_1_1_netlist.html#a8e1798a2516c32fbab629ce8d60d4b1d">addDevice</a>(OpenChams::Name(<span class="stringliteral">&quot;pmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;Transistor&quot;</span>), 2, OpenChams::Name(<span class="stringliteral">&quot;PMOS&quot;</span>), <span class="keyword">true</span>);</div>
<div class="line"> inst_pmos1-&gt;addConnector(OpenChams::Name(<span class="stringliteral">&quot;G&quot;</span>));</div>
<div class="line"> inst_pmos1-&gt;addConnector(OpenChams::Name(<span class="stringliteral">&quot;S&quot;</span>));</div>
<div class="line"> inst_pmos1-&gt;addConnector(OpenChams::Name(<span class="stringliteral">&quot;D&quot;</span>));</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_transistor.html">OpenChams::Transistor</a>* tr_pmos1 = inst_pmos1-&gt;<a class="code" href="class_open_chams_1_1_device.html#ad45d34f8765dd113a5b12289efe66c07">addTransistor</a>(OpenChams::Name(<span class="stringliteral">&quot;m1&quot;</span>));</div>
<div class="line"> tr_pmos1-&gt;<a class="code" href="class_open_chams_1_1_transistor.html#a705b53a51f0e265533b228f6e8beaf50">setGate</a> (OpenChams::Name(<span class="stringliteral">&quot;G&quot;</span>)); <span class="comment">// the name of the connector of inst_pmos1</span></div>
<div class="line"> tr_pmos1-&gt;<a class="code" href="class_open_chams_1_1_transistor.html#abc4a5d86e639ea13e27551722e2f9c17">setSource</a>(OpenChams::Name(<span class="stringliteral">&quot;S&quot;</span>));</div>
<div class="line"> tr_pmos1-&gt;<a class="code" href="class_open_chams_1_1_transistor.html#a72ff8491040e3fdc1c8bd62b2392ab82">setDrain</a> (OpenChams::Name(<span class="stringliteral">&quot;D&quot;</span>));</div>
<div class="line"> tr_pmos1-&gt;<a class="code" href="class_open_chams_1_1_transistor.html#a1484abe63e3f8ffbc2911c5230fa7091">setBulk</a> (OpenChams::Name(<span class="stringliteral">&quot;S&quot;</span>));</div>
<div class="line"> <span class="comment">// nets</span></div>
<div class="line"> <a class="code" href="class_open_chams_1_1_net.html">OpenChams::Net</a>* _vdd = netlist-&gt;<a class="code" href="class_open_chams_1_1_netlist.html#a52be455a704925328843770552eca43d">addNet</a>(OpenChams::Name(<span class="stringliteral">&quot;vdd&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;power&quot;</span>) , <span class="keyword">true</span>);</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_net.html">OpenChams::Net</a>* _vss = netlist-&gt;<a class="code" href="class_open_chams_1_1_netlist.html#a52be455a704925328843770552eca43d">addNet</a>(OpenChams::Name(<span class="stringliteral">&quot;vss&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;ground&quot;</span>) , <span class="keyword">true</span>);</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_net.html">OpenChams::Net</a>* _in = netlist-&gt;<a class="code" href="class_open_chams_1_1_netlist.html#a52be455a704925328843770552eca43d">addNet</a>(OpenChams::Name(<span class="stringliteral">&quot;in&quot;</span> ), OpenChams::Name(<span class="stringliteral">&quot;logical&quot;</span>), <span class="keyword">true</span>);</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_net.html">OpenChams::Net</a>* _out = netlist-&gt;<a class="code" href="class_open_chams_1_1_netlist.html#a52be455a704925328843770552eca43d">addNet</a>(OpenChams::Name(<span class="stringliteral">&quot;out&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;logical&quot;</span>), <span class="keyword">true</span>);</div>
<div class="line"> _vdd-&gt;<a class="code" href="class_open_chams_1_1_net.html#a40c2c019175ba3bfa4b90f4ad5d06483">connectTo</a>(OpenChams::Name(<span class="stringliteral">&quot;pmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;S&quot;</span>));</div>
<div class="line"> _vss-&gt;<a class="code" href="class_open_chams_1_1_net.html#a40c2c019175ba3bfa4b90f4ad5d06483">connectTo</a>(OpenChams::Name(<span class="stringliteral">&quot;nmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;S&quot;</span>));</div>
<div class="line"> _in-&gt;<a class="code" href="class_open_chams_1_1_net.html#a40c2c019175ba3bfa4b90f4ad5d06483">connectTo</a> (OpenChams::Name(<span class="stringliteral">&quot;nmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;G&quot;</span>));</div>
<div class="line"> _in-&gt;<a class="code" href="class_open_chams_1_1_net.html#a40c2c019175ba3bfa4b90f4ad5d06483">connectTo</a> (OpenChams::Name(<span class="stringliteral">&quot;pmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;G&quot;</span>));</div>
<div class="line"> _out-&gt;<a class="code" href="class_open_chams_1_1_net.html#a40c2c019175ba3bfa4b90f4ad5d06483">connectTo</a>(OpenChams::Name(<span class="stringliteral">&quot;nmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;D&quot;</span>));</div>
<div class="line"> _out-&gt;<a class="code" href="class_open_chams_1_1_net.html#a40c2c019175ba3bfa4b90f4ad5d06483">connectTo</a>(OpenChams::Name(<span class="stringliteral">&quot;pmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;D&quot;</span>));</div>
<div class="line"></div>
<div class="line"> <span class="comment">// schematic</span></div>
<div class="line"> <a class="code" href="class_open_chams_1_1_schematic.html">OpenChams::Schematic</a>* schematic = circuit-&gt;<a class="code" href="class_open_chams_1_1_circuit.html#a57a79a9916df4512648bb195decb7250">createSchematic</a>();</div>
<div class="line"> schematic-&gt;<a class="code" href="class_open_chams_1_1_schematic.html#ac7fc9f5cdf1e22c53d42e6606e1af8ef">addInstance</a>(OpenChams::Name(<span class="stringliteral">&quot;nmos1&quot;</span>), 2490, 2600, OpenChams::Name(<span class="stringliteral">&quot;ID&quot;</span>));</div>
<div class="line"> schematic-&gt;<a class="code" href="class_open_chams_1_1_schematic.html#ac7fc9f5cdf1e22c53d42e6606e1af8ef">addInstance</a>(OpenChams::Name(<span class="stringliteral">&quot;pmos1&quot;</span>), 2490, 2300, OpenChams::Name(<span class="stringliteral">&quot;ID&quot;</span>));</div>
<div class="line"> _vdd-&gt;<a class="code" href="class_open_chams_1_1_net.html#af395a7c9d6f3c2b24500b91260873664">addPort</a>(OpenChams::Name(<span class="stringliteral">&quot;inV&quot;</span>), 0, 2490, 2100, OpenChams::Name(<span class="stringliteral">&quot;ID&quot;</span>));</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_wire.html">OpenChams::Wire</a>* wVdd = _vdd-&gt;<a class="code" href="class_open_chams_1_1_net.html#a643a969f62770301b8b70ed63c36a55e">addWire</a>();</div>
<div class="line"> wVdd-&gt;setStartPoint(OpenChams::Name(<span class="stringliteral">&quot;pmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;S&quot;</span>));</div>
<div class="line"> wVdd-&gt;setEndPoint (0);</div>
<div class="line"> _vss-&gt;<a class="code" href="class_open_chams_1_1_net.html#af395a7c9d6f3c2b24500b91260873664">addPort</a>(OpenChams::Name(<span class="stringliteral">&quot;inV&quot;</span>), 0, 2490, 2800, OpenChams::Name(<span class="stringliteral">&quot;MY&quot;</span>));</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_wire.html">OpenChams::Wire</a>* wVss = _vss-&gt;<a class="code" href="class_open_chams_1_1_net.html#a643a969f62770301b8b70ed63c36a55e">addWire</a>();</div>
<div class="line"> wVss-&gt;setStartPoint(OpenChams::Name(<span class="stringliteral">&quot;nmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;S&quot;</span>));</div>
<div class="line"> wVss-&gt;setEndPoint (0);</div>
<div class="line"> _in-&gt;<a class="code" href="class_open_chams_1_1_net.html#af395a7c9d6f3c2b24500b91260873664">addPort</a>(OpenChams::Name(<span class="stringliteral">&quot;inH&quot;</span>), 0, 2190, 2500, OpenChams::Name(<span class="stringliteral">&quot;ID&quot;</span>));</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_wire.html">OpenChams::Wire</a>* wIn = _in-&gt;<a class="code" href="class_open_chams_1_1_net.html#a643a969f62770301b8b70ed63c36a55e">addWire</a>();</div>
<div class="line"> wIn-&gt;setStartPoint(OpenChams::Name(<span class="stringliteral">&quot;pmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;G&quot;</span>));</div>
<div class="line"> wIn-&gt;setEndPoint (OpenChams::Name(<span class="stringliteral">&quot;nmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;G&quot;</span>));</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_wire.html">OpenChams::Wire</a>* wIn1 = _in-&gt;<a class="code" href="class_open_chams_1_1_net.html#a643a969f62770301b8b70ed63c36a55e">addWire</a>();</div>
<div class="line"> wIn1-&gt;setStartPoint(0);</div>
<div class="line"> wIn1-&gt;setEndPoint (OpenChams::Name(<span class="stringliteral">&quot;pmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;G&quot;</span>));</div>
<div class="line"> _out-&gt;<a class="code" href="class_open_chams_1_1_net.html#af395a7c9d6f3c2b24500b91260873664">addPort</a>(OpenChams::Name(<span class="stringliteral">&quot;outH&quot;</span>), 0, 2600, 2500, OpenChams::Name(<span class="stringliteral">&quot;ID&quot;</span>));</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_wire.html">OpenChams::Wire</a>* wOut = _out-&gt;<a class="code" href="class_open_chams_1_1_net.html#a643a969f62770301b8b70ed63c36a55e">addWire</a>();</div>
<div class="line"> wOut-&gt;setStartPoint(OpenChams::Name(<span class="stringliteral">&quot;pmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;D&quot;</span>));</div>
<div class="line"> wOut-&gt;setEndPoint (OpenChams::Name(<span class="stringliteral">&quot;nmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;D&quot;</span>));</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_wire.html">OpenChams::Wire</a>* wOut1 = _out-&gt;<a class="code" href="class_open_chams_1_1_net.html#a643a969f62770301b8b70ed63c36a55e">addWire</a>();</div>
<div class="line"> wOut1-&gt;setStartPoint(OpenChams::Name(<span class="stringliteral">&quot;nmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;D&quot;</span>));</div>
<div class="line"> wOut1-&gt;setEndPoint (0);</div>
<div class="line"></div>
<div class="line"> <span class="comment">// sizing</span></div>
<div class="line"> <a class="code" href="class_open_chams_1_1_sizing.html">OpenChams::Sizing</a>* sizing = circuit-&gt;createSizing();</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_operator.html">OpenChams::Operator</a>* op_pmos1 = sizing-&gt;<a class="code" href="class_open_chams_1_1_sizing.html#a712e045c11e463cff8411b3d0fd7f732">addOperator</a>(OpenChams::Name(<span class="stringliteral">&quot;pmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;OPVG(Veg)&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;BSIM3V3&quot;</span>));</div>
<div class="line"> op_pmos1-&gt;addConstraint(OpenChams::Name(<span class="stringliteral">&quot;Temp&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;design&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;temp&quot;</span>));</div>
<div class="line"> op_pmos1-&gt;addConstraint(OpenChams::Name(<span class="stringliteral">&quot;Ids&quot;</span>) , OpenChams::Name(<span class="stringliteral">&quot;design&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;Ids&quot;</span>) );</div>
<div class="line"> op_pmos1-&gt;addConstraint(OpenChams::Name(<span class="stringliteral">&quot;L&quot;</span>) , OpenChams::Name(<span class="stringliteral">&quot;design&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;L&quot;</span>) );</div>
<div class="line"> op_pmos1-&gt;addConstraint(OpenChams::Name(<span class="stringliteral">&quot;Veg&quot;</span>) , OpenChams::Name(<span class="stringliteral">&quot;design&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;Veg&quot;</span>) );</div>
<div class="line"> op_pmos1-&gt;addConstraint(OpenChams::Name(<span class="stringliteral">&quot;Vd&quot;</span>) , OpenChams::Name(<span class="stringliteral">&quot;design&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;Vdd&quot;</span>) , 0.5);</div>
<div class="line"> op_pmos1-&gt;addConstraint(OpenChams::Name(<span class="stringliteral">&quot;Vs&quot;</span>) , OpenChams::Name(<span class="stringliteral">&quot;design&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;Vdd&quot;</span>) );</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_operator.html">OpenChams::Operator</a>* op_nmos1 = sizing-&gt;<a class="code" href="class_open_chams_1_1_sizing.html#a712e045c11e463cff8411b3d0fd7f732">addOperator</a>(OpenChams::Name(<span class="stringliteral">&quot;nmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;OPW(Vg,Vs)&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;BSIM3V3&quot;</span>));</div>
<div class="line"> op_nmos1-&gt;addConstraint(OpenChams::Name(<span class="stringliteral">&quot;Temp&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;design&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;temp&quot;</span>));</div>
<div class="line"> op_nmos1-&gt;addConstraint(OpenChams::Name(<span class="stringliteral">&quot;Ids&quot;</span>) , OpenChams::Name(<span class="stringliteral">&quot;design&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;Ids&quot;</span> ));</div>
<div class="line"> op_nmos1-&gt;addConstraint(OpenChams::Name(<span class="stringliteral">&quot;L&quot;</span>) , OpenChams::Name(<span class="stringliteral">&quot;design&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;L&quot;</span> ));</div>
<div class="line"> op_nmos1-&gt;addConstraint(OpenChams::Name(<span class="stringliteral">&quot;Vs&quot;</span>) , OpenChams::Name(<span class="stringliteral">&quot;design&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;Vdd&quot;</span> ));</div>
<div class="line"> op_nmos1-&gt;addConstraint(OpenChams::Name(<span class="stringliteral">&quot;Vg&quot;</span>) , OpenChams::Name(<span class="stringliteral">&quot;pmos1&quot;</span>) , OpenChams::Name(<span class="stringliteral">&quot;Vg&quot;</span> ));</div>
<div class="line"> op_nmos1-&gt;addConstraint(OpenChams::Name(<span class="stringliteral">&quot;Vd&quot;</span>) , OpenChams::Name(<span class="stringliteral">&quot;pmos1&quot;</span>) , OpenChams::Name(<span class="stringliteral">&quot;Vd&quot;</span> ));</div>
<div class="line"> op_nmos1-&gt;addConstraint(OpenChams::Name(<span class="stringliteral">&quot;another&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;myEq&quot;</span>), -2.5 );</div>
<div class="line"> <span class="comment">// layout</span></div>
<div class="line"> <a class="code" href="class_open_chams_1_1_layout.html">OpenChams::Layout</a>* layout = circuit-&gt;<a class="code" href="class_open_chams_1_1_circuit.html#a725a691b0117c4b913b54e7bfd92832f">createLayout</a>();</div>
<div class="line"> layout-&gt;<a class="code" href="class_open_chams_1_1_layout.html#a4cc1899e9b782de44700fa0e4ac477ef">addInstance</a>(OpenChams::Name(<span class="stringliteral">&quot;pmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;Common transistor&quot;</span>));</div>
<div class="line"> layout-&gt;<a class="code" href="class_open_chams_1_1_layout.html#a4cc1899e9b782de44700fa0e4ac477ef">addInstance</a>(OpenChams::Name(<span class="stringliteral">&quot;nmos1&quot;</span>), OpenChams::Name(<span class="stringliteral">&quot;Rotate transistor&quot;</span>));</div>
<div class="line"> <span class="comment">// create hbtree</span></div>
<div class="line"> <a class="code" href="class_open_chams_1_1_group.html">OpenChams::Group</a>* g1 = <span class="keyword">new</span> <a class="code" href="class_open_chams_1_1_group.html">OpenChams::Group</a>(<span class="stringliteral">&quot;g1&quot;</span>); <span class="comment">// default position is NONE and default parent is NULL</span></div>
<div class="line"> g1-&gt;<a class="code" href="class_open_chams_1_1_group.html#a9fc27b2bc4da99c723102153c4fbf1c0">setAlign</a>(OpenChams::Group::VERTICAL);</div>
<div class="line"> <a class="code" href="class_open_chams_1_1_bloc.html">OpenChams::Bloc</a>* b1 = <span class="keyword">new</span> <a class="code" href="class_open_chams_1_1_bloc.html">OpenChams::Bloc</a>(<span class="stringliteral">&quot;nmos1&quot;</span>, OpenChams::Node::NONE, g1);</div>
<div class="line"> g1-&gt;<a class="code" href="class_open_chams_1_1_group.html#adc93b900e943312e905182fe44f21225">setRootNode</a>(b1); <span class="comment">// b1 is root node of group g1</span></div>
<div class="line"> <a class="code" href="class_open_chams_1_1_bloc.html">OpenChams::Bloc</a>* b2 = <span class="keyword">new</span> <a class="code" href="class_open_chams_1_1_bloc.html">OpenChams::Bloc</a>(<span class="stringliteral">&quot;pmos1&quot;</span>, OpenChams::Node::TOP, b1);</div>
<div class="line"> b1-&gt;<a class="code" href="class_open_chams_1_1_node.html#a32e2fbbb73c6b7ee4a30189cc30106bf">setTop</a>(b2); <span class="comment">// b2 is on top of b1</span></div>
<div class="line"> layout-&gt;<a class="code" href="class_open_chams_1_1_layout.html#a6d828958e0faf1346b27276eab101858">setHBTreeRoot</a>(g1); <span class="comment">// g1 is the root of the tree</span></div>
<div class="line"></div>
<div class="line"> circuit-&gt;<a class="code" href="class_open_chams_1_1_circuit.html#a2eb07935ec946a07edcee2255b781193">writeToFile</a>(<span class="stringliteral">&quot;./myInverter.xml&quot;</span>);</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 these codes, 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="openChamsPython"></a>
Python</h2>
<h3><a class="anchor" id="openChamsParsePython"></a>
Parser</h3>
<p>The following python script (<code>parseOpenChams.py</code>) is an example of how to parse a OPENCHAMS file using python module. </p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="keyword">import</span> sys</div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;</div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="keyword">from</span> OPENCHAMS <span class="keyword">import</span> *</div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;</div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="keyword">def </span>printHBTree(node, indent):</div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160; <span class="keywordflow">if</span> node == <span class="keywordtype">None</span>:</div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160; <span class="keywordflow">return</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160; <span class="keywordflow">for</span> i <span class="keywordflow">in</span> range(indent):</div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; |&quot;</span>,</div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160; <span class="keywordflow">if</span> isinstance(node, Bloc):</div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; bloc:&quot;</span>, node.getName(), <span class="stringliteral">&quot;-&quot;</span>, node.getPosition()</div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160; printHBTree(node.top , indent+1)</div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160; printHBTree(node.right, indent+1)</div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160; <span class="keywordflow">return</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160; <span class="keywordflow">if</span> isinstance(node, Group):</div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; group:&quot;</span>, node.getName(), <span class="stringliteral">&quot;-&quot;</span>, node.getPosition(), <span class="stringliteral">&quot;-&quot;</span>, node.align, <span class="stringliteral">&quot;-&quot;</span>, node.isolated, <span class="stringliteral">&quot;-&quot;</span>, node.paired</div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160; printHBTree(node.rootNode, indent+1)</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160; printHBTree(node.top , indent+1)</div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160; printHBTree(node.right , indent+1)</div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160; <span class="keywordflow">return</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="keyword">def </span>printContents(circuit):</div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; <span class="keywordflow">print</span> circuit.name</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; <span class="comment"># circuit parameters</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; + parameters&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; <span class="keywordflow">for</span> param <span class="keywordflow">in</span> circuit.parameters.getValues():</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | |&quot;</span>, param.key, <span class="stringliteral">&quot;:&quot;</span>, param.value</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; <span class="keywordflow">for</span> param <span class="keywordflow">in</span> circuit.parameters.getEqValues():</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | |&quot;</span>, param.key, <span class="stringliteral">&quot;:&quot;</span>, param.value</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; <span class="comment"># netlist</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; + netlist&quot;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; <span class="comment"># instances</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | + instances&quot;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; <span class="keywordflow">for</span> instance <span class="keywordflow">in</span> circuit.netlist.getInstances():</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; <span class="keywordflow">if</span> isinstance(instance, Device): </div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | +&quot;</span>, instance.name, <span class="stringliteral">&quot;:&quot;</span>, instance.model, instance.order, instance.mosType, instance.sourceBulkConnected</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="keywordflow">else</span>:</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | +&quot;</span>, instance.name, <span class="stringliteral">&quot;:&quot;</span>, instance.model, instance.order</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | | + connectors&quot;</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="keywordflow">for</span> conn <span class="keywordflow">in</span> instance.getConnectors():</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | | |&quot;</span>, conn.key, <span class="stringliteral">&quot;:&quot;</span>, conn.value.name</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="keywordflow">if</span> isinstance(instance, Device): </div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | | + transistors&quot;</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <span class="keywordflow">for</span> tr <span class="keywordflow">in</span> instance.getTransistors():</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | | | name:&quot;</span>, tr.name, <span class="stringliteral">&quot;- gate:&quot;</span>, tr.gate, <span class="stringliteral">&quot;- source:&quot;</span>, tr.source, <span class="stringliteral">&quot;- drain:&quot;</span>, tr.drain, <span class="stringliteral">&quot;- bulk:&quot;</span>, tr.bulk</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="comment"># nets</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | + nets&quot;</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; schematicNet = <span class="keyword">False</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="keywordflow">for</span> net <span class="keywordflow">in</span> circuit.netlist.getNets():</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | +&quot;</span>, net.name, <span class="stringliteral">&quot;:&quot;</span>, net.type, net.external</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | | + connections&quot;</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keywordflow">for</span> conn <span class="keywordflow">in</span> net.getConnections():</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | | | %s.%s&quot;</span>%(conn.instanceName, conn.connectorName)</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keywordflow">if</span> <span class="keywordflow">not</span> net.hasNoPorts() <span class="keywordflow">or</span> <span class="keywordflow">not</span> net.hasNoWires():</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; schematicNet = <span class="keyword">True</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="comment"># schematic</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keywordflow">if</span> (circuit.schematic):</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; + schematic&quot;</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keywordflow">for</span> instance <span class="keywordflow">in</span> circuit.schematic.getInstances():</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | + instance name:&quot;</span>, instance.key, <span class="stringliteral">&quot;- x:&quot;</span>, instance.value.x, <span class="stringliteral">&quot;- y:&quot;</span>, instance.value.y, <span class="stringliteral">&quot;- orientation:&quot;</span>, instance.value.orientation </div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="keywordflow">if</span> schematicNet:</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keywordflow">for</span> net <span class="keywordflow">in</span> circuit.netlist.getNets():</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keywordflow">if</span> net.hasNoPorts() <span class="keywordflow">and</span> net.hasNoWires():</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordflow">continue</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | + net name:&quot;</span>, net.name</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordflow">for</span> port <span class="keywordflow">in</span> net.getPorts():</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | + port type:&quot;</span>, port.type, <span class="stringliteral">&quot;- idx:&quot;</span>, port.index, <span class="stringliteral">&quot;- x:&quot;</span>, port.x, <span class="stringliteral">&quot;- y:&quot;</span>, port.y, <span class="stringliteral">&quot;- orientation:&quot;</span>, port.orientation</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keywordflow">for</span> wire <span class="keywordflow">in</span> net.getWires():</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordflow">if</span> isinstance(wire.startPoint, InstancePoint):</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | + wire &lt;&quot;</span> + wire.startPoint.name.getString() + <span class="stringliteral">&quot;,&quot;</span> + wire.startPoint.plug.getString() +<span class="stringliteral">&quot;&gt;&quot;</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keywordflow">elif</span> isinstance(wire.startPoint, PortPoint):</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | + wire &lt;&quot;</span> + str(wire.startPoint.index) + <span class="stringliteral">&quot;&gt;&quot;</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">else</span>:</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; - - UNKNOWN START POINT&quot;</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keywordflow">for</span> point <span class="keywordflow">in</span> wire.getIntermediatePoints():</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | &lt;&quot;</span> + str(point.x) + <span class="stringliteral">&quot;,&quot;</span> + str(point.y) + <span class="stringliteral">&quot;&gt;&quot;</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordflow">if</span> isinstance(wire.endPoint, InstancePoint):</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | &lt;&quot;</span> + wire.endPoint.name.getString() + <span class="stringliteral">&quot;,&quot;</span> + wire.endPoint.plug.getString() +<span class="stringliteral">&quot;&gt;&quot;</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordflow">elif</span> isinstance(wire.endPoint, PortPoint):</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | &lt;&quot;</span> + str(wire.endPoint.index) + <span class="stringliteral">&quot;&gt;&quot;</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordflow">else</span>:</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; - - UNKNOWN END POINT&quot;</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="comment"># sizing</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordflow">if</span> (circuit.sizing):</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; + sizing&quot;</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keywordflow">for</span> op <span class="keywordflow">in</span> circuit.sizing.getOperators():</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | + instance name:&quot;</span>, op.key, <span class="stringliteral">&quot;- operator:&quot;</span>, op.value.name, <span class="stringliteral">&quot;- simulModel:&quot;</span>, op.value.simulModel</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keywordflow">for</span> constraint <span class="keywordflow">in</span> op.value.getConstraints():</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | + param:&quot;</span>, constraint.key, <span class="stringliteral">&quot;- ref:&quot;</span>, constraint.value.ref, <span class="stringliteral">&quot;- refParam:&quot;</span>, constraint.value.refParam, <span class="stringliteral">&quot;- factor:&quot;</span>, constraint.value.factor</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | + equations&quot;</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordflow">for</span> eq <span class="keywordflow">in</span> circuit.sizing.getEquations():</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | |&quot;</span>, eq.key, <span class="stringliteral">&quot;:&quot;</span>, eq.value</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="comment"># layout</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keywordflow">if</span> (circuit.layout):</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; + layout&quot;</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordflow">for</span> inst <span class="keywordflow">in</span> circuit.layout.getInstances():</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | | instance name:&quot;</span>, inst.key, <span class="stringliteral">&quot;- style:&quot;</span>, inst.value</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keywordflow">if</span> circuit.layout.hbTreeRoot != <span class="keywordtype">None</span>:</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot; | + hbtree&quot;</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; printHBTree(circuit.layout.hbTreeRoot, 2)</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;<span class="keyword">def </span>usage():</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot;usage:&quot;</span>, sys.argv[0], <span class="stringliteral">&quot;[filename]&quot;</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; sys.exit(48)</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;<span class="keyword">def </span>main():</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="keywordflow">if</span> len(sys.argv) == 1:</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; filename = <span class="stringliteral">&quot;./inverter.xml&quot;</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keywordflow">elif</span> len(sys.argv) == 2:</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; filename = sys.argv[1]</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">else</span>:</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; usage()</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; circuit = Circuit.readFromFile(filename)</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; printContents(circuit)</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;<span class="keywordflow">if</span> __name__ == <span class="stringliteral">&quot;__main__&quot;</span>:</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; main()</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;</div>
</div><!-- fragment --><h3><a class="anchor" id="openChamsDrivePython"></a>
Driver</h3>
<p>This python script (<code>driveOpenChams.py</code>) generates an inverter.xml file equivalent to the included one. </p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="keyword">from</span> OPENCHAMS <span class="keyword">import</span> *</div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;</div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;circuit = Circuit(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">&quot;design&quot;</span>), <a class="code" href="class_name.html">Name</a>(<span class="stringliteral">&quot;myTech&quot;</span>))</div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"># value parameters</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;circuit.addParameter(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">&quot;temp&quot;</span>), 27.0 )</div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;circuit.addParameter(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">&quot;Vdd&quot;</span>) , 1.2 )</div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;circuit.addParameter(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">&quot;Vss&quot;</span>) , 0.0 )</div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;circuit.addParameter(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">&quot;L&quot;</span>) , 0.1e-6)</div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;circuit.addParameter(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">&quot;Ids&quot;</span>) , 30e-6 )</div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;circuit.addParameter(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">&quot;Veg&quot;</span>) , 0.12 )</div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"># equation parameters</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;circuit.addParameter(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">&quot;complex&quot;</span>), <span class="stringliteral">&quot;myEq&quot;</span>)</div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;</div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"># netlist :</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;netlist = circuit.createNetlist()</div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"># instances</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"># nmos1</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;inst_nmos1 = netlist.addDevice(<span class="stringliteral">&quot;nmos1&quot;</span>, <span class="stringliteral">&quot;Transistor&quot;</span>, 1, <span class="stringliteral">&quot;NMOS&quot;</span>, <span class="keyword">True</span>)</div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;inst_nmos1.addConnector(<span class="stringliteral">&quot;G&quot;</span>)</div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;inst_nmos1.addConnector(<span class="stringliteral">&quot;S&quot;</span>)</div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;inst_nmos1.addConnector(<span class="stringliteral">&quot;D&quot;</span>)</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;tr_nmos1 = inst_nmos1.addTransistor(<span class="stringliteral">&quot;m1&quot;</span>)</div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;tr_nmos1.gate = <span class="stringliteral">&quot;G&quot;</span> <span class="comment"># the name of the connector of inst_nmos1</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;tr_nmos1.source = <span class="stringliteral">&quot;S&quot;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;tr_nmos1.drain = <span class="stringliteral">&quot;D&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;tr_nmos1.bulk = <span class="stringliteral">&quot;S&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="comment"># pmos1</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;inst_pmos1 = netlist.addDevice(<span class="stringliteral">&quot;pmos1&quot;</span>, <span class="stringliteral">&quot;Transistor&quot;</span>, 2, <span class="stringliteral">&quot;PMOS&quot;</span>, <span class="keyword">True</span>)</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;inst_pmos1.addConnector(<span class="stringliteral">&quot;G&quot;</span>)</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;inst_pmos1.addConnector(<span class="stringliteral">&quot;S&quot;</span>)</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;inst_pmos1.addConnector(<span class="stringliteral">&quot;D&quot;</span>)</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;tr_pmos1 = inst_pmos1.addTransistor(<span class="stringliteral">&quot;m1&quot;</span>)</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;tr_pmos1.gate = <span class="stringliteral">&quot;G&quot;</span> <span class="comment"># the name of the connector of inst_pmos1</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;tr_pmos1.source = <span class="stringliteral">&quot;S&quot;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;tr_pmos1.drain = <span class="stringliteral">&quot;D&quot;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;tr_pmos1.bulk = <span class="stringliteral">&quot;S&quot;</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="comment"># nets</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;_vdd = netlist.addNet(<span class="stringliteral">&quot;vdd&quot;</span>, <span class="stringliteral">&quot;power&quot;</span> , <span class="keyword">True</span>)</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;_vss = netlist.addNet(<span class="stringliteral">&quot;vss&quot;</span>, <span class="stringliteral">&quot;ground&quot;</span> , <span class="keyword">True</span>)</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;_in = netlist.addNet(<span class="stringliteral">&quot;in&quot;</span> , <span class="stringliteral">&quot;logical&quot;</span>, <span class="keyword">True</span>)</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;_out = netlist.addNet(<span class="stringliteral">&quot;out&quot;</span>, <span class="stringliteral">&quot;logical&quot;</span>, <span class="keyword">True</span>)</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;_vdd.connectTo(<span class="stringliteral">&quot;pmos1&quot;</span>, <span class="stringliteral">&quot;S&quot;</span>)</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;_vss.connectTo(<span class="stringliteral">&quot;nmos1&quot;</span>, <span class="stringliteral">&quot;S&quot;</span>)</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;_in.connectTo (<span class="stringliteral">&quot;nmos1&quot;</span>, <span class="stringliteral">&quot;G&quot;</span>)</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;_in.connectTo (<span class="stringliteral">&quot;pmos1&quot;</span>, <span class="stringliteral">&quot;G&quot;</span>)</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;_out.connectTo(<span class="stringliteral">&quot;nmos1&quot;</span>, <span class="stringliteral">&quot;D&quot;</span>)</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;_out.connectTo(<span class="stringliteral">&quot;pmos1&quot;</span>, <span class="stringliteral">&quot;D&quot;</span>)</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="comment"># schematic</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;schematic = circuit.createSchematic()</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;schematic.addInstance(<span class="stringliteral">&quot;nmos1&quot;</span>, 2490, 2600, <span class="stringliteral">&quot;ID&quot;</span>)</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;schematic.addInstance(<span class="stringliteral">&quot;pmos1&quot;</span>, 2490, 2300, <span class="stringliteral">&quot;ID&quot;</span>)</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;_vdd.addPort(<span class="stringliteral">&quot;inV&quot;</span> , 0, 2490, 2100, <span class="stringliteral">&quot;ID&quot;</span>)</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;_vss.addPort(<span class="stringliteral">&quot;inV&quot;</span> , 0, 2490, 2800, <span class="stringliteral">&quot;MY&quot;</span>)</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;_in.addPort (<span class="stringliteral">&quot;inH&quot;</span> , 0, 2190, 2500, <span class="stringliteral">&quot;ID&quot;</span>)</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;_out.addPort(<span class="stringliteral">&quot;outH&quot;</span>, 0, 2600, 2500, <span class="stringliteral">&quot;ID&quot;</span>)</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;wireVdd = _vdd.addWire()</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;wireVdd.setStartPoint(<span class="stringliteral">&quot;pmos1&quot;</span>, <span class="stringliteral">&quot;S&quot;</span>)</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;wireVdd.setEndPoint(0)</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;wireVss = _vss.addWire()</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;wireVss.setStartPoint(<span class="stringliteral">&quot;nmos1&quot;</span>, <span class="stringliteral">&quot;S&quot;</span>)</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;wireVss.setEndPoint(0)</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;wireIn0 = _in.addWire()</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;wireIn1 = _in.addWire()</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;wireIn0.setStartPoint(<span class="stringliteral">&quot;pmos1&quot;</span>, <span class="stringliteral">&quot;G&quot;</span>)</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;wireIn0.setEndPoint (<span class="stringliteral">&quot;nmos1&quot;</span>, <span class="stringliteral">&quot;G&quot;</span>)</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;wireIn1.setStartPoint(0)</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;wireIn1.setEndPoint (<span class="stringliteral">&quot;pmos1&quot;</span>, <span class="stringliteral">&quot;G&quot;</span>)</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;wireOut0 = _out.addWire()</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;wireOut1 = _out.addWire()</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;wireOut0.setStartPoint(<span class="stringliteral">&quot;pmos1&quot;</span>, <span class="stringliteral">&quot;D&quot;</span>)</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;wireOut0.setEndPoint (<span class="stringliteral">&quot;nmos1&quot;</span>, <span class="stringliteral">&quot;D&quot;</span>)</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;wireOut1.setStartPoint(<span class="stringliteral">&quot;nmos1&quot;</span>, <span class="stringliteral">&quot;D&quot;</span>)</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;wireOut1.setEndPoint (0)</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="comment"># sizing</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;sizing = circuit.createSizing()</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;op_pmos1 = sizing.addOperator(<span class="stringliteral">&quot;pmos1&quot;</span>, <span class="stringliteral">&quot;OPVG(Veg)&quot;</span> , <span class="stringliteral">&quot;BSIM3V3&quot;</span>)</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;op_pmos1.addConstraint(<span class="stringliteral">&quot;Temp&quot;</span>, <span class="stringliteral">&quot;design&quot;</span>, <span class="stringliteral">&quot;temp&quot;</span>)</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;op_pmos1.addConstraint(<span class="stringliteral">&quot;Ids&quot;</span> , <span class="stringliteral">&quot;design&quot;</span>, <span class="stringliteral">&quot;Ids&quot;</span> )</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;op_pmos1.addConstraint(<span class="stringliteral">&quot;L&quot;</span> , <span class="stringliteral">&quot;design&quot;</span>, <span class="stringliteral">&quot;L&quot;</span> )</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;op_pmos1.addConstraint(<span class="stringliteral">&quot;Veg&quot;</span> , <span class="stringliteral">&quot;design&quot;</span>, <span class="stringliteral">&quot;Veg&quot;</span> )</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;op_pmos1.addConstraint(<span class="stringliteral">&quot;Vd&quot;</span> , <span class="stringliteral">&quot;design&quot;</span>, <span class="stringliteral">&quot;Vdd&quot;</span>, 0.5)</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;op_pmos1.addConstraint(<span class="stringliteral">&quot;Vs&quot;</span> , <span class="stringliteral">&quot;design&quot;</span>, <span class="stringliteral">&quot;Vdd&quot;</span> )</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;op_nmos1 = sizing.addOperator(<span class="stringliteral">&quot;nmos1&quot;</span>, <span class="stringliteral">&quot;OPW(Vg,Vs)&quot;</span>, <span class="stringliteral">&quot;BSIM3V3&quot;</span>)</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;op_nmos1.addConstraint(<span class="stringliteral">&quot;Temp&quot;</span>, <span class="stringliteral">&quot;design&quot;</span>, <span class="stringliteral">&quot;temp&quot;</span>)</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;op_nmos1.addConstraint(<span class="stringliteral">&quot;Ids&quot;</span> , <span class="stringliteral">&quot;design&quot;</span>, <span class="stringliteral">&quot;Ids&quot;</span> )</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;op_nmos1.addConstraint(<span class="stringliteral">&quot;L&quot;</span> , <span class="stringliteral">&quot;design&quot;</span>, <span class="stringliteral">&quot;L&quot;</span> )</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;op_nmos1.addConstraint(<span class="stringliteral">&quot;Vs&quot;</span> , <span class="stringliteral">&quot;design&quot;</span>, <span class="stringliteral">&quot;Vdd&quot;</span> )</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;op_nmos1.addConstraint(<span class="stringliteral">&quot;Vg&quot;</span> , <span class="stringliteral">&quot;pmos1&quot;</span> , <span class="stringliteral">&quot;Vg&quot;</span> )</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;op_nmos1.addConstraint(<span class="stringliteral">&quot;Vd&quot;</span> , <span class="stringliteral">&quot;pmos1&quot;</span> , <span class="stringliteral">&quot;Vd&quot;</span> )</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;op_nmos1.addConstraint(<span class="stringliteral">&quot;another&quot;</span>, <span class="stringliteral">&quot;myEq&quot;</span>, -2.5 )</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;<span class="comment"># layout</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;layout = circuit.createLayout()</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;layout.addInstance(<span class="stringliteral">&quot;pmos1&quot;</span>, <span class="stringliteral">&quot;Common transistor&quot;</span>)</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;layout.addInstance(<span class="stringliteral">&quot;nmos1&quot;</span>, <span class="stringliteral">&quot;Rotate transistor&quot;</span>)</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;<span class="comment"># create hbtree</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;g1 = Group(<span class="stringliteral">&quot;g1&quot;</span>)</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;g1.align = Group.Align.VERTICAL</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;b1 = Bloc(<span class="stringliteral">&quot;nmos1&quot;</span>, Node.Position.NONE, g1)</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;g1.rootNode = b1 </div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;b2 = Bloc(<span class="stringliteral">&quot;pmos1&quot;</span>, Node.Position.TOP, b1)</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;b1.top = b2</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;layout.hbTreeRoot = g1</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;circuit.writeToFile(<span class="stringliteral">&quot;./myInverter.xml&quot;</span>)</div>
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>In order to run these two scripts (<code>parseOpenChams.py</code> &amp; driveOpenChams.py), user must ensure that $PYTHONPATH variable points to the directory containing OPENCHAMS.so module. </dd></dl>
</div></div><!-- contents -->
<br>
<hr>
<table class="footer1">
<tr>
<td class="LFooter"><small>Generated by doxygen 1.8.5 on Mon Oct 1 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>