From eff3b09d2df9d388db5a35b55dd43d806a686c76 Mon Sep 17 00:00:00 2001 From: Damien Dupuis Date: Fri, 20 May 2011 09:33:10 +0000 Subject: [PATCH] Adding primary version of Spice parser/driver documentation. --- vlsisapd/doc/doxyfile | 2 +- vlsisapd/doc/footer.html | 2 +- vlsisapd/doc/header.html | 1 + vlsisapd/doc/mainPage.dox | 7 +++- vlsisapd/doc/openChams/openChams.dox | 4 +- vlsisapd/doc/spice/spice.dox | 63 ++++++++++++++++++++++++++++ 6 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 vlsisapd/doc/spice/spice.dox diff --git a/vlsisapd/doc/doxyfile b/vlsisapd/doc/doxyfile index 851e3eb6..1b4af417 100644 --- a/vlsisapd/doc/doxyfile +++ b/vlsisapd/doc/doxyfile @@ -568,7 +568,7 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = "." "../src/cif" "../src/agds" "../src/dtr" "../src/openChams" +INPUT = "." "../src/cif" "../src/agds" "../src/dtr" "../src/openChams ../src/spice" # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is diff --git a/vlsisapd/doc/footer.html b/vlsisapd/doc/footer.html index a3ae8555..62d722d2 100644 --- a/vlsisapd/doc/footer.html +++ b/vlsisapd/doc/footer.html @@ -9,7 +9,7 @@ - +
VLSI SAPD DocumentationCopyright © 2010 UPMC All rights reservedCopyright © 2010 - 2011 UPMC All rights reserved
diff --git a/vlsisapd/doc/header.html b/vlsisapd/doc/header.html index 7908152c..83a99122 100644 --- a/vlsisapd/doc/header.html +++ b/vlsisapd/doc/header.html @@ -14,6 +14,7 @@ CIF DTR OPENCHAMS + SPICE Links & Contact diff --git a/vlsisapd/doc/mainPage.dox b/vlsisapd/doc/mainPage.dox index 1cd6a217..b0481ea2 100644 --- a/vlsisapd/doc/mainPage.dox +++ b/vlsisapd/doc/mainPage.dox @@ -1,6 +1,6 @@ /*! \mainpage Presentation - This is the documentation of VLSI SAPD project. This project aims at providing a set of open-source \b Stand Alone Parser & Drivers for VLSI. APIs for these parser & drivers are provided as C++ libraries and Python modules. + This is the documentation of VLSI SAPD project. This project aims at providing a set of open-source Stand Alone Parser & Drivers for VLSI. APIs for these parser & drivers are provided as C++ libraries and Python modules. The list of supported parser & drivers is shown in next table :
@@ -25,6 +25,10 @@ OPENCHAMS
x
x
+ + SPICE +
x
+
x
@@ -35,5 +39,6 @@ - \subpage cif - \subpage dtr - \subpage openchams + - \subpage spice */ diff --git a/vlsisapd/doc/openChams/openChams.dox b/vlsisapd/doc/openChams/openChams.dox index 25fd6cf1..1d80604c 100644 --- a/vlsisapd/doc/openChams/openChams.dox +++ b/vlsisapd/doc/openChams/openChams.dox @@ -40,8 +40,8 @@ Simply load an OPENCHAMS file using the static function OpenChams::Circuit::readFromFile() and then get the netlist object (OpenChams::Circuit::getNetlist()) or the sizing procedure (OpenChams::Circuit::getSizing(), might be NULL) or any other useful information (see OpenChams::Circuit). \subsection openChamsDriver Using the driver - Using the driver is very simple, user has to create a DTR::Techno object and simply add DTR::Rule or DTR::ARule to it. - The adding methods return the newly created Rule so user can set the rule type (DTR::Rule::setType()) if necessary. Finally use the DTR::Techno::writeToFile() method to dump the database to file. + Using the driver is very simple, user has to create an OpenChams::Circuit object and simply add OpenChams::Netlist (mandatory) and OpenChams::Sizing (optionnal) or OpenChams::Schematic (optionnal) or OpenChams::Layout (optinnal) to it. + Finally use the OpenChams::Circuit::writeToFile() method to dump the database to file. \section openChamsExamples Examples 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: \c inverter.xml and \c buffer.xml diff --git a/vlsisapd/doc/spice/spice.dox b/vlsisapd/doc/spice/spice.dox new file mode 100644 index 00000000..9361a3bb --- /dev/null +++ b/vlsisapd/doc/spice/spice.dox @@ -0,0 +1,63 @@ +/*! \page spice SPICE Format + + \section spicePres Presentation + The Spice format was developped at the University of California, Berkeley. + This parser/driver consists in a subset of SPICE3 netlist format. (see http://en.wikipedia.org/wiki/SPICE for more informations).\n + + \subsection spiceAutrhos Author + Damien Dupuis: damien.dupuis(at)lip6(.)fr + + \section spiceDB Stand alone database structure + The database consists in several objects: + - SPICE::Circuit + - SPICE::SpiceException + - SPICE::Subckt + - SPICE::Instance + - SPICE::Mosfet + - SPICE::Capacitor + - SPICE::Resistor + - SPICE::Source + - SPICE::Voltage + - SPICE::Current + + \subsection spiceParser Using the parser + Simply load an Spice netlist file using the static function SPICE::Circuit::readFromFile(). + + \subsection spiceDriver Using the driver + Using the driver is very simple, user has to create a SPICE::Circuit object and simply add others Spice objects like SPICE::Subckt or SPICE::Instance to it. + Includes, libraries and parameters can also be added to SPICE::Circuit. Finally use the SPICE::Circuit::writeToFile() method to dump the database to file. + + \section spiceExamples Examples + 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 SPICE file using C++ or Python. The SPICE file considered describes a simple Miller OTA: \c OTA_miller.spi + \include OTA_miller.spi + + All source codes are available in the \c examples directory. + + \subsection spiceC C++ + \subsubsection spiceParseC Parser + The following code (\c parseSpice.cpp) is an example of how to parse a SPICE file using C++ library. + \include parseSpice.cpp + + \subsubsection spiceDriveC Driver + This C++ code (\c driveSpice.cpp) generates an myOTA.spi file equivalent to the included one. + \include driveSpice.cpp + + \note 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: + \code + %> mkdir build; cd build + %> cmake .. + %> make + \endcode + + \subsection spicePython Python + \subsubsection spiceParsePython Parser + The following python script (\c parseSpice.py) is an example of how to parse a SPICE file using python module. + \include parseSpice.py + + \subsubsection spiceDrivePython Driver + This python script (\c driveSpice.py) generates an myOTA.spi file equivalent to the included one. + \include driveSpice.py + + \note In order to run these two scripts (\c parseSpice.py & driveSpice.py), user must ensure that $PYTHONPATH variable points to the directory containing SPICE.so module. +*/ +