2018-06-06 11:42:26 -05:00
<!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 >
2018-10-18 11:10:01 -05:00
<!-- Generated by Doxygen 1.8.14 -->
2018-06-06 11:42:26 -05:00
< / 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 >
2018-10-18 11:10:01 -05:00
< 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 / >
2018-06-06 11:42:26 -05:00
< / 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 >
2018-10-18 11:10:01 -05:00
< p > The database has many objects that can be arranged in five categories:< / p > < ul >
2018-06-06 11:42:26 -05:00
< 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 >
2018-10-18 11:10:01 -05:00
< 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 > />
2018-06-06 11:42:26 -05:00
< h2 > < a class = "anchor" id = "openChamsC" > < / a >
C++< / h2 >
< h3 > < a class = "anchor" id = "openChamsParseC" > < / a >
Parser< / h3 >
2018-10-18 11:10:01 -05:00
< 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_
2018-06-06 11:42:26 -05:00
Driver< / h3 >
2018-10-18 11:10:01 -05:00
< 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
2018-06-06 11:42:26 -05:00
< h2 > < a class = "anchor" id = "openChamsPython" > < / a >
Python< / h2 >
< h3 > < a class = "anchor" id = "openChamsParsePython" > < / a >
Parser< / h3 >
2018-10-18 11:10:01 -05:00
< 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 = "keyw
2018-06-06 11:42:26 -05:00
Driver< / h3 >
2018-10-18 11:10:01 -05:00
< 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 = "stringlit
2018-06-06 11:42:26 -05:00
< / div > < / div > <!-- contents -->
< br >
< hr >
< table class = "footer1" >
< tr >
2018-10-18 11:10:01 -05:00
< td class = "LFooter" > < small > Generated by doxygen 1.8.14 on Thu Oct 18 2018< / small > < / td >
2018-06-06 11:42:26 -05:00
< 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 >