121 lines
138 KiB
HTML
121 lines
138 KiB
HTML
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||
<title>VLSI SAPD Documentation</title>
|
||
<link href="stylesheet.css" rel="stylesheet" type="text/css">
|
||
</head>
|
||
<h1 id="pagetop" class="header">VLSI SAPD Documentation</h1>
|
||
<center class="header">
|
||
<table class="header">
|
||
<tr>
|
||
<td><a href="index.html">Presentation</a></td>
|
||
<td><a href="agds.html">AGDS</a></td>
|
||
<td><a href="cif.html">CIF</a></td>
|
||
<td><a href="dtr.html">DTR</a></td>
|
||
<td><a href="openchams.html">OPENCHAMS</a></td>
|
||
<td><a href="spice.html">SPICE</a></td>
|
||
<td><a href="contact.html">Links & Contact</a></td>
|
||
</tr>
|
||
</table>
|
||
</center>
|
||
<br>
|
||
<hr>
|
||
<body>
|
||
<!-- Generated by Doxygen 1.8.14 -->
|
||
</div><!-- top -->
|
||
<div class="header">
|
||
<div class="headertitle">
|
||
<div class="title">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"><?<span class="keyword">xml</span> <span class="keyword">version</span>=<span class="stringliteral">"1.0"</span> <span class="keyword">encoding</span>=<span class="stringliteral">"UTF-8"</span>?></div><div class="line"><<span class="keywordtype">circuit</span> <span class="keyword">name</span>=<span class="stringliteral">"inverter"</span> <span class="keyword">techno</span>=<span class="stringliteral">"myTech"</span>></div><div class="line"> <<span class="keywordtype">parameters</span>></div><div class="line"> <<span class="keywordtype">parameter</span> <span class="keyword">name</span>=<span class="stringliteral">"temp"</span> <span class="keyword">value</span>=<span class="stringliteral">"27.0"</span>/></div><div class="line"> <<span class="keywordtype">parameter</span> <span class="keyword">name</span>=<span class="stringliteral">"Vdd"</span> <span class="keyword">value</span>=<span class="stringliteral">"1.2"</span>/></div><div class="line"> <<span class="keywordtype">parameter</span> <span class="keyword">name</span>=<span class="stringliteral">"Vss"</span> <span class="keyword">value</span>=<span class="stringliteral">"0.0"</span>/></div><div class="line"> <<span class="keywordtype">parameter</span> <span class="keyword">name</span>=<span class="stringliteral">"L"</span> <span class="keyword">value</span>=<span class="stringliteral">"0.10e-6"</span>/></div><div class="line"> <<span class="keywordtype">parameter</span> <span class="keyword">name</span>=<span class="stringliteral">"Ids"</span> <span class="keyword">value</span>=<span class="stringliteral">"30e-6"</span>/></div><div class="line"> <<span class="keywordtype">parameter</span> <span class="keyword">name</span>=<span class="stringliteral">"Veg"</span> <span class="keyword">value</span>=<span class="stringliteral">"0.12"</span>/></div><div class="line"> <<span class="keywordtype">parameterEq</span> <span class="keyword">name</span>=<span class="stringliteral">"complex"</span> <span class="keyword">equation</span>=<span class="stringliteral">"myEq"</span>/></div><div class="line"> </<span class="keywordtype">parameters</span>></div><div class="line"> <<span class="keywordtype">netlist</span>></div><div class="line"> <<span class="keywordtype">instances</span>></div><div class="line"> <<span class="keywordtype">instance</span> <span class="keyword">name</span>=<span class="stringliteral">"nmos1"</span> <span class="keyword">model</span>=<span class="stringliteral">"Transistor"</span> <span class="keyword">order</span>=<span class="stringliteral">"1"</span> <span class="keyword">mostype</span>=<span class="stringliteral">"NMOS"</span> <span class="keyword">sourceBulkConnected</span>=<span class="stringliteral">"True"</span>></div><div class="line"> <<span class="keywordtype">connectors</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"G"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"D"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"S"</span>/></div><div class="line"> </<span class="keywordtype">connectors</span>></div><div class="line"> <<span class="keywordtype">transistors</span>></div><div class="line"> <<span class="keywordtype">transistor</span> <span class="keyword">name</span>=<span class="stringliteral">"m1"</span>></div><div class="line"> <<span class="keywordtype">connection</span> <span class="keyword">gate</span>=<span class="stringliteral">"G"</span> <span class="keyword">source</span>=<span class="stringliteral">"S"</span> <span class="keyword">drain</span>=<span class="stringliteral">"D"</span> <span class="keyword">bulk</span>=<span class="stringliteral">"S"</span>/></div><div class="line"> </<span class="keywordtype">transistor</span>></div><div class="line"> </<span class="keywordtype">transistors</span>></div><div class="line"> </<span class="keywordtype">instance</span>></div><div class="line"> <<span class="keywordtype">instance</span> <span class="keyword">name</span>=<span class="stringliteral">"pmos1"</span> <span class="keyword">model</span>=<span class="stringliteral">"Transistor"</span> <span class="keyword">order</span>=<span class="stringliteral">"2"</span> <span class="keyword">mostype</span>=<span class="stringliteral">"PMOS"</span> <span class="keyword">sourceBulkConnected</span>=<span class="stringliteral">"True"</span>></div><div class="line"> <<span class="keywordtype">connectors</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"G"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"D"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"S"</span>/></div><div class="line"> </<span class="keywordtype">connectors</span>></div><div class="line"> <<span class="keywordtype">transistors</span>></div><div class="line"> <<span class="keywordtype">transistor</span> <span class="keyword">name</span>=<span class="stringliteral">"m1"</span>></div><div class="line"> <<span class="keywordtype">connection</span> <span class="keyword">gate</span>=<span class="stringliteral">"G"</span> <span class="keyword">source</span>=<span class="stringliteral">"S"</span> <span class="keyword">drain</span>=<span class="stringliteral">"D"</span> <span class="keyword">bulk</span>=<span class="stringliteral">"S"</span>/></div><div class="line"> </<span class="keywordtype">transistor</span>></div><div class="line"> </<span class="keywordtype">transistors</span>></div><div class="line"> </<span class="keywordtype">instance</span>></div><div class="line"> </<span class="keywordtype">instances</span>></div><div class="line"> <<span class="keywordtype">nets</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"vdd"</span> <span class="keyword">type</span>=<span class="stringliteral">"power"</span> <span class="keyword">isExternal</span>=<span class="stringliteral">"True"</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">instance</span>=<span class="stringliteral">"pmos1"</span> <span class="keyword">name</span>=<span class="stringliteral">"S"</span>/></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"vss"</span> <span class="keyword">type</span>=<span class="stringliteral">"ground"</span> <span class="keyword">isExternal</span>=<span class="stringliteral">"True"</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">instance</span>=<span class="stringliteral">"nmos1"</span> <span class="keyword">name</span>=<span class="stringliteral">"S"</span>/></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"in"</span> <span class="keyword">type</span>=<span class="stringliteral">"logical"</span> <span class="keyword">isExternal</span>=<span class="stringliteral">"True"</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">instance</span>=<span class="stringliteral">"nmos1"</span> <span class="keyword">name</span>=<span class="stringliteral">"G"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">instance</span>=<span class="stringliteral">"pmos1"</span> <span class="keyword">name</span>=<span class="stringliteral">"G"</span>/></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"out"</span> <span class="keyword">type</span>=<span class="stringliteral">"logical"</span> <span class="keyword">isExternal</span>=<span class="stringliteral">"True"</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">instance</span>=<span class="stringliteral">"nmos1"</span> <span class="keyword">name</span>=<span class="stringliteral">"D"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">instance</span>=<span class="stringliteral">"pmos1"</span> <span class="keyword">name</span>=<span class="stringliteral">"D"</span>/></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> </<span class="keywordtype">nets</span>></div><div class="line"> </<span class="keywordtype">netlist</span>></div><div class="line"> <<span class="keywordtype">schematic</span>></div><div class="line"> <<span class="keywordtype">instance</span> <span class="keyword">name</span>=<span class="stringliteral">"nmos1"</span> <span class="keyword">x</span>=<span class="stringliteral">"2490"</span> <span class="keyword">y</span>=<span class="stringliteral">"2600"</span> <span class="keyword">orient</span>=<span class="stringliteral">"ID"</span>/></div><div class="line"> <<span class="keywordtype">instance</span> <span class="keyword">name</span>=<span class="stringliteral">"pmos1"</span> <span class="keyword">x</span>=<span class="stringliteral">"2490"</span> <span class="keyword">y</span>=<span class="stringliteral">"2490"</span> <span class="keyword">orient</span>=<span class="stringliteral">"ID"</span>/></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"vdd"</span>></div><div class="line"> <<span class="keywordtype">port</span> <span class="keyword">type</span>=<span class="stringliteral">"inV"</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span> <span class="keyword">x</span>=<span class="stringliteral">"2525"</span> <span class="keyword">y</span>=<span class="stringliteral">"2430"</span> <span class="keyword">orient</span>=<span class="stringliteral">"ID"</span>/></div><div class="line"> <<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"pmos1"</span> <span class="keyword">plug</span>=<span class="stringliteral">"S"</span>/></div><div class="line"> <span class="comment"><!--point x="" y=""/--></span></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span>/></div><div class="line"> </<span class="keywordtype">wire</span>></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"vss"</span>></div><div class="line"> <<span class="keywordtype">port</span> <span class="keyword">type</span>=<span class="stringliteral">"inV"</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span> <span class="keyword">x</span>=<span class="stringliteral">"2525"</span> <span class="keyword">y</span>=<span class="stringliteral">"2740"</span> <span class="keyword">orient</span>=<span class="stringliteral">"MY"</span>/></div><div class="line"> <<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"nmos1"</span> <span class="keyword">plug</span>=<span class="stringliteral">"S"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span>/></div><div class="line"> </<span class="keywordtype">wire</span>></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"in"</span>></div><div class="line"> <<span class="keywordtype">port</span> <span class="keyword">type</span>=<span class="stringliteral">"inH"</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span> <span class="keyword">x</span>=<span class="stringliteral">"2415"</span> <span class="keyword">y</span>=<span class="stringliteral">"2520"</span> <span class="keyword">orient</span>=<span class="stringliteral">"ID"</span>/></div><div class="line"> <<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"pmos1"</span> <span class="keyword">plug</span>=<span class="stringliteral">"G"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"nmos1"</span> <span class="keyword">plug</span>=<span class="stringliteral">"G"</span>/></div><div class="line"> </<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"pmos1"</span> <span class="keyword">plug</span>=<span class="stringliteral">"G"</span>/></div><div class="line"> </<span class="keywordtype">wire</span>></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"out"</span>></div><div class="line"> <<span class="keywordtype">port</span> <span class="keyword">type</span>=<span class="stringliteral">"outH"</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span> <span class="keyword">x</span>=<span class="stringliteral">"2570"</span> <span class="keyword">y</span>=<span class="stringliteral">"2590"</span> <span class="keyword">orient</span>=<span class="stringliteral">"ID"</span>/></div><div class="line"> <<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"pmos1"</span> <span class="keyword">plug</span>=<span class="stringliteral">"D"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"nmos1"</span> <span class="keyword">plug</span>=<span class="stringliteral">"D"</span>/></div><div class="line"> </<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"nmos1"</span> <span class="keyword">plug</span>=<span class="stringliteral">"D"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span>/></div><div class="line"> </<span class="keywordtype">wire</span>></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> </<span class="keywordtype">schematic</span>></div><div class="line"> <<span class="keywordtype">sizing</span>></div><div class="line"> <<span class="keywordtype">instance</span> <span class="keyword">name</span>=<span class="stringliteral">"pmos1"</span> <span class="keyword">operator</span>=<span class="stringliteral">"OPVG(Veg)"</span> <span class="keyword">simulModel</span>=<span class="stringliteral">"BSIM3V3"</span>></div><div class="line"> <<span class="keywordtype">constraint</span> <span class="keyword">param</span>=<span class="stringliteral">"Temp"</span> <span class="keyword">ref</span>=<span class="stringliteral">"design"</span> <span class="keyword">refParam</span>=<span class="stringliteral">"temp"</span>/></div><div class="line"> <<span class="keywordtype">constraint</span> <span class="keyword">param</span>=<span class="stringliteral">"Ids"</span> <span class="keyword">ref</span>=<span class="stringliteral">"design"</span> <span class="keyword">refParam</span>=<span class="stringliteral">"Ids"</span>/></div><div class="line"> <<span class="keywordtype">constraint</span> <span class="keyword">param</span>=<span class="stringliteral">"L"</span> <span class="keyword">ref</span>=<span class="stringliteral">"design"</span> <span class="keyword">refParam</span>=<span class="stringliteral">"L"</span>/></div><div class="line"> <<span class="keywordtype">constraint</span> <span class="keyword">param</span>=<span class="stringliteral">"Veg"</span> <span class="keyword">ref</span>=<span class="stringliteral">"design"</span> <span class="keyword">refParam</span>=<span class="stringliteral">"Veg"</span>/></div><div class="line"> <<span class="keywordtype">constraint</span> <span class="keyword">param</span>=<span class="stringliteral">"Vd"</span> <span class="keyword">ref</span>=<span class="stringliteral">"design"</span> <span class="keyword">refParam</span>=<span class="stringliteral">"Vdd"</span> <span class="keyword">factor</span>=<span class="stringliteral">"0.5"</span>/></div><div class="line"> <<span class="keywordtype">constraint</span> <span class="keyword">param</span>=<span class="stringliteral">"Vs"</span> <span class="keyword">ref</span>=<span class="stringliteral">"design"</span> <span class="keyword">refParam</span>=<span class="stringliteral">"Vdd"</span>/></div><div class="line"> </<span class="keywordtype">instance</span>></div><div class="line"> <<span class="keywordtype">instance</span> <span class="keyword">name</span>=<span class="stringliteral">"nmos1"</span> <span class="keyword">operator</span>=<span class="stringliteral">"OPW(Vg,Vs)"</span> <span class="keyword">simulModel</span>=<span class="stringliteral">"BSIM3V3"</span>></div><div class="line"> <<span class="keywordtype">constraint</span> <span class="keyword">param</span>=<span class="stringliteral">"Temp"</span> <span class="keyword">ref</span>=<span class="stringliteral">"design"</span> <span class="keyword">refParam</span>=<span class="stringliteral">"temp"</span>/></div><div class="line"> <<span class="keywordtype">constraint</span> <span class="keyword">param</span>=<span class="stringliteral">"Ids"</span> <span class="keyword">ref</span>=<span class="stringliteral">"design"</span> <span class="keyword">refParam</span>=<span class="stringliteral">"Ids"</span>/></div><div class="line"> <<span class="keywordtype">constraint</span> <span class="keyword">param</span>=<span class="stringliteral">"L"</span> <span class="keyword">ref</span>=<span class="stringliteral">"design"</span> <span class="keyword">refParam</span>=<span class="stringliteral">"L"</span>/></div><div class="line"> <<span class="keywordtype">constraint</span> <span class="keyword">param</span>=<span class="stringliteral">"Vs"</span> <span class="keyword">ref</span>=<span class="stringliteral">"design"</span> <span class="keyword">refParam</span>=<span class="stringliteral">"Vdd"</span>/></div><div class="line"> <<span class="keywordtype">constraint</span> <span class="keyword">param</span>=<span class="stringliteral">"Vg"</span> <span class="keyword">ref</span>=<span class="stringliteral">"pmos1"</span> <span class="keyword">refParam</span>=<span class="stringliteral">"Vg"</span>/></div><div class="line"> <<span class="keywordtype">constraint</span> <span class="keyword">param</span>=<span class="stringliteral">"Vd"</span> <span class="keyword">ref</span>=<span class="stringliteral">"pmos1"</span> <span class="keyword">refParam</span>=<span class="stringliteral">"Vd"</span>/></div><div class="line"> <<span class="keywordtype">constraint</span> <span class="keyword">param</span>=<span class="stringliteral">"another"</span> <span class="keyword">refEquation</span>=<span class="stringliteral">"myEq"</span> <span class="keyword">factor</span>=<span class="stringliteral">"-2.5"</span>/></div><div class="line"> </<span class="keywordtype">instance</span>></div><div class="line"> <<span class="keywordtype">equations</span>></div><div class="line"> <<span class="keywordtype">eq</span> <span class="keyword">name</span>=<span class="stringliteral">"myEq"</span> <span class="keyword">equation</span>=<span class="stringliteral">"A/more+complex*equation"</span>/></div><div class="line"> </<span class="keywordtype">equations</span>></div><div class="line"> </<span class="keywordtype">sizing</span>></div><div class="line"> <<span class="keywordtype">layout</span>></div><div class="line"> <<span class="keywordtype">instance</span> <span class="keyword">name</span>=<span class="stringliteral">"pmos1"</span> <span class="keyword">style</span>=<span class="stringliteral">"Common transistor"</span>/></div><div class="line"> <<span class="keywordtype">instance</span> <span class="keyword">name</span>=<span class="stringliteral">"nmos1"</span> <span class="keyword">style</span>=<span class="stringliteral">"Rotate transistor"</span>/></div><div class="line"> <<span class="keywordtype">hbtree</span>></div><div class="line"> <<span class="keywordtype">group</span> <span class="keyword">name</span>=<span class="stringliteral">"g1"</span> <span class="keyword">align</span>=<span class="stringliteral">"vertical"</span>></div><div class="line"> <<span class="keywordtype">bloc</span> <span class="keyword">name</span>=<span class="stringliteral">"nmos1"</span>></div><div class="line"> <<span class="keywordtype">bloc</span> <span class="keyword">name</span>=<span class="stringliteral">"pmos1"</span> <span class="keyword">position</span>=<span class="stringliteral">"top"</span>/></div><div class="line"> </<span class="keywordtype">bloc</span>></div><div class="line"> </<span class="keywordtype">group</span>></div><div class="line"> </<span class="keywordtype">hbtree</span>></div><div class="line"> </<span class="keywordtype">layout</span>></div><div class="line"></<span class="keywordtype">circuit</span>></div></div><!-- fragment --> <div class="fragment"><div class="line"><?<span class="keyword">xml</span> <span class="keyword">version</span>=<span class="stringliteral">"1.0"</span> <span class="keyword">encoding</span>=<span class="stringliteral">"UTF-8"</span>?></div><div class="line"><<span class="keywordtype">circuit</span> <span class="keyword">name</span>=<span class="stringliteral">"buffer"</span> <span class="keyword">techno</span>=<span class="stringliteral">"myTech"</span>></div><div class="line"> <<span class="keywordtype">subCircuitsPaths</span>></div><div class="line"> <<span class="keywordtype">path</span> <span class="keyword">path</span>=<span class="stringliteral">"."</span>/></div><div class="line"> </<span class="keywordtype">subCircuitsPaths</span>></div><div class="line"> <<span class="keywordtype">netlist</span>></div><div class="line"> <<span class="keywordtype">instances</span>></div><div class="line"> <<span class="keywordtype">instance</span> <span class="keyword">name</span>=<span class="stringliteral">"inv1"</span> <span class="keyword">model</span>=<span class="stringliteral">"inverter"</span>></div><div class="line"> <<span class="keywordtype">connectors</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"vdd"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"vss"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"in"</span> /></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"out"</span>/></div><div class="line"> </<span class="keywordtype">connectors</span>></div><div class="line"> </<span class="keywordtype">instance</span>></div><div class="line"> <<span class="keywordtype">instance</span> <span class="keyword">name</span>=<span class="stringliteral">"inv2"</span> <span class="keyword">model</span>=<span class="stringliteral">"inverter"</span>></div><div class="line"> <<span class="keywordtype">connectors</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"vdd"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"vss"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"in"</span> /></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"out"</span>/></div><div class="line"> </<span class="keywordtype">connectors</span>></div><div class="line"> </<span class="keywordtype">instance</span>></div><div class="line"> </<span class="keywordtype">instances</span>></div><div class="line"> <<span class="keywordtype">nets</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"vdd"</span> <span class="keyword">type</span>=<span class="stringliteral">"power"</span> <span class="keyword">isExternal</span>=<span class="stringliteral">"True"</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">instance</span>=<span class="stringliteral">"inv1"</span> <span class="keyword">name</span>=<span class="stringliteral">"vdd"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">instance</span>=<span class="stringliteral">"inv2"</span> <span class="keyword">name</span>=<span class="stringliteral">"vdd"</span>/></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"vss"</span> <span class="keyword">type</span>=<span class="stringliteral">"ground"</span> <span class="keyword">isExternal</span>=<span class="stringliteral">"True"</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">instance</span>=<span class="stringliteral">"inv1"</span> <span class="keyword">name</span>=<span class="stringliteral">"vss"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">instance</span>=<span class="stringliteral">"inv2"</span> <span class="keyword">name</span>=<span class="stringliteral">"vss"</span>/></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"in"</span> <span class="keyword">type</span>=<span class="stringliteral">"logical"</span> <span class="keyword">isExternal</span>=<span class="stringliteral">"True"</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">instance</span>=<span class="stringliteral">"inv1"</span> <span class="keyword">name</span>=<span class="stringliteral">"in"</span>/></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"out"</span> <span class="keyword">type</span>=<span class="stringliteral">"logical"</span> <span class="keyword">isExternal</span>=<span class="stringliteral">"True"</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">instance</span>=<span class="stringliteral">"inv2"</span> <span class="keyword">name</span>=<span class="stringliteral">"out"</span>/></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"internal"</span> <span class="keyword">type</span>=<span class="stringliteral">"logical"</span> <span class="keyword">isExternal</span>=<span class="stringliteral">"False"</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">instance</span>=<span class="stringliteral">"inv1"</span> <span class="keyword">name</span>=<span class="stringliteral">"out"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">instance</span>=<span class="stringliteral">"inv2"</span> <span class="keyword">name</span>=<span class="stringliteral">"in"</span>/></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> </<span class="keywordtype">nets</span>></div><div class="line"> </<span class="keywordtype">netlist</span>></div><div class="line"> <<span class="keywordtype">schematic</span>></div><div class="line"> <<span class="keywordtype">instance</span> <span class="keyword">name</span>=<span class="stringliteral">"inv1"</span> <span class="keyword">x</span>=<span class="stringliteral">"2490"</span> <span class="keyword">y</span>=<span class="stringliteral">"2600"</span> <span class="keyword">orient</span>=<span class="stringliteral">"ID"</span>/></div><div class="line"> <<span class="keywordtype">instance</span> <span class="keyword">name</span>=<span class="stringliteral">"inv2"</span> <span class="keyword">x</span>=<span class="stringliteral">"2490"</span> <span class="keyword">y</span>=<span class="stringliteral">"2300"</span> <span class="keyword">orient</span>=<span class="stringliteral">"ID"</span>/></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"in"</span>></div><div class="line"> <<span class="keywordtype">port</span> <span class="keyword">type</span>=<span class="stringliteral">"inV"</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span> <span class="keyword">x</span>=<span class="stringliteral">"2415"</span> <span class="keyword">y</span>=<span class="stringliteral">"2700"</span> <span class="keyword">orient</span>=<span class="stringliteral">"MY"</span>/></div><div class="line"> <<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"inv1"</span> <span class="keyword">plug</span>=<span class="stringliteral">"in"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span>/></div><div class="line"> </<span class="keywordtype">wire</span>></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"internal"</span>></div><div class="line"> <<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"inv1"</span> <span class="keyword">plug</span>=<span class="stringliteral">"out"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"inv2"</span> <span class="keyword">plug</span>=<span class="stringliteral">"in"</span>/></div><div class="line"> </<span class="keywordtype">wire</span>></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"out"</span>></div><div class="line"> <<span class="keywordtype">port</span> <span class="keyword">type</span>=<span class="stringliteral">"outV"</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span> <span class="keyword">x</span>=<span class="stringliteral">"2415"</span> <span class="keyword">y</span>=<span class="stringliteral">"2200"</span> <span class="keyword">orient</span>=<span class="stringliteral">"MY"</span>/></div><div class="line"> <<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"inv2"</span> <span class="keyword">plug</span>=<span class="stringliteral">"out"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span>/></div><div class="line"> </<span class="keywordtype">wire</span>></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"vdd"</span>></div><div class="line"> <<span class="keywordtype">port</span> <span class="keyword">type</span>=<span class="stringliteral">"inH"</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span> <span class="keyword">x</span>=<span class="stringliteral">"2200"</span> <span class="keyword">y</span>=<span class="stringliteral">"2500"</span> <span class="keyword">orient</span>=<span class="stringliteral">"ID"</span>/></div><div class="line"> <<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"inv2"</span> <span class="keyword">plug</span>=<span class="stringliteral">"vdd"</span>/></div><div class="line"> </<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"inv1"</span> <span class="keyword">plug</span>=<span class="stringliteral">"vdd"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"inv2"</span> <span class="keyword">plug</span>=<span class="stringliteral">"vdd"</span>/></div><div class="line"> </<span class="keywordtype">wire</span>></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> <<span class="keywordtype">net</span> <span class="keyword">name</span>=<span class="stringliteral">"vss"</span>></div><div class="line"> <<span class="keywordtype">port</span> <span class="keyword">type</span>=<span class="stringliteral">"inH"</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span> <span class="keyword">x</span>=<span class="stringliteral">"2700"</span> <span class="keyword">y</span>=<span class="stringliteral">"2500"</span> <span class="keyword">orient</span>=<span class="stringliteral">"MX"</span>/></div><div class="line"> <<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">idx</span>=<span class="stringliteral">"0"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"inv2"</span> <span class="keyword">plug</span>=<span class="stringliteral">"vss"</span>/></div><div class="line"> </<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">wire</span>></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"inv1"</span> <span class="keyword">plug</span>=<span class="stringliteral">"vss"</span>/></div><div class="line"> <<span class="keywordtype">connector</span> <span class="keyword">name</span>=<span class="stringliteral">"inv2"</span> <span class="keyword">plug</span>=<span class="stringliteral">"vss"</span>/></div><div class="line"> </<span class="keywordtype">wire</span>></div><div class="line"> </<span class="keywordtype">net</span>></div><div class="line"> </<span class="keywordtype">schematic</span>></div><div class="line"></<span class="keywordtype">circuit</span>></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 <iostream></span></div><div class="line"><span class="preprocessor">#include <string></span></div><div class="line"><span class="preprocessor">#include <map></span></div><div class="line"><span class="preprocessor">#include <vector></span></div><div class="line"><span class="keyword">using namespace </span><a class="code" href="namespacestd.html">std</a>;</div><div class="line"></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Circuit.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Name.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Parameters.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Netlist.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Instance.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Device.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Net.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Transistor.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Schematic.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Sizing.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Operator.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Layout.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Node.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Port.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Wire.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/OpenChamsException.h"</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->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 < indent ; i++) {</div><div class="line"> cerr << <span class="stringliteral">" |"</span>;</div><div class="line"> }</div><div class="line"> <span class="keywordtype">string</span> pos = <span class="stringliteral">""</span>;</div><div class="line"> <span class="keywordflow">switch</span>(node-><a class="code" href="class_open_chams_1_1_node.html#a566f4d0bebb46cfd31384a8394a7dbb9">getPosition</a>()) {</div><div class="line"> <span class="keywordflow">case</span> OpenChams::Node::TOP:</div><div class="line"> pos = <span class="stringliteral">"top"</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">"right"</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<</span><a class="code" href="class_open_chams_1_1_bloc.html">OpenChams::Bloc</a>*<span class="keyword">></span>(node);</div><div class="line"> <span class="keywordflow">if</span> (bloc) {</div><div class="line"> cerr << <span class="stringliteral">" bloc: "</span> << bloc-><a class="code" href="class_open_chams_1_1_node.html#a3fd7335faa33dce2f87c7e50eef3e294">getName</a>().getString() << <span class="stringliteral">" - "</span> << pos << endl;</div><div class="line"> printHBTree(bloc-><a class="code" href="class_open_chams_1_1_node.html#af59967a8c2d5a04ca0a58e2ef29bead1">getTop</a>() , indent+1);</div><div class="line"> printHBTree(bloc-><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<</span><a class="code" href="class_open_chams_1_1_group.html">OpenChams::Group</a>*<span class="keyword">></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">"none"</span>;</div><div class="line"> <span class="keywordflow">switch</span>(group-><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">"vertical"</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">"horizontal"</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 << <span class="stringliteral">" group: "</span> << group-><a class="code" href="class_open_chams_1_1_node.html#a3fd7335faa33dce2f87c7e50eef3e294">getName</a>().getString() << <span class="stringliteral">" - "</span> << pos << <span class="stringliteral">" - align: "</span> << align << <span class="stringliteral">" - isolated: "</span> << group-><a class="code" href="class_open_chams_1_1_group.html#ab5ae4a4550c418c974ff6e59967eeec2">isIsolated</a>() << <span class="stringliteral">" - paired: "</span> << group-><a class="code" href="class_open_chams_1_1_group.html#aee0abf07a6e9d41f511c648e6eaecea3">isPaired</a>() << endl; </div><div class="line"> printHBTree(group->getRootNode(), indent+1);</div><div class="line"> printHBTree(group-><a class="code" href="class_open_chams_1_1_node.html#af59967a8c2d5a04ca0a58e2ef29bead1">getTop</a>() , indent+1);</div><div class="line"> printHBTree(group-><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 << <span class="stringliteral">"[ERROR] printHBTree: node is nor a bloc nor a group !"</span> << 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">""</span>;</div><div class="line"> <span class="keywordflow">if</span> (argc == 1)</div><div class="line"> file = <span class="stringliteral">"./inverter.xml"</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 << <span class="stringliteral">"Usage: openChamsParser [filename]"</span> << 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>& e) {</div><div class="line"> cerr << e.what() << endl;</div><div class="line"> exit(48);</div><div class="line"> }</div><div class="line"></div><div class="line"> cerr << circuit-><a class="code" href="class_open_chams_1_1_circuit.html#a2858c0c4e8b5108f041237cf5a802029">getName</a>().getString() << endl;</div><div class="line"> cerr << <span class="stringliteral">" + parameters"</span> << endl;</div><div class="line"> <a class="code" href="class_open_chams_1_1_parameters.html">OpenChams::Parameters</a> params = circuit-><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<OpenChams::Name, string>::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 << <span class="stringliteral">" | | "</span> << ((*it).first).getString() << <span class="stringliteral">" : "</span> << (*it).second << endl;</div><div class="line"> }</div><div class="line"> }</div><div class="line"> cerr << <span class="stringliteral">" + netlist"</span> << endl;</div><div class="line"> cerr << <span class="stringliteral">" | + instances"</span> << endl;</div><div class="line"> <a class="code" href="class_open_chams_1_1_netlist.html">OpenChams::Netlist</a>* netlist = circuit-><a class="code" href="class_open_chams_1_1_circuit.html#a4085d6a7b6958ffdd7ab5df7e6d6e53f">getNetlist</a>();</div><div class="line"> <span class="keywordflow">if</span> (netlist && !netlist-><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 < netlist-><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-><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<OpenChams::Device*>(inst)) {</div><div class="line"> dev = <span class="keyword">static_cast<</span><a class="code" href="class_open_chams_1_1_device.html">OpenChams::Device</a>*<span class="keyword">></span>(inst);</div><div class="line"> cerr << <span class="stringliteral">" | | + "</span> << dev->getName().getString() << <span class="stringliteral">" : "</span> << dev->getModel().getString() << <span class="stringliteral">" - "</span> << dev->getOrder() << <span class="stringliteral">" - "</span> << dev-><a class="code" href="class_open_chams_1_1_device.html#a831ce553c23908f447a5be332ecd5946">getMosType</a>().getString() << <span class="stringliteral">" - "</span> << (dev-><a class="code" href="class_open_chams_1_1_device.html#a29ed1982e1a8b3a634df8d0c70039669">isSourceBulkConnected</a>()?<span class="stringliteral">"true"</span>:<span class="stringliteral">"false"</span>) << endl;</div><div class="line"> } <span class="keywordflow">else</span> {</div><div class="line"> cerr << <span class="stringliteral">" | | + "</span> << inst->getName().getString() << <span class="stringliteral">" : "</span> << inst->getModel().getString() << <span class="stringliteral">" - "</span> << inst->getOrder() << endl;</div><div class="line"> }</div><div class="line"> cerr << <span class="stringliteral">" | | | + connectors"</span> << endl;</div><div class="line"> <span class="keywordflow">for</span> (map<OpenChams::Name, OpenChams::Net*>::const_iterator cit = inst-><a class="code" href="class_open_chams_1_1_instance.html#a745fe0a50eb770ce3bea36ef0e62c8ca">getConnectors</a>().begin() ; cit != inst-><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 << <span class="stringliteral">" | | | | "</span> << ((*cit).first).getString() << <span class="stringliteral">" : "</span> << ((*cit).second)->getName().getString() << endl;</div><div class="line"> <span class="keywordflow">else</span></div><div class="line"> cerr << <span class="stringliteral">" | | | | "</span> << ((*cit).first).getString() << 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 << <span class="stringliteral">" | | | + transistors"</span> << endl;</div><div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 0 ; j < dev-><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-><a class="code" href="class_open_chams_1_1_device.html#a4033525cab6387eb057f71f5feed9802">getTransistors</a>()[j];</div><div class="line"> cerr << <span class="stringliteral">" | | | | name: "</span> << tr-><a class="code" href="class_open_chams_1_1_transistor.html#a2858c0c4e8b5108f041237cf5a802029">getName</a>().getString() << <span class="stringliteral">" - gate: "</span> << tr-><a class="code" href="class_open_chams_1_1_transistor.html#a99f1449aa735ff6cb4927b4f6aa34d9d">getGate</a>().getString() << <span class="stringliteral">" - source: "</span> << tr-><a class="code" href="class_open_chams_1_1_transistor.html#aee4d52a0b13e6db247c1a6c051aede25">getSource</a>().getString() << <span class="stringliteral">" - drain: "</span> << tr-><a class="code" href="class_open_chams_1_1_transistor.html#a62ea0998b3a61310a8331873f5bcce58">getDrain</a>().getString() << <span class="stringliteral">" - bulk: "</span> << tr-><a class="code" href="class_open_chams_1_1_transistor.html#a27ba43f825f9243556ec65d306a2b1a7">getBulk</a>().getString() << endl;</div><div class="line"> }</div><div class="line"> }</div><div class="line"> }</div><div class="line"> }</div><div class="line"> cerr << <span class="stringliteral">" | + nets"</span> << 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-><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 < netlist-><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-><a class="code" href="class_open_chams_1_1_netlist.html#abf36db82efb99a8ec8ae4b454be00019">getNets</a>()[i];</div><div class="line"> cerr << <span class="stringliteral">" | | + "</span> << net-><a class="code" href="class_open_chams_1_1_net.html#a3fd7335faa33dce2f87c7e50eef3e294">getName</a>().getString() << <span class="stringliteral">" : "</span> << net-><a class="code" href="class_open_chams_1_1_net.html#a7a88ff26f0ba9cfbfa5059c565d1e30b">getType</a>().getString() << <span class="stringliteral">" - "</span> << (net-><a class="code" href="class_open_chams_1_1_net.html#ab2570574db49633f58f7b64099d6852c">isExternal</a>()?<span class="stringliteral">"true"</span>:<span class="stringliteral">"false"</span>) << endl;</div><div class="line"> cerr << <span class="stringliteral">" | | | + connections"</span> << endl;</div><div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 0 ; j < net-><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-><a class="code" href="class_open_chams_1_1_net.html#a87e7c71b25171dd479af0488865c8179">getConnections</a>()[j];</div><div class="line"> cerr << <span class="stringliteral">" | | | | "</span> << connect-><a class="code" href="class_open_chams_1_1_net_1_1_connection.html#a7d21af8ef567328876b39f135d6c94ca">getInstanceName</a>().getString() << <span class="stringliteral">"."</span> << connect-><a class="code" href="class_open_chams_1_1_net_1_1_connection.html#a33e7a2599cd477f8190c85d2aba9ce88">getConnectorName</a>().getString() << endl;</div><div class="line"> }</div><div class="line"> <span class="keywordflow">if</span> (!net-><a class="code" href="class_open_chams_1_1_net.html#a3eef7a6d1e945441f197f0918ab8895e">hasNoPorts</a>() || !net-><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-><a class="code" href="class_open_chams_1_1_circuit.html#af6f967a5685ac92fe760f4eb95c8c51f">getSchematic</a>();</div><div class="line"> <span class="keywordflow">if</span> (schematic && !schematic-><a class="code" href="class_open_chams_1_1_schematic.html#adab62a25face462baec9a7fffb2b6158">hasNoInstances</a>()) {</div><div class="line"> cerr << <span class="stringliteral">" + schematic"</span> << endl;</div><div class="line"> <span class="keywordflow">for</span> (map<OpenChams::Name, OpenChams::Schematic::Infos*>::const_iterator sit = schematic-><a class="code" href="class_open_chams_1_1_schematic.html#afa015b02922d82de9c44e8ffe8dc5d56">getInstances</a>().begin() ; sit != schematic-><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 << <span class="stringliteral">" | + instance: name: "</span> << ((*sit).first).getString() << <span class="stringliteral">" - x: "</span> << inf-><a class="code" href="class_open_chams_1_1_schematic_1_1_infos.html#a2b69e4312b7814c6efce42f851893409">getX</a>() << <span class="stringliteral">" - y: "</span> << inf-><a class="code" href="class_open_chams_1_1_schematic_1_1_infos.html#a15f19cf52955c8c3406831b288681358">getY</a>() << <span class="stringliteral">" - orientation: "</span> << inf-><a class="code" href="class_open_chams_1_1_schematic_1_1_infos.html#ac7e0f89be2baffb526b2dca46da7aa47">getOrientation</a>().getString() << 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 < netlist-><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-><a class="code" href="class_open_chams_1_1_netlist.html#abf36db82efb99a8ec8ae4b454be00019">getNets</a>()[i];</div><div class="line"> cerr << <span class="stringliteral">" | + net name: "</span> << net-><a class="code" href="class_open_chams_1_1_net.html#a3fd7335faa33dce2f87c7e50eef3e294">getName</a>().getString() << endl;</div><div class="line"> <span class="keywordflow">if</span> (!net-><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 < net-><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-><a class="code" href="class_open_chams_1_1_net.html#ae9d241ec6dd833b6d7813e14ff2d9eca">getPorts</a>()[j];</div><div class="line"> cerr << <span class="stringliteral">" | | + port type: "</span> << port-><a class="code" href="class_open_chams_1_1_port.html#a49fc4eb493558cf55dd00df9ef5f8f08">getType</a>().getString() << <span class="stringliteral">" - idx: "</span> << port-><a class="code" href="class_open_chams_1_1_port.html#a743f20da85b9a06d9984c0adc337afc1">getIndex</a>() << <span class="stringliteral">" - x: "</span> << port-><a class="code" href="class_open_chams_1_1_port.html#a344385751bee0720059403940d57a13e">getX</a>() << <span class="stringliteral">" - y: "</span> << port-><a class="code" href="class_open_chams_1_1_port.html#aafa51c7f8f38a09febbb9ce7853f77b4">getY</a>() << <span class="stringliteral">" - orientation: "</span> << port-><a class="code" href="class_open_chams_1_1_port.html#ace51e4bf9cee0319600c14723efa0dfb">getOrientation</a>().getString() << endl;</div><div class="line"> }</div><div class="line"> }</div><div class="line"> <span class="keywordflow">if</span> (!net-><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 < net-><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-><a class="code" href="class_open_chams_1_1_net.html#a2f8bcf7cad7711850efeca408f146b8a">getWires</a>()[j];</div><div class="line"> cerr << <span class="stringliteral">" | | + wire "</span>;</div><div class="line"> <a class="code" href="class_open_chams_1_1_wire_point.html">OpenChams::WirePoint</a>* start = wire-><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<OpenChams::InstancePoint*>(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<</span><a class="code" href="class_open_chams_1_1_instance_point.html">OpenChams::InstancePoint</a>*<span class="keyword">></span>(start);</div><div class="line"> cerr << <span class="stringliteral">"<"</span> << iP-><a class="code" href="class_open_chams_1_1_instance_point.html#a2858c0c4e8b5108f041237cf5a802029">getName</a>().getString() << <span class="stringliteral">","</span> << iP-><a class="code" href="class_open_chams_1_1_instance_point.html#a646d464666fc56ab2e04a6b87fdd3279">getPlug</a>().getString() << <span class="stringliteral">"> "</span>;</div><div class="line"> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dynamic_cast<OpenChams::PortPoint*>(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<</span><a class="code" href="class_open_chams_1_1_port_point.html">OpenChams::PortPoint</a>*<span class="keyword">></span>(start);</div><div class="line"> cerr << <span class="stringliteral">"<"</span> << pP-><a class="code" href="class_open_chams_1_1_port_point.html#ab4018980dcd1fed5208e7a72846cd815">getIndex</a>() << <span class="stringliteral">"> "</span>;</div><div class="line"> }</div><div class="line"> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> k = 0 ; k < wire-><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-><a class="code" href="class_open_chams_1_1_wire.html#aac2840e22e03db0ff2c0fe0f83c56fdd">getIntermediatePoints</a>()[k];</div><div class="line"> cerr << <span class="stringliteral">"<"</span> << iP-><a class="code" href="class_open_chams_1_1_intermediate_point.html#a2b69e4312b7814c6efce42f851893409">getX</a>() << <span class="stringliteral">","</span> << iP-><a class="code" href="class_open_chams_1_1_intermediate_point.html#a15f19cf52955c8c3406831b288681358">getY</a>() << <span class="stringliteral">"> "</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-><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<OpenChams::InstancePoint*>(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<</span><a class="code" href="class_open_chams_1_1_instance_point.html">OpenChams::InstancePoint</a>*<span class="keyword">></span>(end);</div><div class="line"> cerr << <span class="stringliteral">"<"</span> << iP-><a class="code" href="class_open_chams_1_1_instance_point.html#a2858c0c4e8b5108f041237cf5a802029">getName</a>().getString() << <span class="stringliteral">","</span> << iP-><a class="code" href="class_open_chams_1_1_instance_point.html#a646d464666fc56ab2e04a6b87fdd3279">getPlug</a>().getString() << <span class="stringliteral">"> "</span>;</div><div class="line"> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dynamic_cast<OpenChams::PortPoint*>(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<</span><a class="code" href="class_open_chams_1_1_port_point.html">OpenChams::PortPoint</a>*<span class="keyword">></span>(end);</div><div class="line"> cerr << <span class="stringliteral">"<"</span> << pP-><a class="code" href="class_open_chams_1_1_port_point.html#ab4018980dcd1fed5208e7a72846cd815">getIndex</a>() << <span class="stringliteral">"> "</span>;</div><div class="line"> }</div><div class="line"> cerr << 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-><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 << <span class="stringliteral">" + sizing"</span> << endl;</div><div class="line"> <span class="keywordflow">if</span> (!sizing-><a class="code" href="class_open_chams_1_1_sizing.html#ac8a299add4fd32ff8bf99c889f4a79a6">hasNoOperators</a>()) {</div><div class="line"> <span class="keywordflow">for</span> (map<OpenChams::Name, OpenChams::Operator*>::const_iterator oit = sizing-><a class="code" href="class_open_chams_1_1_sizing.html#ad35c9083b30dac45186f4f0eb49b435d">getOperators</a>().begin() ; oit != sizing-><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 << <span class="stringliteral">" | + instance name: "</span> << ((*oit).first).getString() << <span class="stringliteral">" - operator: "</span> << op-><a class="code" href="class_open_chams_1_1_operator.html#a2858c0c4e8b5108f041237cf5a802029">getName</a>().getString() << <span class="stringliteral">" - simulModel: "</span> << op-><a class="code" href="class_open_chams_1_1_operator.html#aa189a1b119b44a8877c478e2d2357a89">getSimulModel</a>().getString() << endl;</div><div class="line"> <span class="keywordflow">if</span> (!op-><a class="code" href="class_open_chams_1_1_operator.html#a9ac68ad3e43b1649a8582c8685f4886d">hasNoConstraints</a>()) {</div><div class="line"> <span class="keywordflow">for</span> (map<OpenChams::Name, OpenChams::Operator::Constraint*>::const_iterator cit = op-><a class="code" href="class_open_chams_1_1_operator.html#a0002889b395185948d7c71b261343620">getConstraints</a>().begin() ; cit != op-><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 << <span class="stringliteral">" | | + param: "</span> << ((*cit).first).getString() << <span class="stringliteral">" - ref: "</span> << cstr-><a class="code" href="class_open_chams_1_1_operator_1_1_constraint.html#a07cf74adaf661f0aaaa1818d24c2243d">getRef</a>().getString() << <span class="stringliteral">" - refParam: "</span> << cstr-><a class="code" href="class_open_chams_1_1_operator_1_1_constraint.html#a621539b1a4f31053649031c8034b0bd3">getRefParam</a>().getString() << <span class="stringliteral">" - factor: "</span> << cstr-><a class="code" href="class_open_chams_1_1_operator_1_1_constraint.html#a973fc85365f2d3f07007d88a90d7ab1d">getFactor</a>() << 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->hasNoEquations()) {</span></div><div class="line"> <span class="comment">// cerr << " | + equations" << endl;</span></div><div class="line"> <span class="comment">// for (map<OpenChams::Name, string>::const_iterator eit = sizing->getEquations().begin() ; eit != sizing->getEquations().end() ; ++eit) {</span></div><div class="line"> <span class="comment">// cerr << " | | " << ((*eit).first).getString() << " : " << (*eit).second << 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-><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-><a class="code" href="class_open_chams_1_1_layout.html#af27a31f10fcf22daa64f35c9c6bd2cda">hasNoInstance</a>()) {</div><div class="line"> cerr << <span class="stringliteral">" + layout"</span> << endl;</div><div class="line"> <span class="keywordflow">for</span> (map<OpenChams::Name, OpenChams::Name>::const_iterator lit = layout-><a class="code" href="class_open_chams_1_1_layout.html#ab0550a9050b7e788b2a18452c9df21f7">getInstances</a>().begin() ; lit != layout-><a class="code" href="class_open_chams_1_1_layout.html#ab0550a9050b7e788b2a18452c9df21f7">getInstances</a>().end() ; ++lit) {</div><div class="line"> cerr << <span class="stringliteral">" | | instance name: "</span> << ((*lit).first).getString() << <span class="stringliteral">" - style: "</span> << ((*lit).second).getString() << 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-><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 << <span class="stringliteral">" | + hbtree"</span> << 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 <string></span></div><div class="line"><span class="keyword">using namespace </span><a class="code" href="namespacestd.html">std</a>;</div><div class="line"></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Circuit.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Netlist.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Instance.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Device.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Transistor.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Net.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Schematic.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Sizing.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Operator.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Layout.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Node.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Port.h"</span></div><div class="line"><span class="preprocessor">#include "vlsisapd/openChams/Wire.h"</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">"design"</span>), OpenChams::Name(<span class="stringliteral">"myTech"</span>));</div><div class="line"> <span class="comment">// value parameters</span></div><div class="line"> circuit->addParameter(OpenChams::Name(<span class="stringliteral">"temp"</span>), <span class="stringliteral">"27.0"</span> );</div><div class="line"> circuit->addParameter(OpenChams::Name(<span class="stringliteral">"Vdd"</span>) , <span class="stringliteral">"1.2"</span> );</div><div class="line"> circuit->addParameter(OpenChams::Name(<span class="stringliteral">"Vss"</span>) , <span class="stringliteral">"0.0"</span> );</div><div class="line"> circuit->addParameter(OpenChams::Name(<span class="stringliteral">"L"</span>) , <span class="stringliteral">"0.1e-6"</span>);</div><div class="line"> circuit->addParameter(OpenChams::Name(<span class="stringliteral">"Ids"</span>) , <span class="stringliteral">"30e-6"</span> );</div><div class="line"> circuit->addParameter(OpenChams::Name(<span class="stringliteral">"Veg"</span>) , <span class="stringliteral">"0.12"</span> );</div><div class="line"> <span class="comment">// equation parameters</span></div><div class="line"> circuit->addParameter(OpenChams::Name(<span class="stringliteral">"complex"</span>), <span class="stringliteral">"myEq"</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-><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-><a class="code" href="class_open_chams_1_1_netlist.html#a8e1798a2516c32fbab629ce8d60d4b1d">addDevice</a>(OpenChams::Name(<span class="stringliteral">"nmos1"</span>), OpenChams::Name(<span class="stringliteral">"Transistor"</span>), 1, OpenChams::Name(<span class="stringliteral">"NMOS"</span>), <span class="keyword">true</span>);</div><div class="line"> inst_nmos1->addConnector(OpenChams::Name(<span class="stringliteral">"G"</span>));</div><div class="line"> inst_nmos1->addConnector(OpenChams::Name(<span class="stringliteral">"S"</span>));</div><div class="line"> inst_nmos1->addConnector(OpenChams::Name(<span class="stringliteral">"D"</span>));</div><div class="line"> <a class="code" href="class_open_chams_1_1_transistor.html">OpenChams::Transistor</a>* tr_nmos1 = inst_nmos1-><a class="code" href="class_open_chams_1_1_device.html#ad45d34f8765dd113a5b12289efe66c07">addTransistor</a>(OpenChams::Name(<span class="stringliteral">"m1"</span>));</div><div class="line"> tr_nmos1-><a class="code" href="class_open_chams_1_1_transistor.html#a705b53a51f0e265533b228f6e8beaf50">setGate</a> (OpenChams::Name(<span class="stringliteral">"G"</span>)); <span class="comment">// the name of the connector of inst_nmos1</span></div><div class="line"> tr_nmos1-><a class="code" href="class_open_chams_1_1_transistor.html#abc4a5d86e639ea13e27551722e2f9c17">setSource</a>(OpenChams::Name(<span class="stringliteral">"S"</span>));</div><div class="line"> tr_nmos1-><a class="code" href="class_open_chams_1_1_transistor.html#a72ff8491040e3fdc1c8bd62b2392ab82">setDrain</a> (OpenChams::Name(<span class="stringliteral">"D"</span>));</div><div class="line"> tr_nmos1-><a class="code" href="class_open_chams_1_1_transistor.html#a1484abe63e3f8ffbc2911c5230fa7091">setBulk</a> (OpenChams::Name(<span class="stringliteral">"S"</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-><a class="code" href="class_open_chams_1_1_netlist.html#a8e1798a2516c32fbab629ce8d60d4b1d">addDevice</a>(OpenChams::Name(<span class="stringliteral">"pmos1"</span>), OpenChams::Name(<span class="stringliteral">"Transistor"</span>), 2, OpenChams::Name(<span class="stringliteral">"PMOS"</span>), <span class="keyword">true</span>);</div><div class="line"> inst_pmos1->addConnector(OpenChams::Name(<span class="stringliteral">"G"</span>));</div><div class="line"> inst_pmos1->addConnector(OpenChams::Name(<span class="stringliteral">"S"</span>));</div><div class="line"> inst_pmos1->addConnector(OpenChams::Name(<span class="stringliteral">"D"</span>));</div><div class="line"> <a class="code" href="class_open_chams_1_1_transistor.html">OpenChams::Transistor</a>* tr_pmos1 = inst_pmos1-><a class="code" href="class_open_chams_1_1_device.html#ad45d34f8765dd113a5b12289efe66c07">addTransistor</a>(OpenChams::Name(<span class="stringliteral">"m1"</span>));</div><div class="line"> tr_pmos1-><a class="code" href="class_open_chams_1_1_transistor.html#a705b53a51f0e265533b228f6e8beaf50">setGate</a> (OpenChams::Name(<span class="stringliteral">"G"</span>)); <span class="comment">// the name of the connector of inst_pmos1</span></div><div class="line"> tr_pmos1-><a class="code" href="class_open_chams_1_1_transistor.html#abc4a5d86e639ea13e27551722e2f9c17">setSource</a>(OpenChams::Name(<span class="stringliteral">"S"</span>));</div><div class="line"> tr_pmos1-><a class="code" href="class_open_chams_1_1_transistor.html#a72ff8491040e3fdc1c8bd62b2392ab82">setDrain</a> (OpenChams::Name(<span class="stringliteral">"D"</span>));</div><div class="line"> tr_pmos1-><a class="code" href="class_open_chams_1_1_transistor.html#a1484abe63e3f8ffbc2911c5230fa7091">setBulk</a> (OpenChams::Name(<span class="stringliteral">"S"</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-><a class="code" href="class_open_chams_1_1_netlist.html#a52be455a704925328843770552eca43d">addNet</a>(OpenChams::Name(<span class="stringliteral">"vdd"</span>), OpenChams::Name(<span class="stringliteral">"power"</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-><a class="code" href="class_open_chams_1_1_netlist.html#a52be455a704925328843770552eca43d">addNet</a>(OpenChams::Name(<span class="stringliteral">"vss"</span>), OpenChams::Name(<span class="stringliteral">"ground"</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-><a class="code" href="class_open_chams_1_1_netlist.html#a52be455a704925328843770552eca43d">addNet</a>(OpenChams::Name(<span class="stringliteral">"in"</span> ), OpenChams::Name(<span class="stringliteral">"logical"</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-><a class="code" href="class_open_chams_1_1_netlist.html#a52be455a704925328843770552eca43d">addNet</a>(OpenChams::Name(<span class="stringliteral">"out"</span>), OpenChams::Name(<span class="stringliteral">"logical"</span>), <span class="keyword">true</span>);</div><div class="line"> _vdd-><a class="code" href="class_open_chams_1_1_net.html#a40c2c019175ba3bfa4b90f4ad5d06483">connectTo</a>(OpenChams::Name(<span class="stringliteral">"pmos1"</span>), OpenChams::Name(<span class="stringliteral">"S"</span>));</div><div class="line"> _vss-><a class="code" href="class_open_chams_1_1_net.html#a40c2c019175ba3bfa4b90f4ad5d06483">connectTo</a>(OpenChams::Name(<span class="stringliteral">"nmos1"</span>), OpenChams::Name(<span class="stringliteral">"S"</span>));</div><div class="line"> _in-><a class="code" href="class_open_chams_1_1_net.html#a40c2c019175ba3bfa4b90f4ad5d06483">connectTo</a> (OpenChams::Name(<span class="stringliteral">"nmos1"</span>), OpenChams::Name(<span class="stringliteral">"G"</span>));</div><div class="line"> _in-><a class="code" href="class_open_chams_1_1_net.html#a40c2c019175ba3bfa4b90f4ad5d06483">connectTo</a> (OpenChams::Name(<span class="stringliteral">"pmos1"</span>), OpenChams::Name(<span class="stringliteral">"G"</span>));</div><div class="line"> _out-><a class="code" href="class_open_chams_1_1_net.html#a40c2c019175ba3bfa4b90f4ad5d06483">connectTo</a>(OpenChams::Name(<span class="stringliteral">"nmos1"</span>), OpenChams::Name(<span class="stringliteral">"D"</span>));</div><div class="line"> _out-><a class="code" href="class_open_chams_1_1_net.html#a40c2c019175ba3bfa4b90f4ad5d06483">connectTo</a>(OpenChams::Name(<span class="stringliteral">"pmos1"</span>), OpenChams::Name(<span class="stringliteral">"D"</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-><a class="code" href="class_open_chams_1_1_circuit.html#a57a79a9916df4512648bb195decb7250">createSchematic</a>();</div><div class="line"> schematic-><a class="code" href="class_open_chams_1_1_schematic.html#ac7fc9f5cdf1e22c53d42e6606e1af8ef">addInstance</a>(OpenChams::Name(<span class="stringliteral">"nmos1"</span>), 2490, 2600, OpenChams::Name(<span class="stringliteral">"ID"</span>));</div><div class="line"> schematic-><a class="code" href="class_open_chams_1_1_schematic.html#ac7fc9f5cdf1e22c53d42e6606e1af8ef">addInstance</a>(OpenChams::Name(<span class="stringliteral">"pmos1"</span>), 2490, 2300, OpenChams::Name(<span class="stringliteral">"ID"</span>));</div><div class="line"> _vdd-><a class="code" href="class_open_chams_1_1_net.html#af395a7c9d6f3c2b24500b91260873664">addPort</a>(OpenChams::Name(<span class="stringliteral">"inV"</span>), 0, 2490, 2100, OpenChams::Name(<span class="stringliteral">"ID"</span>));</div><div class="line"> <a class="code" href="class_open_chams_1_1_wire.html">OpenChams::Wire</a>* wVdd = _vdd-><a class="code" href="class_open_chams_1_1_net.html#a643a969f62770301b8b70ed63c36a55e">addWire</a>();</div><div class="line"> wVdd->setStartPoint(OpenChams::Name(<span class="stringliteral">"pmos1"</span>), OpenChams::Name(<span class="stringliteral">"S"</span>));</div><div class="line"> wVdd->setEndPoint (0);</div><div class="line"> _vss-><a class="code" href="class_open_chams_1_1_net.html#af395a7c9d6f3c2b24500b91260873664">addPort</a>(OpenChams::Name(<span class="stringliteral">"inV"</span>), 0, 2490, 2800, OpenChams::Name(<span class="stringliteral">"MY"</span>));</div><div class="line"> <a class="code" href="class_open_chams_1_1_wire.html">OpenChams::Wire</a>* wVss = _vss-><a class="code" href="class_open_chams_1_1_net.html#a643a969f62770301b8b70ed63c36a55e">addWire</a>();</div><div class="line"> wVss->setStartPoint(OpenChams::Name(<span class="stringliteral">"nmos1"</span>), OpenChams::Name(<span class="stringliteral">"S"</span>));</div><div class="line"> wVss->setEndPoint (0);</div><div class="line"> _in-><a class="code" href="class_open_chams_1_1_net.html#af395a7c9d6f3c2b24500b91260873664">addPort</a>(OpenChams::Name(<span class="stringliteral">"inH"</span>), 0, 2190, 2500, OpenChams::Name(<span class="stringliteral">"ID"</span>));</div><div class="line"> <a class="code" href="class_open_chams_1_1_wire.html">OpenChams::Wire</a>* wIn = _in-><a class="code" href="class_open_chams_1_1_net.html#a643a969f62770301b8b70ed63c36a55e">addWire</a>();</div><div class="line"> wIn->setStartPoint(OpenChams::Name(<span class="stringliteral">"pmos1"</span>), OpenChams::Name(<span class="stringliteral">"G"</span>));</div><div class="line"> wIn->setEndPoint (OpenChams::Name(<span class="stringliteral">"nmos1"</span>), OpenChams::Name(<span class="stringliteral">"G"</span>));</div><div class="line"> <a class="code" href="class_open_chams_1_1_wire.html">OpenChams::Wire</a>* wIn1 = _in-><a class="code" href="class_open_chams_1_1_net.html#a643a969f62770301b8b70ed63c36a55e">addWire</a>();</div><div class="line"> wIn1->setStartPoint(0);</div><div class="line"> wIn1->setEndPoint (OpenChams::Name(<span class="stringliteral">"pmos1"</span>), OpenChams::Name(<span class="stringliteral">"G"</span>));</div><div class="line"> _out-><a class="code" href="class_open_chams_1_1_net.html#af395a7c9d6f3c2b24500b91260873664">addPort</a>(OpenChams::Name(<span class="stringliteral">"outH"</span>), 0, 2600, 2500, OpenChams::Name(<span class="stringliteral">"ID"</span>));</div><div class="line"> <a class="code" href="class_open_chams_1_1_wire.html">OpenChams::Wire</a>* wOut = _out-><a class="code" href="class_open_chams_1_1_net.html#a643a969f62770301b8b70ed63c36a55e">addWire</a>();</div><div class="line"> wOut->setStartPoint(OpenChams::Name(<span class="stringliteral">"pmos1"</span>), OpenChams::Name(<span class="stringliteral">"D"</span>));</div><div class="line"> wOut->setEndPoint (OpenChams::Name(<span class="stringliteral">"nmos1"</span>), OpenChams::Name(<span class="stringliteral">"D"</span>));</div><div class="line"> <a class="code" href="class_open_chams_1_1_wire.html">OpenChams::Wire</a>* wOut1 = _out-><a class="code" href="class_open_chams_1_1_net.html#a643a969f62770301b8b70ed63c36a55e">addWire</a>();</div><div class="line"> wOut1->setStartPoint(OpenChams::Name(<span class="stringliteral">"nmos1"</span>), OpenChams::Name(<span class="stringliteral">"D"</span>));</div><div class="line"> wOut1->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->createSizing();</div><div class="line"> <a class="code" href="class_open_chams_1_1_operator.html">OpenChams::Operator</a>* op_pmos1 = sizing-><a class="code" href="class_open_chams_1_1_sizing.html#a712e045c11e463cff8411b3d0fd7f732">addOperator</a>(OpenChams::Name(<span class="stringliteral">"pmos1"</span>), OpenChams::Name(<span class="stringliteral">"OPVG(Veg)"</span>), OpenChams::Name(<span class="stringliteral">"BSIM3V3"</span>));</div><div class="line"> op_pmos1->addConstraint(OpenChams::Name(<span class="stringliteral">"Temp"</span>), OpenChams::Name(<span class="stringliteral">"design"</span>), OpenChams::Name(<span class="stringliteral">"temp"</span>));</div><div class="line"> op_pmos1->addConstraint(OpenChams::Name(<span class="stringliteral">"Ids"</span>) , OpenChams::Name(<span class="stringliteral">"design"</span>), OpenChams::Name(<span class="stringliteral">"Ids"</span>) );</div><div class="line"> op_pmos1->addConstraint(OpenChams::Name(<span class="stringliteral">"L"</span>) , OpenChams::Name(<span class="stringliteral">"design"</span>), OpenChams::Name(<span class="stringliteral">"L"</span>) );</div><div class="line"> op_pmos1->addConstraint(OpenChams::Name(<span class="stringliteral">"Veg"</span>) , OpenChams::Name(<span class="stringliteral">"design"</span>), OpenChams::Name(<span class="stringliteral">"Veg"</span>) );</div><div class="line"> op_pmos1->addConstraint(OpenChams::Name(<span class="stringliteral">"Vd"</span>) , OpenChams::Name(<span class="stringliteral">"design"</span>), OpenChams::Name(<span class="stringliteral">"Vdd"</span>) , 0.5);</div><div class="line"> op_pmos1->addConstraint(OpenChams::Name(<span class="stringliteral">"Vs"</span>) , OpenChams::Name(<span class="stringliteral">"design"</span>), OpenChams::Name(<span class="stringliteral">"Vdd"</span>) );</div><div class="line"> <a class="code" href="class_open_chams_1_1_operator.html">OpenChams::Operator</a>* op_nmos1 = sizing-><a class="code" href="class_open_chams_1_1_sizing.html#a712e045c11e463cff8411b3d0fd7f732">addOperator</a>(OpenChams::Name(<span class="stringliteral">"nmos1"</span>), OpenChams::Name(<span class="stringliteral">"OPW(Vg,Vs)"</span>), OpenChams::Name(<span class="stringliteral">"BSIM3V3"</span>));</div><div class="line"> op_nmos1->addConstraint(OpenChams::Name(<span class="stringliteral">"Temp"</span>), OpenChams::Name(<span class="stringliteral">"design"</span>), OpenChams::Name(<span class="stringliteral">"temp"</span>));</div><div class="line"> op_nmos1->addConstraint(OpenChams::Name(<span class="stringliteral">"Ids"</span>) , OpenChams::Name(<span class="stringliteral">"design"</span>), OpenChams::Name(<span class="stringliteral">"Ids"</span> ));</div><div class="line"> op_nmos1->addConstraint(OpenChams::Name(<span class="stringliteral">"L"</span>) , OpenChams::Name(<span class="stringliteral">"design"</span>), OpenChams::Name(<span class="stringliteral">"L"</span> ));</div><div class="line"> op_nmos1->addConstraint(OpenChams::Name(<span class="stringliteral">"Vs"</span>) , OpenChams::Name(<span class="stringliteral">"design"</span>), OpenChams::Name(<span class="stringliteral">"Vdd"</span> ));</div><div class="line"> op_nmos1->addConstraint(OpenChams::Name(<span class="stringliteral">"Vg"</span>) , OpenChams::Name(<span class="stringliteral">"pmos1"</span>) , OpenChams::Name(<span class="stringliteral">"Vg"</span> ));</div><div class="line"> op_nmos1->addConstraint(OpenChams::Name(<span class="stringliteral">"Vd"</span>) , OpenChams::Name(<span class="stringliteral">"pmos1"</span>) , OpenChams::Name(<span class="stringliteral">"Vd"</span> ));</div><div class="line"> op_nmos1->addConstraint(OpenChams::Name(<span class="stringliteral">"another"</span>), OpenChams::Name(<span class="stringliteral">"myEq"</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-><a class="code" href="class_open_chams_1_1_circuit.html#a725a691b0117c4b913b54e7bfd92832f">createLayout</a>();</div><div class="line"> layout-><a class="code" href="class_open_chams_1_1_layout.html#a4cc1899e9b782de44700fa0e4ac477ef">addInstance</a>(OpenChams::Name(<span class="stringliteral">"pmos1"</span>), OpenChams::Name(<span class="stringliteral">"Common transistor"</span>));</div><div class="line"> layout-><a class="code" href="class_open_chams_1_1_layout.html#a4cc1899e9b782de44700fa0e4ac477ef">addInstance</a>(OpenChams::Name(<span class="stringliteral">"nmos1"</span>), OpenChams::Name(<span class="stringliteral">"Rotate transistor"</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">"g1"</span>); <span class="comment">// default position is NONE and default parent is NULL</span></div><div class="line"> g1-><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">"nmos1"</span>, OpenChams::Node::NONE, g1);</div><div class="line"> g1-><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">"pmos1"</span>, OpenChams::Node::TOP, b1);</div><div class="line"> b1-><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-><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-><a class="code" href="class_open_chams_1_1_circuit.html#a2eb07935ec946a07edcee2255b781193">writeToFile</a>(<span class="stringliteral">"./myInverter.xml"</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">%> mkdir build; cd build</div><div class="line">%> cmake ..</div><div class="line">%> 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"><span class="keyword">import</span> sys</div><div class="line"></div><div class="line"><span class="keyword">from</span> OPENCHAMS <span class="keyword">import</span> *</div><div class="line"></div><div class="line"><span class="keyword">def </span>printHBTree(node, indent):</div><div class="line"> <span class="keywordflow">if</span> node == <span class="keywordtype">None</span>:</div><div class="line"> <span class="keywordflow">return</span></div><div class="line"> <span class="keywordflow">for</span> i <span class="keywordflow">in</span> range(indent):</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" |"</span>,</div><div class="line"> <span class="keywordflow">if</span> isinstance(node, Bloc):</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" bloc:"</span>, node.getName(), <span class="stringliteral">"-"</span>, node.getPosition()</div><div class="line"> printHBTree(node.top , indent+1)</div><div class="line"> printHBTree(node.right, indent+1)</div><div class="line"> <span class="keywordflow">return</span></div><div class="line"> <span class="keywordflow">if</span> isinstance(node, Group):</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" group:"</span>, node.getName(), <span class="stringliteral">"-"</span>, node.getPosition(), <span class="stringliteral">"-"</span>, node.align, <span class="stringliteral">"-"</span>, node.isolated, <span class="stringliteral">"-"</span>, node.paired</div><div class="line"> printHBTree(node.rootNode, indent+1)</div><div class="line"> printHBTree(node.top , indent+1)</div><div class="line"> printHBTree(node.right , indent+1)</div><div class="line"> <span class="keywordflow">return</span></div><div class="line"></div><div class="line"><span class="keyword">def </span>printContents(circuit):</div><div class="line"> <span class="keywordflow">print</span> circuit.name</div><div class="line"> <span class="comment"># circuit parameters</span></div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" + parameters"</span></div><div class="line"> <span class="keywordflow">for</span> param <span class="keywordflow">in</span> circuit.parameters.getValues():</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | |"</span>, param.key, <span class="stringliteral">":"</span>, param.value</div><div class="line"> <span class="keywordflow">for</span> param <span class="keywordflow">in</span> circuit.parameters.getEqValues():</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | |"</span>, param.key, <span class="stringliteral">":"</span>, param.value</div><div class="line"> <span class="comment"># netlist</span></div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" + netlist"</span></div><div class="line"> <span class="comment"># instances</span></div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | + instances"</span></div><div class="line"> <span class="keywordflow">for</span> instance <span class="keywordflow">in</span> circuit.netlist.getInstances():</div><div class="line"> <span class="keywordflow">if</span> isinstance(instance, Device): </div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | +"</span>, instance.name, <span class="stringliteral">":"</span>, instance.model, instance.order, instance.mosType, instance.sourceBulkConnected</div><div class="line"> <span class="keywordflow">else</span>:</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | +"</span>, instance.name, <span class="stringliteral">":"</span>, instance.model, instance.order</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | | + connectors"</span></div><div class="line"> <span class="keywordflow">for</span> conn <span class="keywordflow">in</span> instance.getConnectors():</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | | |"</span>, conn.key, <span class="stringliteral">":"</span>, conn.value.name</div><div class="line"> <span class="keywordflow">if</span> isinstance(instance, Device): </div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | | + transistors"</span></div><div class="line"> <span class="keywordflow">for</span> tr <span class="keywordflow">in</span> instance.getTransistors():</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | | | name:"</span>, tr.name, <span class="stringliteral">"- gate:"</span>, tr.gate, <span class="stringliteral">"- source:"</span>, tr.source, <span class="stringliteral">"- drain:"</span>, tr.drain, <span class="stringliteral">"- bulk:"</span>, tr.bulk</div><div class="line"> <span class="comment"># nets</span></div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | + nets"</span></div><div class="line"> schematicNet = <span class="keyword">False</span></div><div class="line"> <span class="keywordflow">for</span> net <span class="keywordflow">in</span> circuit.netlist.getNets():</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | +"</span>, net.name, <span class="stringliteral">":"</span>, net.type, net.external</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | | + connections"</span></div><div class="line"> <span class="keywordflow">for</span> conn <span class="keywordflow">in</span> net.getConnections():</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | | | %s.%s"</span>%(conn.instanceName, conn.connectorName)</div><div class="line"> <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"> schematicNet = <span class="keyword">True</span></div><div class="line"> <span class="comment"># schematic</span></div><div class="line"> <span class="keywordflow">if</span> (circuit.schematic):</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" + schematic"</span></div><div class="line"> <span class="keywordflow">for</span> instance <span class="keywordflow">in</span> circuit.schematic.getInstances():</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | + instance name:"</span>, instance.key, <span class="stringliteral">"- x:"</span>, instance.value.x, <span class="stringliteral">"- y:"</span>, instance.value.y, <span class="stringliteral">"- orientation:"</span>, instance.value.orientation </div><div class="line"> <span class="keywordflow">if</span> schematicNet:</div><div class="line"> <span class="keywordflow">for</span> net <span class="keywordflow">in</span> circuit.netlist.getNets():</div><div class="line"> <span class="keywordflow">if</span> net.hasNoPorts() <span class="keywordflow">and</span> net.hasNoWires():</div><div class="line"> <span class="keywordflow">continue</span></div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | + net name:"</span>, net.name</div><div class="line"> <span class="keywordflow">for</span> port <span class="keywordflow">in</span> net.getPorts():</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | + port type:"</span>, port.type, <span class="stringliteral">"- idx:"</span>, port.index, <span class="stringliteral">"- x:"</span>, port.x, <span class="stringliteral">"- y:"</span>, port.y, <span class="stringliteral">"- orientation:"</span>, port.orientation</div><div class="line"> <span class="keywordflow">for</span> wire <span class="keywordflow">in</span> net.getWires():</div><div class="line"> <span class="keywordflow">if</span> isinstance(wire.startPoint, InstancePoint):</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | + wire <"</span> + wire.startPoint.name.getString() + <span class="stringliteral">","</span> + wire.startPoint.plug.getString() +<span class="stringliteral">">"</span></div><div class="line"> <span class="keywordflow">elif</span> isinstance(wire.startPoint, PortPoint):</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | + wire <"</span> + str(wire.startPoint.index) + <span class="stringliteral">">"</span></div><div class="line"> <span class="keywordflow">else</span>:</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" - - UNKNOWN START POINT"</span></div><div class="line"> <span class="keywordflow">for</span> point <span class="keywordflow">in</span> wire.getIntermediatePoints():</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | <"</span> + str(point.x) + <span class="stringliteral">","</span> + str(point.y) + <span class="stringliteral">">"</span></div><div class="line"> <span class="keywordflow">if</span> isinstance(wire.endPoint, InstancePoint):</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | <"</span> + wire.endPoint.name.getString() + <span class="stringliteral">","</span> + wire.endPoint.plug.getString() +<span class="stringliteral">">"</span></div><div class="line"> <span class="keywordflow">elif</span> isinstance(wire.endPoint, PortPoint):</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | <"</span> + str(wire.endPoint.index) + <span class="stringliteral">">"</span></div><div class="line"> <span class="keywordflow">else</span>:</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" - - UNKNOWN END POINT"</span></div><div class="line"> <span class="comment"># sizing</span></div><div class="line"> <span class="keywordflow">if</span> (circuit.sizing):</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" + sizing"</span></div><div class="line"> <span class="keywordflow">for</span> op <span class="keywordflow">in</span> circuit.sizing.getOperators():</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | + instance name:"</span>, op.key, <span class="stringliteral">"- operator:"</span>, op.value.name, <span class="stringliteral">"- simulModel:"</span>, op.value.simulModel</div><div class="line"> <span class="keywordflow">for</span> constraint <span class="keywordflow">in</span> op.value.getConstraints():</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | + param:"</span>, constraint.key, <span class="stringliteral">"- ref:"</span>, constraint.value.ref, <span class="stringliteral">"- refParam:"</span>, constraint.value.refParam, <span class="stringliteral">"- factor:"</span>, constraint.value.factor</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | + equations"</span></div><div class="line"> <span class="keywordflow">for</span> eq <span class="keywordflow">in</span> circuit.sizing.getEquations():</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | |"</span>, eq.key, <span class="stringliteral">":"</span>, eq.value</div><div class="line"> <span class="comment"># layout</span></div><div class="line"> <span class="keywordflow">if</span> (circuit.layout):</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" + layout"</span></div><div class="line"> <span class="keywordflow">for</span> inst <span class="keywordflow">in</span> circuit.layout.getInstances():</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | | instance name:"</span>, inst.key, <span class="stringliteral">"- style:"</span>, inst.value</div><div class="line"> <span class="keywordflow">if</span> circuit.layout.hbTreeRoot != <span class="keywordtype">None</span>:</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">" | + hbtree"</span></div><div class="line"> printHBTree(circuit.layout.hbTreeRoot, 2)</div><div class="line"></div><div class="line"><span class="keyword">def </span>usage():</div><div class="line"> <span class="keywordflow">print</span> <span class="stringliteral">"usage:"</span>, sys.argv[0], <span class="stringliteral">"[filename]"</span></div><div class="line"> sys.exit(48)</div><div class="line"></div><div class="line"><span class="keyword">def </span>main():</div><div class="line"> <span class="keywordflow">if</span> len(sys.argv) == 1:</div><div class="line"> filename = <span class="stringliteral">"./inverter.xml"</span></div><div class="line"> <span class="keywordflow">elif</span> len(sys.argv) == 2:</div><div class="line"> filename = sys.argv[1]</div><div class="line"> <span class="keywordflow">else</span>:</div><div class="line"> usage()</div><div class="line"></div><div class="line"> circuit = Circuit.readFromFile(filename)</div><div class="line"> printContents(circuit)</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordflow">if</span> __name__ == <span class="stringliteral">"__main__"</span>:</div><div class="line"> main()</div><div class="line"></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"><span class="keyword">from</span> OPENCHAMS <span class="keyword">import</span> *</div><div class="line"></div><div class="line">circuit = Circuit(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">"design"</span>), <a class="code" href="class_name.html">Name</a>(<span class="stringliteral">"myTech"</span>))</div><div class="line"><span class="comment"># value parameters</span></div><div class="line">circuit.addParameter(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">"temp"</span>), 27.0 )</div><div class="line">circuit.addParameter(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">"Vdd"</span>) , 1.2 )</div><div class="line">circuit.addParameter(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">"Vss"</span>) , 0.0 )</div><div class="line">circuit.addParameter(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">"L"</span>) , 0.1e-6)</div><div class="line">circuit.addParameter(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">"Ids"</span>) , 30e-6 )</div><div class="line">circuit.addParameter(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">"Veg"</span>) , 0.12 )</div><div class="line"><span class="comment"># equation parameters</span></div><div class="line">circuit.addParameter(<a class="code" href="class_name.html">Name</a>(<span class="stringliteral">"complex"</span>), <span class="stringliteral">"myEq"</span>)</div><div class="line"></div><div class="line"><span class="comment"># netlist :</span></div><div class="line">netlist = circuit.createNetlist()</div><div class="line"><span class="comment"># instances</span></div><div class="line"><span class="comment"># nmos1</span></div><div class="line">inst_nmos1 = netlist.addDevice(<span class="stringliteral">"nmos1"</span>, <span class="stringliteral">"Transistor"</span>, 1, <span class="stringliteral">"NMOS"</span>, <span class="keyword">True</span>)</div><div class="line">inst_nmos1.addConnector(<span class="stringliteral">"G"</span>)</div><div class="line">inst_nmos1.addConnector(<span class="stringliteral">"S"</span>)</div><div class="line">inst_nmos1.addConnector(<span class="stringliteral">"D"</span>)</div><div class="line">tr_nmos1 = inst_nmos1.addTransistor(<span class="stringliteral">"m1"</span>)</div><div class="line">tr_nmos1.gate = <span class="stringliteral">"G"</span> <span class="comment"># the name of the connector of inst_nmos1</span></div><div class="line">tr_nmos1.source = <span class="stringliteral">"S"</span></div><div class="line">tr_nmos1.drain = <span class="stringliteral">"D"</span></div><div class="line">tr_nmos1.bulk = <span class="stringliteral">"S"</span></div><div class="line"><span class="comment"># pmos1</span></div><div class="line">inst_pmos1 = netlist.addDevice(<span class="stringliteral">"pmos1"</span>, <span class="stringliteral">"Transistor"</span>, 2, <span class="stringliteral">"PMOS"</span>, <span class="keyword">True</span>)</div><div class="line">inst_pmos1.addConnector(<span class="stringliteral">"G"</span>)</div><div class="line">inst_pmos1.addConnector(<span class="stringliteral">"S"</span>)</div><div class="line">inst_pmos1.addConnector(<span class="stringliteral">"D"</span>)</div><div class="line">tr_pmos1 = inst_pmos1.addTransistor(<span class="stringliteral">"m1"</span>)</div><div class="line">tr_pmos1.gate = <span class="stringliteral">"G"</span> <span class="comment"># the name of the connector of inst_pmos1</span></div><div class="line">tr_pmos1.source = <span class="stringliteral">"S"</span></div><div class="line">tr_pmos1.drain = <span class="stringliteral">"D"</span></div><div class="line">tr_pmos1.bulk = <span class="stringliteral">"S"</span></div><div class="line"><span class="comment"># nets</span></div><div class="line">_vdd = netlist.addNet(<span class="stringliteral">"vdd"</span>, <span class="stringliteral">"power"</span> , <span class="keyword">True</span>)</div><div class="line">_vss = netlist.addNet(<span class="stringliteral">"vss"</span>, <span class="stringliteral">"ground"</span> , <span class="keyword">True</span>)</div><div class="line">_in = netlist.addNet(<span class="stringliteral">"in"</span> , <span class="stringliteral">"logical"</span>, <span class="keyword">True</span>)</div><div class="line">_out = netlist.addNet(<span class="stringliteral">"out"</span>, <span class="stringliteral">"logical"</span>, <span class="keyword">True</span>)</div><div class="line">_vdd.connectTo(<span class="stringliteral">"pmos1"</span>, <span class="stringliteral">"S"</span>)</div><div class="line">_vss.connectTo(<span class="stringliteral">"nmos1"</span>, <span class="stringliteral">"S"</span>)</div><div class="line">_in.connectTo (<span class="stringliteral">"nmos1"</span>, <span class="stringliteral">"G"</span>)</div><div class="line">_in.connectTo (<span class="stringliteral">"pmos1"</span>, <span class="stringliteral">"G"</span>)</div><div class="line">_out.connectTo(<span class="stringliteral">"nmos1"</span>, <span class="stringliteral">"D"</span>)</div><div class="line">_out.connectTo(<span class="stringliteral">"pmos1"</span>, <span class="stringliteral">"D"</span>)</div><div class="line"><span class="comment"># schematic</span></div><div class="line">schematic = circuit.createSchematic()</div><div class="line">schematic.addInstance(<span class="stringliteral">"nmos1"</span>, 2490, 2600, <span class="stringliteral">"ID"</span>)</div><div class="line">schematic.addInstance(<span class="stringliteral">"pmos1"</span>, 2490, 2300, <span class="stringliteral">"ID"</span>)</div><div class="line">_vdd.addPort(<span class="stringliteral">"inV"</span> , 0, 2490, 2100, <span class="stringliteral">"ID"</span>)</div><div class="line">_vss.addPort(<span class="stringliteral">"inV"</span> , 0, 2490, 2800, <span class="stringliteral">"MY"</span>)</div><div class="line">_in.addPort (<span class="stringliteral">"inH"</span> , 0, 2190, 2500, <span class="stringliteral">"ID"</span>)</div><div class="line">_out.addPort(<span class="stringliteral">"outH"</span>, 0, 2600, 2500, <span class="stringliteral">"ID"</span>)</div><div class="line">wireVdd = _vdd.addWire()</div><div class="line">wireVdd.setStartPoint(<span class="stringliteral">"pmos1"</span>, <span class="stringliteral">"S"</span>)</div><div class="line">wireVdd.setEndPoint(0)</div><div class="line">wireVss = _vss.addWire()</div><div class="line">wireVss.setStartPoint(<span class="stringliteral">"nmos1"</span>, <span class="stringliteral">"S"</span>)</div><div class="line">wireVss.setEndPoint(0)</div><div class="line">wireIn0 = _in.addWire()</div><div class="line">wireIn1 = _in.addWire()</div><div class="line">wireIn0.setStartPoint(<span class="stringliteral">"pmos1"</span>, <span class="stringliteral">"G"</span>)</div><div class="line">wireIn0.setEndPoint (<span class="stringliteral">"nmos1"</span>, <span class="stringliteral">"G"</span>)</div><div class="line">wireIn1.setStartPoint(0)</div><div class="line">wireIn1.setEndPoint (<span class="stringliteral">"pmos1"</span>, <span class="stringliteral">"G"</span>)</div><div class="line">wireOut0 = _out.addWire()</div><div class="line">wireOut1 = _out.addWire()</div><div class="line">wireOut0.setStartPoint(<span class="stringliteral">"pmos1"</span>, <span class="stringliteral">"D"</span>)</div><div class="line">wireOut0.setEndPoint (<span class="stringliteral">"nmos1"</span>, <span class="stringliteral">"D"</span>)</div><div class="line">wireOut1.setStartPoint(<span class="stringliteral">"nmos1"</span>, <span class="stringliteral">"D"</span>)</div><div class="line">wireOut1.setEndPoint (0)</div><div class="line"><span class="comment"># sizing</span></div><div class="line">sizing = circuit.createSizing()</div><div class="line">op_pmos1 = sizing.addOperator(<span class="stringliteral">"pmos1"</span>, <span class="stringliteral">"OPVG(Veg)"</span> , <span class="stringliteral">"BSIM3V3"</span>)</div><div class="line">op_pmos1.addConstraint(<span class="stringliteral">"Temp"</span>, <span class="stringliteral">"design"</span>, <span class="stringliteral">"temp"</span>)</div><div class="line">op_pmos1.addConstraint(<span class="stringliteral">"Ids"</span> , <span class="stringliteral">"design"</span>, <span class="stringliteral">"Ids"</span> )</div><div class="line">op_pmos1.addConstraint(<span class="stringliteral">"L"</span> , <span class="stringliteral">"design"</span>, <span class="stringliteral">"L"</span> )</div><div class="line">op_pmos1.addConstraint(<span class="stringliteral">"Veg"</span> , <span class="stringliteral">"design"</span>, <span class="stringliteral">"Veg"</span> )</div><div class="line">op_pmos1.addConstraint(<span class="stringliteral">"Vd"</span> , <span class="stringliteral">"design"</span>, <span class="stringliteral">"Vdd"</span>, 0.5)</div><div class="line">op_pmos1.addConstraint(<span class="stringliteral">"Vs"</span> , <span class="stringliteral">"design"</span>, <span class="stringliteral">"Vdd"</span> )</div><div class="line">op_nmos1 = sizing.addOperator(<span class="stringliteral">"nmos1"</span>, <span class="stringliteral">"OPW(Vg,Vs)"</span>, <span class="stringliteral">"BSIM3V3"</span>)</div><div class="line">op_nmos1.addConstraint(<span class="stringliteral">"Temp"</span>, <span class="stringliteral">"design"</span>, <span class="stringliteral">"temp"</span>)</div><div class="line">op_nmos1.addConstraint(<span class="stringliteral">"Ids"</span> , <span class="stringliteral">"design"</span>, <span class="stringliteral">"Ids"</span> )</div><div class="line">op_nmos1.addConstraint(<span class="stringliteral">"L"</span> , <span class="stringliteral">"design"</span>, <span class="stringliteral">"L"</span> )</div><div class="line">op_nmos1.addConstraint(<span class="stringliteral">"Vs"</span> , <span class="stringliteral">"design"</span>, <span class="stringliteral">"Vdd"</span> )</div><div class="line">op_nmos1.addConstraint(<span class="stringliteral">"Vg"</span> , <span class="stringliteral">"pmos1"</span> , <span class="stringliteral">"Vg"</span> )</div><div class="line">op_nmos1.addConstraint(<span class="stringliteral">"Vd"</span> , <span class="stringliteral">"pmos1"</span> , <span class="stringliteral">"Vd"</span> )</div><div class="line">op_nmos1.addConstraint(<span class="stringliteral">"another"</span>, <span class="stringliteral">"myEq"</span>, -2.5 )</div><div class="line"><span class="comment"># layout</span></div><div class="line">layout = circuit.createLayout()</div><div class="line">layout.addInstance(<span class="stringliteral">"pmos1"</span>, <span class="stringliteral">"Common transistor"</span>)</div><div class="line">layout.addInstance(<span class="stringliteral">"nmos1"</span>, <span class="stringliteral">"Rotate transistor"</span>)</div><div class="line"><span class="comment"># create hbtree</span></div><div class="line">g1 = Group(<span class="stringliteral">"g1"</span>)</div><div class="line">g1.align = Group.Align.VERTICAL</div><div class="line">b1 = Bloc(<span class="stringliteral">"nmos1"</span>, Node.Position.NONE, g1)</div><div class="line">g1.rootNode = b1 </div><div class="line">b2 = Bloc(<span class="stringliteral">"pmos1"</span>, Node.Position.TOP, b1)</div><div class="line">b1.top = b2</div><div class="line">layout.hbTreeRoot = g1</div><div class="line"></div><div class="line">circuit.writeToFile(<span class="stringliteral">"./myInverter.xml"</span>)</div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>In order to run these two scripts (<code>parseOpenChams.py</code> & 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.14 on Thu Oct 18 2018</small></td>
|
||
<td class="RFooter"><a href='#pagetop'><small>Return to top of page</small></a></td>
|
||
</tr>
|
||
</table>
|
||
<table class="footer2">
|
||
<tr>
|
||
<td class="LFooter">VLSI SAPD Documentation</td>
|
||
<td class="RFooter"><small>Copyright © 2010 - 2011 <a href="http://www.upmc.fr">UPMC</a> All rights reserved</small></td>
|
||
</tr>
|
||
</table>
|
||
</body>
|
||
</html>
|