* agds : 
       - all agds object now belong to AGDS namespace
       - 'Gds' has been removed from all filenames
     * cif
       - all cif objects now belong to CIF namespace
       - 'Cif' has been removed from all filenames
     * dtr
       - minor modifications in CMakeLists.txt since Boost Python is now used by other driver & parser

    ADDS
     * agds :
       - new python module
     * cif
       - new python module
     * doc
       - brand new doxygen documentation with 
           global presentation
           cif format (driver)
           agds format (driver)
           links & contacts
     * examples
       - examples files in C++ and Python for cif & agds drivers (others will follow)
This commit is contained in:
Damien Dupuis 2010-06-11 14:49:21 +00:00
parent 08c7e5ce9e
commit f4537e017c
51 changed files with 2748 additions and 187 deletions

View File

@ -7,5 +7,20 @@ LIST(INSERT CMAKE_MODULE_PATH 0 "${VLSISAPD_SOURCE_DIR}/cmake_modules")
FIND_PACKAGE(LibXml2 REQUIRED)
FIND_PACKAGE(PythonSitePackages REQUIRED)
FIND_PACKAGE(Boost 1.32.0 COMPONENTS python)
IF (Boost_FOUND)
MESSAGE(STATUS "Found Boost.Python libraries in ${Boost_INCLUDE_DIR} as ${Boost_LIBRARIES}")
FIND_PACKAGE(PythonLibs REQUIRED)
ELSE (Boost_FOUND)
MESSAGE(STATUS "Boost.Python libraries were not found")
ENDIF (Boost_FOUND)
FIND_PACKAGE(Doxygen)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(cmake_modules)
IF(BUILD_DOC AND DOXYGEN_FOUND)
ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(examples)
ENDIF(BUILD_DOC AND DOXYGEN_FOUND)

View File

@ -0,0 +1,4 @@
ADD_CUSTOM_TARGET ( doc ALL cd ${VLSISAPD_SOURCE_DIR}/doc && ${DOXYGEN_EXECUTABLE} doxyfile )
INSTALL ( DIRECTORY html/ DESTINATION share/doc/coriolis2/en/html/vlsisapd )
INSTALL ( DIRECTORY latex/ DESTINATION share/doc/coriolis2/en/html/vlsisapd )

11
vlsisapd/doc/Contact.dox Normal file
View File

@ -0,0 +1,11 @@
/*! \page Contact Links & Contacts
VLSI SAPD prject is developped at the <em>Pierre & Marie Curie University</em> in <em>Paris</em>, <em>France</em> (http://www.upmc.fr).\n\n
It is used by:
- Coriolis 2 Project: http://www-soc.lip6.fr/recherche/cian/coriolis-2/
- Chams Project: http://www-soc.lip6.fr/recherche/cian/chams/\n\n
For any information you can contact the author of a parser / driver (if available on corresponding page) or Damien Dupuis: damien.dupuis(at)lip6(.)fr founder of the project.
*/

View File

@ -0,0 +1,8 @@
// -*- C++ -*-
namespace AGDS {
/*! \class Element
*
* This is an abstract class which is a base for any GDS II shape. It only defines a layer.
*/
}

View File

@ -0,0 +1,40 @@
// -*- C++ -*-
namespace AGDS {
/*! \class Library
*
* This class contains all AGDS library informations such as the name, the unit used (user and physical) and the list of all Structures.
*/
/*! \fn Library::Library(std::string name)
* \brief creates a new Library
*
* \param name the name of the library.
*/
/*! \fn inline void Library::setUserUnits(double userUnits)
* \brief sets the user units.
*
* \param userUnits the value of the user units.
*/
/*! \fn inline void Library::setPhysUnits(double physUnits)
* \brief sets the physical units.
*
* \param physUnits the value of the physical units.
*/
/*! \fn bool Library::addStructure(Structure* str)
* \brief adds a Structure to the Library.
*
* \param str the Structure object to add.
*/
/*! \fn bool Library::writeToFile(std::string filename)
* \brief writes the database to file.
*
* \param filename the destination file name.
*
* \note When driving file, current date and time are used to define date in generated CIF file.
*/
}

View File

@ -0,0 +1,18 @@
// -*- C++ -*-
namespace AGDS {
/*! \class Rectangle
*
* This class describes a rectangle element and inherits from AGDS::Element.
*/
/*! \fn Rectangle::Rectangle(int layer, double xmin, double ymin, double xmax ,double ymax)
* \brief creates a new Rectangle
*
* \param layer the layer number into which the rectangle shape is drawned.
* \param xmin the x coordinate of the bottom-left corner of the rectangle.
* \param ymin the y coordinate of the bottom-left corner of the rectangle.
* \param xmax the x coordinate of the top-right corner of the rectangle.
* \param ymax the y coordinate of the top-right corner of the rectangle.
*/
}

View File

@ -0,0 +1,24 @@
// -*- C++ -*-
namespace AGDS {
/*! \class Structure
*
* This class describes a GDS Structure with a name and a list of Elements.
*/
/*! \fn Structure::Structure(std::string name)
* \brief creates a new Structure
*
* \param name the name of the structure.
*/
/*! \fn bool Structure::addElement(Element* element)
* \brief adds an Element to the Structure.
*
* \param element the Element object to add.
*/
/*! \fn inline std::string Structure::getName()
* \brief returns the name of the Structure.
*/
}

View File

@ -0,0 +1,50 @@
/*! \page AGDS AGDS Format
\section agdsPres Presentation
The <b>Ascii Graphic Database System (AGDS)</b> format is an ascii (text) version of the wellknown and industry standard GDS II binary format. This format hierarchicaly represents geometric shapes, labels and other layout informations (see http://en.wikipedia.org/wiki/GDSII for more informations). \n
The ascii format has several advantages versus binary format:
- human readable,
- easy to edit manually or with dedicated tools,
- easy to search or grep into,
- easy to compare and understand differences between two files,
- easy to convert.
The conversion from Ascii GDS to binary GDS and vice versa can be done with <b>OwlVision GDSII Viewer</b> available at http://owlvision.org\n
Since it has been developped in java, it can be run on all platforms.
\subsection agdsAutrhos Author
Damien Dupuis: damien.dupuis(at)lip6(.)fr
\subsection agdsLimits Limitations
Currently the only supported shape in this driver is the rectangle.
\section agdsDB Stand alone database structure
The database conists in for simple objects :
- AGDS::Library contains all AGDS library informations such as the name, the units used (user and physical) and the list of all Structures.
- AGDS::Structure describes a GDS Structure with a name and a list of Elements.
- AGDS::Element is an abstract class from which derived the AGDS::Rectangle.
- AGDS::Rectangle describes a rectangle element of a structure.
\subsection agdsDriver Using the driver
To drive an AGDS file, user has to create one AGDS::Library and add AGDS::Structure objects to it with the AGDS::Library::addStructure() method. Each AGDS::Structure contains at least one AGDS::Element added with AGDS::Structure::addElement() method.\n
All objects can be independently created as far as they are correctly added to their parent. \n
Once the library is completely specified, simply call the AGDS::Library::writeToFile() method to drive the database to file.
\section agdsExamples 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 two simple code examples to drive a AGDS file using C++ or Python. These two examples drive the same file \c transistor.agds:
\include transistor.agds
\image html transistorCif.png AGDS example layout
\image latex transistorCif.pdf AGDS example layout width=.25\linewidth
\subsection agdsC C++
Here is the C++ code (\c mainAgds.cpp) used to generate the transistor.agds file. (Source is available in examples directory).
\include mainAgds.cpp
\subsection agdsPython Python
Here is the Python code (\c testAgds.py) used to generate the transistor.agds file. (Source is available in examples directory).
\include testAgds.py
\note In order to run the \c testAgds.py script, user must ensure that $PYTHONPATH variable points to the directory containing pyAGDS.so module.
*/

View File

@ -0,0 +1,30 @@
// -*- C++ -*-
namespace CIF {
/*! \class Circuit
*
* This class contains all CIF circuit informations such as the name, the unit used, the scale and the list of all Polygons.
*/
/*! \fn Circuit::Circuit(std::string name, std::string unit, double scale)
* \brief creates a new Circuit
*
* \param name the name of the circuit.
* \param unit the unit used for all distances & coordinates.
* \param scale the scale used to convert DB unit to real unit (specified by the unit).
*/
/*! \fn bool Circuit::addPolygon(Polygon* polygon)
* \brief adds a Polygon to the Circuit.
*
* \param polygon the Polygon object to add.
*/
/*! \fn bool Circuit::writeToFile(std::string filename)
* \brief writes the database to file.
*
* \param filename the destination file name.
*
* \note When driving file, current date and time are used to define date in generated CIF file.
*/
}

View File

@ -0,0 +1,22 @@
// -*- C++ -*-
namespace CIF {
/*! \class Polygon
*
* This class describes a polygon shape, which consists in a set of points (ie (x,y) pair).
*/
/*! \fn Polygon::Polygon(long layer)
* \brief creates a new Polygon.
*
* \param layer the layer on which the polygon is created.
*/
/*! \fn Polygon::addPoint(long x, long y)
* \brief adds a point to the polygon.
*
* \param x the x coordinate of the point.
* \param y the y coordinate of the point.
*/
}

37
vlsisapd/doc/cif/cif.dox Normal file
View File

@ -0,0 +1,37 @@
/*! \page CIF CIF Format
\section cifPres Presentation
The <b>Caltech Intermediate Format (CIF)</b> consists in a limited set of graphic primitives used to describe the shapes on each layer of an integrated circuit (see http://en.wikipedia.org/wiki/Caltech_Intermediate_Form for more informations). \n
\subsection cifAutrhos Author
Damien Dupuis: damien.dupuis(at)lip6(.)fr
\subsection cifLimits Limitations
Although the CIF format allows hierarchical description and supports several shapes, in this driver, we do not use hierarchy and only use Polygons.
\section cifDB Stand alone database structure
The database consists in two simple objects :
- CIF::Circuit contains all CIF circuit informations such as the name, the unit used, the scale and the list of all Polygons.
- CIF::Polygon describes a Polygon (a set of points).
\subsection cifDriver Using the driver
To drive a CIF file, user has to create one CIF::Circuit and as many CIF::Polygon as the number of shapes of the layout. The CIF::Polygon objects can be created independently from for the CIF::Circuit but must be finally added to the CIF::Circuit using CIF::Circuit::addPolygon().\n
Once the CIF::Circuit is complete, simply call the CIF::Circuit::writeToFile() method to drive the database to file.
\section cifExamples 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 two simple code examples to drive a CIF file using C++ or Python. These two examples drive the same file \c transistor.cif:
\include transistor.cif
\image html transistorCif.png CIF example layout
\image latex transistorCif.pdf CIF example layout width=.25\linewidth
\subsection cifC C++
Here is the C++ code (\c mainCif.cpp) used to generate the transistor.cif file. (Source is available in examples directory).
\include mainCif.cpp
\subsection cifPython Python
Here is the Python code (\c testCif.py) used to generate the transistor.cif file. (Source is available in examples directory).
\include testCif.py
\note In order to run the \c testCif.py script, user must ensure that $PYTHONPATH variable points to the directory containing pyCIF.so module.
*/

1518
vlsisapd/doc/doxyfile Normal file

File diff suppressed because it is too large Load Diff

16
vlsisapd/doc/footer.html Normal file
View File

@ -0,0 +1,16 @@
<br>
<hr>
<table class="footer1">
<tr>
<td class="LFooter"><small>Generated by doxygen $doxygenversion on $date</small></td>
<td class="RFooter"><a href='#pagetop'><small>Return to top of page</small></a></td>
</tr>
</table>
<table class="footer2">
<tr>
<td class="LFooter">VLSI SAPD Documentation</td>
<td class="RFooter"><small>Copyright &#169; 2010 <a href="http://www.upmc.fr">UPMC</a> All rights reserved</small></td>
</tr>
</table>
</body>
</html>

21
vlsisapd/doc/header.html Normal file
View File

@ -0,0 +1,21 @@
<!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="_c_i_f.html">CIF</a></td>
<td><a href="_a_g_d_s.html">AGDS</a></td>
<td><a href="_contact.html">Links & Contact</a></td>
</tr>
</table>
</center>
<br>
<hr>
<body>

3
vlsisapd/doc/img/pngToPdf.sh Executable file
View File

@ -0,0 +1,3 @@
for file in `ls *.png`; do
convert $file -pointsize 72 -colorspace RGB -compress JPEG `basename $file .png`.pdf;
done

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

37
vlsisapd/doc/mainPage.dox Normal file
View File

@ -0,0 +1,37 @@
/*! \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.
The list of supported parser & drivers is shown in next table :
<center>
<table border=1 width=60%>
<tr>
<td><center><b>Format</b></center></td>
<td><center><b>Parser</b></center></td>
<td><center><b>Driver</b></center></td>
</tr><tr>
<td>CIF</td>
<td></td>
<td><center>x</center></td>
</tr><tr>
<td>AGDS</td>
<td></td>
<td><center>x</center></td>
</tr><tr>
<td>DTR</td>
<td><center>x</center></td>
<td></td>
</tr><tr>
<td>OPENCHAMS</td>
<td><center>x</center></td>
<td><center>x</center></td>
</tr>
</table>
</center>
To quickly access to documentation of a format, one can use the following links :
- \subpage CIF CIF Format
- \subpage AGDS AGDS Format
*/

485
vlsisapd/doc/stylesheet.css Normal file
View File

@ -0,0 +1,485 @@
/*
* x-----------------------------------------------------------------x
* | HTML Standart Tags |
* x-----------------------------------------------------------------x
*/
html, body, th, td, tr, p, li, h1, h2, h3, h4, h5, h6 {
font-size: 96%;
font-family: verdana, sans-serif;
}
body {
color: black;
background: white;
background-color: white;
background-position: top left;
background-attachment: fixed;
background-repeat: no-repeat;
margin-top: 2em;
margin-right: 8%;
margin-left: 8%;
}
hr {
height: 1px;
border: 0;
color: #304A67;
background-color: #304A67;
}
h1, h2, h3, h4, h5, h6 {
font-family: verdana, sans-serif;
}
h1 { text-align: center; }
h2, h3, h4, h5, h6 { text-align: left;
padding-top: 2em;
}
h1, h2, h3 { font-family: "Trebuchet MS", sans-serif;
color: #375275;
}
h1 { font-weight: bold; font-size: 170%; }
h2 { font-weight: bold; font-size: 140%; }
h3 { font-weight: bold; font-size: 118%; }
h4 { font-weight: bold; font-size: 100%; }
h5 { font-style: italic; font-size: 100%; }
h6 { font-variant: small-caps; font-size: 100%; }
h2.classHierarchy {
/*border: 1px none #30629C;*/
border: 1px none #000000;
border-top-width: 2px;
border-top-style: solid;
padding-top: 1em;
}
.hide {
display: none;
color: white;
}
p {
margin-top: 0.6em;
margin-bottom: 0.6em;
margin-left: 0.0em;
margin-right: 0.0em;
}
address {
text-align: right;
font-weight: bold;
font-style: italic;
font-size: 80%;
}
caption { font-weight: bold }
blockquote {
margin-left: 4em;
margin-right: 4em;
margin-top: 0.8em;
margin-bottom: 0.8em;
font-style: italic;
color: #304359;
}
blockquote p {
margin-bottom: 0;
}
blockquote address {
margin: 0;
}
table {
border-collapse: collapse;
}
dt, dd { margin-top: 0; margin-bottom: 0; }
dt { font-weight: bold; }
pre, tt, code {
font-family: "andale mono", monospace;
font-size: 100%;
white-space: pre;
}
pre {
font-size: 80%;
border: dashed;
border-width: thin;
border-color: #304359;
/*
background-color: #EEEEEE;
*/
background-color: #FCFCE1;
padding: 0.5em;
margin-left: 2em;
margin-right: 2em
}
tt { color: #3090FF; }
em { font-style: italic;
font-weight: bold; }
strong { font-weight: bold; }
span.textit { font-style: italic; }
span.textbf { font-weight: bold; }
.small { font-size: 90%; }
.white { color: #FFFFFF; }
ul.toc {
list-style: disc;
list-style: none;
}
a:link img, a:visited img { border-style: none; }
a img { color: white; }
a:link, a:active, a:visited {
color: #375275;
text-decoration: none;
}
a:hover, a:focus {
color: #FF9900;
text-decoration: underline;
}
/*
* x-----------------------------------------------------------------x
* | Doxygen Specific Classes |
* x-----------------------------------------------------------------x
*/
/* -------------------------------------------------------------------
* Header & Footer Classes (customized top page navigation bar).
*/
h1.header {
font-size: 200%;
font-family: times, verdana, sans-serif;
}
center.header {
background-color: #D4E1EB;
}
table.header {
/*width: 100%;*/
/*background-color: #EEEEEE;*/
background-color: #D4E1EB;
}
table.header td {
padding: 2px 14px;
text-align: center;
font-weight: bold;
font-family: verdana, sans-serif;
font-size: 110%;
}
table.footer1, table.footer2 { width: 100%; }
td.LFooter { text-align: left; }
td.RFooter { text-align: right; }
td.CFooter { text-align: center;}
table.footer2 td.RFooter { font-weight: bold; width: 35% }
table.footer2 td.CFooter { width: 30% }
table.footer2 td.LFooter { font-weight: bold; width: 35%; font-family: time; }
table.classHierarchy {
border-collapse: separate;
border-spacing: 5px;
font-size: 110%;
}
table.classHierarchy tr {
border: 1px solid blue;
}
table.classHierarchy td.normal {
border: 1px solid #D4E1EB;
width: 140pt;
text-align: center;
font-weight: bold;
background-color: #D4E1EB;
}
table.classHierarchy td.virtual {
border: 1px solid black;
width: 140pt;
text-align: center;
font-weight: bold;
}
table.classHierarchy td.wnormal {
border: 1px solid #D4E1EB;
width: 240pt;
text-align: center;
font-weight: bold;
background-color: #D4E1EB;
}
table.classHierarchy td.wvirtual {
border: 1px solid black;
width: 240pt;
text-align: center;
font-weight: bold;
}
div.ah {
font-family: time;
font-size: 250%;
}
/* -------------------------------------------------------------------
* Quick Index Class (top page navigation bar).
*/
div.qindex, div.nav {
width: 100%-4px;
/*background-color: #DADAEF;*/
/*background-color: #eeeeff;*/
/*background-color: #EEEEEE;*/
background-color: #D4E1EB;
border: 0px solid #304359;
text-align: center;
margin: 0px;
padding: 2px;
line-height: 140%;
}
a.qindex, a.qindex:visited, a.qindex:hover, a.qindexHL, a.el, a.elRef {
text-decoration: none;
font-weight: bold;
}
a.qindex, a.qindex:visited {
color: #375275;
}
a.qindex:hover {
background-color: #ddddff;
}
a.qindexHL, a.qindexHL:hover, a.qindexHL:visited {
background-color: #3A6291;
color: #ffffff;
border: 1px double #9295C2;
}
a.code:link, a.code:visited, a.codeRef:link, a.codeRef:visited {
text-decoration: none;
font-weight: normal;
color: #0000ff;
}
.indexkey {
background-color: #eeeeff;
border: 1px solid #b0b0b0;
padding: 2px 15px;
}
.indexkey, .indexvalue {
background-color: #eeeeff;
border: 1px solid #b0b0b0;
padding: 2px 15px;
}
.indexkey {
width: 40%;
}
.indexvalue {
width: 80%;
}
h3 a[name="index__"],
h3 a[name="index_a"],
h3 a[name="index_b"],
h3 a[name="index_c"],
h3 a[name="index_d"],
h3 a[name="index_e"],
h3 a[name="index_f"],
h3 a[name="index_g"],
h3 a[name="index_h"],
h3 a[name="index_i"],
h3 a[name="index_j"],
h3 a[name="index_k"],
h3 a[name="index_l"],
h3 a[name="index_m"],
h3 a[name="index_n"],
h3 a[name="index_o"],
h3 a[name="index_p"],
h3 a[name="index_q"],
h3 a[name="index_r"],
h3 a[name="index_s"],
h3 a[name="index_t"],
h3 a[name="index_u"],
h3 a[name="index_v"],
h3 a[name="index_w"],
h3 a[name="index_x"],
h3 a[name="index_y"],
h3 a[name="index_z"],
h3 a[name="index_0"],
h3 a[name="index_1"],
h3 a[name="index_2"],
h3 a[name="index_3"],
h3 a[name="index_4"],
h3 a[name="index_5"],
h3 a[name="index_6"],
h3 a[name="index_7"],
h3 a[name="index_8"],
h3 a[name="index_9"]
{
font-family: time;
font-size: 250%;
}
/* -------------------------------------------------------------------
* Verbatim Source Code / Examples.
*/
/* pre.fragment { background-color: #EEEEEE; } */
span.keyword { color: #008000 }
span.keywordtype { color: #604020 }
span.keywordflow { color: #e08000 }
span.comment { color: #800000 }
span.preprocessor { color: #806020 }
span.stringliteral { color: #002080 }
span.charliteral { color: #008080 }
/* -------------------------------------------------------------------
* Attributes Listing.
*/
.mdTable {
/*border: 1px solid #868686;*/
/*background-color: #DADAEF;*/
/*background-color: #F4F4FB;*/
border: 1px none #30629C;
border-left-width: 1px;
border-left-style: solid;
/*background-color: #B8E6B8;*/
/*background-color: #D4E1EB;*/
margin-top: 25px;
font-size: 105%;
}
.mdRow {
padding: 5px 10px;
}
/* This Mozilla/Firefox bug has been corrected from v1.5.
* .mdname1 {
* padding: 3px 0px 0px 0px;
* }
*/
.mdescLeft, .mdescRight {
padding: 0px 8px 4px 8px;
font-size: 11px;
font-style: italic;
/*background-color: #FAFAFA;*/
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
}
.memitem {
margin-bottom: 30px;
border: 1px none #30629C;
}
.memproto {
background-color: #D4E1EB;
border-left-width: 4px;
border-left-style: solid;
border-color: #30629C;
}
.memname {
white-space: nowrap;
padding-left: 5px;
font-size: 105%;
}
.memdoc{
padding-left: 5px;
/*margin-top: -8px;*/
border-left-width: 1px;
border-left-style: solid;
border-color: #30629C;
}
.memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #0c0c0c;
border-right-color: #0c0c0c;
border-bottom-color: #0c0c0c;
border-left-color: #0c0c0c;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
/*background-color: #DADAEF;*/
/*background-color: #eeeeff;*/
/*background-color: #EEEEEE;*/
background-color: #D4E1EB;
}
.memTemplItemLeft, .memTemplItemRight {
border-bottom-width: 2px;
border-bottom-style: solid;
font-weight: bold;
}
.memItemLeft { font-size: 11px; }
.memItemRight { font-size: 12px; }
.memTemplItemLeft { font-size: 11px; }
.memTemplItemRight { font-size: 12px; }
.memTemplParams {
color: #FFFFFF;
background-color: #000000;
font-size: 11px;
font-weight: bold;
}
.groupText, .groupHeader {
color: #375275;
margin-top: 15px;
font-size: 130%;
font-weight: bold;
}

View File

@ -0,0 +1,2 @@
ADD_SUBDIRECTORY(cif)
ADD_SUBDIRECTORY(agds)

View File

@ -0,0 +1 @@
ADD_SUBDIRECTORY(cplusplus)

View File

@ -0,0 +1,4 @@
INCLUDE_DIRECTORIES ( ${VLSISAPD_SOURCE_DIR}/src/agds/src )
ADD_EXECUTABLE ( testAgds mainAgds.cpp )
TARGET_LINK_LIBRARIES ( testAgds agds ) # 'testAgds' is the name of the executable and 'agds' the name of the target library in agds/src/CMakeLists.txt
INSTALL ( TARGETS testAgds DESTINATION bin )

View File

@ -0,0 +1,28 @@
#include <string>
using namespace std;
#include "vlsisapd/agds/Library.h"
#include "vlsisapd/agds/Structure.h"
#include "vlsisapd/agds/Rectangle.h"
int main(int argc, char * argv[]) {
AGDS::Library* lib = new AGDS::Library(string("myTestLib"));
lib->setUserUnits(0.001);
lib->setPhysUnits(1.0E-9);
AGDS::Rectangle* poly = new AGDS::Rectangle( 17, 305, 150, 365, 830 );
AGDS::Rectangle* active = new AGDS::Rectangle( 6, 130, 290, 540, 690 );
AGDS::Structure* str = new AGDS::Structure("Transistor");
str->addElement(poly);
str->addElement(active);
lib->addStructure(str);
lib->writeToFile("./transistor.agds");
return 0;
}

View File

@ -0,0 +1,14 @@
import pyAGDS
lib = pyAGDS.Library("myTestLib")
lib.setUserUnits(0.001)
lib.setPhysUnits(1.0e-9)
active = pyAGDS.Rectangle( 6, 120, 290, 540, 690) # layer 6 corresponds to active
poly = pyAGDS.Rectangle(17, 305, 150, 365, 830) # layer 17 corresponds to polysilicium
str = pyAGDS.Structure("Transistor")
str.addElement(active)
str.addElement(poly)
lib.addStructure(str)
lib.writeToFile("./transistor.agds")

View File

@ -0,0 +1,38 @@
HEADER 5;
BGNLIB;
LASTMOD {10-06-11 14:02:15};
LASTACC {10-06-11 14:02:15};
LIBNAME myTestLib.DB;
UNITS;
USERUNITS 0.001;
PHYSUNITS 1.000000e-09;
BGNSTR;
CREATION {10-06-11 14:02:15};
LASTMOD {10-06-11 14:02:15};
STRNAME Transistor;
BOUNDARY;
LAYER 17;
DATATYPE 0;
XY 5;
X: 305; Y: 150;
X: 305; Y: 830;
X: 365; Y: 830;
X: 365; Y: 150;
X: 305; Y: 150;
ENDEL;
BOUNDARY;
LAYER 6;
DATATYPE 0;
XY 5;
X: 130; Y: 290;
X: 130; Y: 690;
X: 540; Y: 690;
X: 540; Y: 290;
X: 130; Y: 290;
ENDEL;
ENDSTR;
ENDLIB;

View File

@ -0,0 +1 @@
ADD_SUBDIRECTORY(cplusplus)

View File

@ -0,0 +1,4 @@
INCLUDE_DIRECTORIES ( ${VLSISAPD_SOURCE_DIR}/src/cif/src )
ADD_EXECUTABLE ( testCif mainCif.cpp )
TARGET_LINK_LIBRARIES ( testCif cif ) # 'testCif' is the name of the executable and 'cif' the name of the target library in cif/src/CMakeLists.txt
INSTALL ( TARGETS testCif DESTINATION bin )

View File

@ -0,0 +1,30 @@
#include <string>
using namespace std;
#include "vlsisapd/cif/Circuit.h"
#include "vlsisapd/cif/Polygon.h"
int main(int argc, char * argv[]) {
CIF::Circuit* circuit = new CIF::Circuit(string("Transistor"), string("micro"), 0.001);
// Layer #6 corresponds to active
CIF::Polygon* poly = new CIF::Polygon(6);
poly->addPoint(130, 290);
poly->addPoint(540, 290);
poly->addPoint(540, 690);
poly->addPoint(130, 690);
circuit->addPolygon(poly);
// Layer #17 corresponds to polysilicium
poly = new CIF::Polygon(17);
poly->addPoint(305, 150);
poly->addPoint(365, 150);
poly->addPoint(365, 830);
poly->addPoint(305, 830);
circuit->addPolygon(poly);
circuit->writeToFile("./transistor.cif");
return 0;
}

View File

@ -0,0 +1,17 @@
import pyCIF
circuit = pyCIF.Circuit("Transistor", "micro", 0.001)
poly1 = pyCIF.Polygon(6)
poly1.addPoint(130, 290)
poly1.addPoint(540, 290)
poly1.addPoint(540, 690)
poly1.addPoint(130, 690)
circuit.addPolygon(poly1)
poly2 = pyCIF.Polygon(17)
poly2.addPoint(305, 150);
poly2.addPoint(365, 150);
poly2.addPoint(365, 830);
poly2.addPoint(305, 830);
circuit.addPolygon(poly2)
circuit.writeToFile("./transistor.cif")

View File

@ -0,0 +1,9 @@
(CIF file written on 11-Jun-2010 13:49:44 by VLSISAPD_CIF_DRIVER);
(Units: micro - UU/DB Scale: 0.001);
DS 1 1 1;
9 Transistor;
L 6; P 130,290 540,290 540,690 130,690;
L 17; P 305,150 365,150 365,830 305,830;
DF;
C 1;
E

View File

@ -1,16 +1,30 @@
INCLUDE_DIRECTORIES(${VLSISAPD_SOURCE_DIR}/src/agds/src)
INCLUDE_DIRECTORIES(${VLSISAPD_SOURCE_DIR}/src/agds/src ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_PATH})
SET ( includes vlsisapd/agds/GdsLibrary.h
vlsisapd/agds/GdsStructure.h
vlsisapd/agds/GdsElement.h
vlsisapd/agds/GdsRectangle.h
SET ( hpps vlsisapd/agds/Library.h
vlsisapd/agds/Structure.h
vlsisapd/agds/Element.h
vlsisapd/agds/Rectangle.h
)
SET ( cpps GdsLibrary.cpp
GdsStructure.cpp
GdsRectangle.cpp
SET ( cpps Library.cpp
Structure.cpp
Rectangle.cpp
)
SET ( pycpps PyAgds.cpp
${cpps}
)
ADD_LIBRARY(agds ${cpps})
INSTALL(TARGETS agds DESTINATION lib${LIB_SUFFIX})
INSTALL(FILES ${includes} DESTINATION include/vlsisapd/agds)
INSTALL(FILES ${hpps} DESTINATION include/vlsisapd/agds)
IF(Boost_FOUND)
ADD_LIBRARY(pyAGDS MODULE ${pycpps})
SET_TARGET_PROPERTIES(pyAGDS PROPERTIES
COMPILE_FLAGS "${COMPILE_FLAGS} -D__PYTHON_MODULE__=1"
PREFIX ""
)
TARGET_LINK_LIBRARIES(pyAGDS agds ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
INSTALL(TARGETS pyAGDS DESTINATION ${PYTHON_SITE_PACKAGES})
ENDIF(Boost_FOUND)

View File

@ -3,17 +3,18 @@
#include <ctime>
using namespace std;
#include "vlsisapd/agds/GdsLibrary.h"
#include "vlsisapd/agds/Library.h"
#include "vlsisapd/agds/Structure.h"
namespace vlsisapd {
namespace AGDS {
GdsLibrary::GdsLibrary(string libName)
Library::Library(string libName)
: _libName(libName)
, _userUnits(0.00)
, _physUnits(0.00) {}
bool GdsLibrary::addStructure(GdsStructure* gdsStruct) {
bool Library::addStructure(Structure* gdsStruct) {
if(gdsStruct)
_structs.push_back(gdsStruct);
else {
@ -23,7 +24,7 @@ bool GdsLibrary::addStructure(GdsStructure* gdsStruct) {
return true;
}
bool GdsLibrary::write(string filename) {
bool Library::writeToFile(string filename) {
time_t curtime = time(0);
tm now = *localtime(&curtime);
char date[BUFSIZ]={0};
@ -46,7 +47,7 @@ bool GdsLibrary::write(string filename) {
file.unsetf(ios::floatfield);
// For each Struct : write struct.
for ( vector<GdsStructure*>::iterator it = _structs.begin() ; it < _structs.end() ; it++ ) {
for ( vector<Structure*>::iterator it = _structs.begin() ; it < _structs.end() ; it++ ) {
(*it)->write(file);
}

View File

@ -0,0 +1,35 @@
using namespace std;
#include <boost/python.hpp>
using namespace boost::python;
#include "vlsisapd/agds/Library.h"
#include "vlsisapd/agds/Structure.h"
#include "vlsisapd/agds/Element.h"
#include "vlsisapd/agds/Rectangle.h"
namespace AGDS {
BOOST_PYTHON_MODULE(pyAGDS) {
// class AGDS::Element
class_<Element, boost::noncopyable>("Element", no_init) // abstract class : noncopyable + no_init
;
// class AGDS::Rectangle
class_<Rectangle, bases<Element> >("Rectangle", init<int, double, double, double, double>())
;
// class AGDS::Structure
class_<Structure>("Structure", init<std::string>())
.def("addElement", &Structure::addElement )
.def("getName" , &Structure::getName )
;
// class AGDS::Library
class_<Library>("Library", init<std::string>())
.def("setUserUnits", &Library::setUserUnits)
.def("setPhysUnits", &Library::setPhysUnits)
.def("addStructure", &Library::addStructure)
.def("writeToFile" , &Library::writeToFile )
;
}
} // namespace

View File

@ -2,21 +2,21 @@
#include <iomanip>
using namespace std;
#include "vlsisapd/agds/GdsRectangle.h"
#include "vlsisapd/agds/Rectangle.h"
namespace vlsisapd {
GdsElement::~GdsElement () { }
namespace AGDS {
Element::~Element () { }
GdsRectangle::GdsRectangle(int layer, double xmin, double ymin, double xmax, double ymax)
: GdsElement(layer)
Rectangle::Rectangle(int layer, double xmin, double ymin, double xmax, double ymax)
: Element(layer)
, _xmin(xmin)
, _ymin(ymin)
, _xmax(xmax)
, _ymax(ymax) {}
GdsRectangle::~GdsRectangle () { }
Rectangle::~Rectangle () { }
bool GdsRectangle::write(ofstream &file) {
bool Rectangle::write(ofstream &file) {
file << "BOUNDARY;" << endl
<< "LAYER " << _layer << ";" << endl
<< "DATATYPE 0;" << endl
@ -31,4 +31,4 @@ bool GdsRectangle::write(ofstream &file) {
return true;
}
}
} // namespace

View File

@ -2,24 +2,25 @@
#include <ctime>
using namespace std;
#include "vlsisapd/agds/GdsStructure.h"
#include "vlsisapd/agds/Structure.h"
#include "vlsisapd/agds/Element.h"
namespace vlsisapd {
GdsStructure::GdsStructure(string strName)
namespace AGDS {
Structure::Structure(string strName)
: _strName(strName) {}
bool GdsStructure::addElement(GdsElement* gdsElement) {
bool Structure::addElement(Element* gdsElement) {
if(gdsElement)
_elements.push_back(gdsElement);
else {
cerr << "[GDS DRIVE ERROR]: cannot hold GdsElement." << endl;
cerr << "[GDS DRIVE ERROR]: cannot hold Element." << endl;
return false;
}
return true;
}
bool GdsStructure::write(ofstream &file) {
bool Structure::write(ofstream &file) {
time_t curtime = time(0);
tm now = *localtime(&curtime);
char date[BUFSIZ]={0};
@ -35,7 +36,7 @@ bool GdsStructure::write(ofstream &file) {
<< endl;
// For each Element : write element.
for ( vector<GdsElement*>::iterator it = _elements.begin() ; it < _elements.end() ; it++ ) {
for ( vector<Element*>::iterator it = _elements.begin() ; it < _elements.end() ; it++ ) {
(*it)->write(file);
}

View File

@ -0,0 +1,20 @@
#ifndef __GDS_ELEMENT_H
#define __GDS_ELEMENT_H
namespace AGDS {
class Element {
protected:
inline Element (int layer);
public:
virtual ~Element ();
virtual bool write (std::ofstream &file) = 0;
protected:
int _layer;
};
inline Element::Element(int layer) : _layer(layer) {}
}
#endif

View File

@ -1,20 +0,0 @@
#ifndef __GDS_ELEMENT_H
#define __GDS_ELEMENT_H
namespace vlsisapd {
class GdsElement {
protected:
inline GdsElement (int layer);
virtual ~GdsElement ();
public:
virtual bool write ( ofstream &file ) = 0;
protected:
int _layer;
};
inline GdsElement::GdsElement(int layer) : _layer(layer) {}
}
#endif

View File

@ -1,31 +0,0 @@
#ifndef __GDS_LIBRARY_H
#define __GDS_LIBRARY_H
#include <vector>
using namespace std;
#include "vlsisapd/agds/GdsStructure.h"
namespace vlsisapd {
class GdsLibrary {
public:
GdsLibrary(string libName);
inline void setUserUnits ( double userUnits );
inline void setPhysUnits ( double physUnits );
bool addStructure ( GdsStructure* );
bool write ( string fileName );
private:
string _libName;
double _userUnits;
double _physUnits;
vector<GdsStructure*> _structs;
};
inline void GdsLibrary::setUserUnits(double userUnits) { _userUnits = userUnits; };
inline void GdsLibrary::setPhysUnits(double physUnits) { _physUnits = physUnits; };
} // namespace
#endif

View File

@ -1,22 +0,0 @@
#ifndef __GDS_RECTANGLE_H
#define __GDS_RECTANGLE_H
#include <fstream>
#include "vlsisapd/agds/GdsElement.h"
namespace vlsisapd {
class GdsRectangle : public GdsElement {
public:
GdsRectangle (int layer, double xmin, double ymin, double xmax, double ymax);
virtual ~GdsRectangle ();
virtual bool write ( ofstream &file );
private:
double _xmin;
double _ymin;
double _xmax;
double _ymax;
};
}
#endif

View File

@ -1,29 +0,0 @@
#ifndef __GDS_STRUCTURE_H
#define __GDS_STRUCTURE_H
#include <fstream>
#include <string>
#include <vector>
using namespace std;
#include "vlsisapd/agds/GdsElement.h"
namespace vlsisapd {
class GdsStructure {
public:
GdsStructure(string strName);
bool addElement ( GdsElement* );
bool write ( ofstream &file );
inline string getName();
private:
string _strName;
vector<GdsElement*> _elements;
};
inline string GdsStructure::getName() { return _strName; };
}
#endif

View File

@ -0,0 +1,30 @@
#ifndef __GDS_LIBRARY_H
#define __GDS_LIBRARY_H
#include <vector>
namespace AGDS {
class Structure;
class Library {
public:
Library(std::string libName);
inline void setUserUnits ( double userUnits );
inline void setPhysUnits ( double physUnits );
bool addStructure ( Structure* );
bool writeToFile ( std::string fileName );
private:
std::string _libName;
double _userUnits;
double _physUnits;
std::vector<Structure*> _structs;
};
inline void Library::setUserUnits(double userUnits) { _userUnits = userUnits; };
inline void Library::setPhysUnits(double physUnits) { _physUnits = physUnits; };
} // namespace
#endif

View File

@ -0,0 +1,22 @@
#ifndef __GDS_RECTANGLE_H
#define __GDS_RECTANGLE_H
#include <fstream>
#include "vlsisapd/agds/Element.h"
namespace AGDS {
class Rectangle : public Element {
public:
Rectangle (int layer, double xmin, double ymin, double xmax, double ymax);
virtual ~Rectangle ();
virtual bool write(std::ofstream &file);
private:
double _xmin;
double _ymin;
double _xmax;
double _ymax;
};
}
#endif

View File

@ -0,0 +1,28 @@
#ifndef __GDS_STRUCTURE_H
#define __GDS_STRUCTURE_H
#include <fstream>
#include <string>
#include <vector>
namespace AGDS {
class Element;
class Structure {
public:
Structure(std::string strName);
bool addElement ( Element* );
bool write ( std::ofstream &file );
inline std::string getName();
private:
std::string _strName;
std::vector<Element*> _elements;
};
inline std::string Structure::getName() { return _strName; };
}
#endif

View File

@ -1,13 +1,27 @@
INCLUDE_DIRECTORIES(${CHAMS_SOURCE_DIR}/src/cif/src)
INCLUDE_DIRECTORIES(${VLSISAPD_SOURCE_DIR}/src/cif/src ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_PATH})
SET ( includes vlsisapd/cif/CifCircuit.h
vlsisapd/cif/CifPolygon.h
SET ( hpps vlsisapd/cif/Circuit.h
vlsisapd/cif/Polygon.h
)
SET ( cpps CifCircuit.cpp
CifPolygon.cpp
SET ( cpps Circuit.cpp
Polygon.cpp
)
SET ( pycpps PyCif.cpp
${cpps}
)
ADD_LIBRARY(cif ${cpps})
INSTALL(TARGETS cif DESTINATION lib${LIB_SUFFIX})
INSTALL(FILES ${includes} DESTINATION include/vlsisapd/cif)
INSTALL(FILES ${hpps} DESTINATION include/vlsisapd/cif)
IF(Boost_FOUND)
ADD_LIBRARY(pyCIF MODULE ${pycpps})
SET_TARGET_PROPERTIES(pyCIF PROPERTIES
COMPILE_FLAGS "${COMPILE_FLAGS} -D__PYTHON_MODULE__=1"
PREFIX ""
)
TARGET_LINK_LIBRARIES(pyCIF cif ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
INSTALL(TARGETS pyCIF DESTINATION ${PYTHON_SITE_PACKAGES})
ENDIF(Boost_FOUND)

View File

@ -3,15 +3,14 @@
#include <ctime>
using namespace std;
#include "vlsisapd/cif/CifCircuit.h"
#include "vlsisapd/cif/CifPolygon.h"
#include "vlsisapd/cif/Circuit.h"
#include "vlsisapd/cif/Polygon.h"
namespace vlsisapd {
CifCircuit::CifCircuit(string name, string unit, double scale) : _name(name), _unit(unit), _scale(scale) {}
namespace CIF {
Circuit::Circuit(string name, string unit, double scale) : _name(name), _unit(unit), _scale(scale) {}
bool CifCircuit::addPolygon(CifPolygon* polygon) {
bool Circuit::addPolygon(Polygon* polygon) {
if(polygon)
_polygons.push_back(polygon);
else {
@ -21,7 +20,7 @@ bool CifCircuit::addPolygon(CifPolygon* polygon) {
return true;
}
bool CifCircuit::write(string filename) {
bool Circuit::writeToFile(string filename) {
time_t curtime = time(0);
tm now = *localtime(&curtime);
char date[BUFSIZ]={0};
@ -38,7 +37,7 @@ bool CifCircuit::write(string filename) {
<< "9 " << _name << ";" << endl;
// For each Polygon : write polygon.
for ( vector<CifPolygon*>::iterator it = _polygons.begin() ; it < _polygons.end() ; it++ ) {
for ( vector<Polygon*>::iterator it = _polygons.begin() ; it < _polygons.end() ; it++ ) {
(*it)->write(file);
}

View File

@ -3,18 +3,17 @@
#include <ctime>
using namespace std;
#include "vlsisapd/cif/CifPolygon.h"
#include "vlsisapd/cif/Polygon.h"
namespace vlsisapd {
CifPolygon::CifPolygon(long layer) : _layer(layer) {}
namespace CIF {
Polygon::Polygon(long layer) : _layer(layer) {}
void CifPolygon::addPoint(long x, long y) {
void Polygon::addPoint(long x, long y) {
_points.push_back(pair<long,long>(x,y));
}
void CifPolygon::write(ofstream& file) {
void Polygon::write(ofstream& file) {
file << "L " << _layer << "; P";
// For each point : write point.

View File

@ -0,0 +1,22 @@
using namespace std;
#include <boost/python.hpp>
using namespace boost::python;
#include "vlsisapd/cif/Polygon.h"
#include "vlsisapd/cif/Circuit.h"
namespace CIF {
BOOST_PYTHON_MODULE(pyCIF) {
// class CIF::Polygon
class_<Polygon>("Polygon", init<long>())
.def("addPoint", &Polygon::addPoint)
;
// class CIF::Circuit
class_<Circuit>("Circuit", init<std::string, std::string, double>())
.def("addPolygon" , &Circuit::addPolygon )
.def("writeToFile", &Circuit::writeToFile)
;
}
} // namespace

View File

@ -1,23 +0,0 @@
#ifndef __CIF_CIRCUIT_H
#define __CIF_CIRCUIT_H
#include <vector>
namespace vlsisapd {
class CifPolygon;
class CifCircuit {
public:
CifCircuit(string name, string unit, double scale);
bool addPolygon ( CifPolygon* );
bool write ( string );
private:
string _name;
string _unit;
double _scale;
std::vector<CifPolygon*> _polygons;
};
} // namespace
#endif

View File

@ -0,0 +1,23 @@
#ifndef __CIF_CIRCUIT_H
#define __CIF_CIRCUIT_H
#include <vector>
namespace CIF {
class Polygon;
class Circuit {
public:
Circuit(std::string name, std::string unit, double scale);
bool addPolygon ( Polygon* );
bool writeToFile ( std::string );
private:
string _name;
string _unit;
double _scale;
std::vector<Polygon*> _polygons;
};
} // namespace
#endif

View File

@ -4,10 +4,10 @@
#include <vector>
#include <fstream>
namespace vlsisapd {
class CifPolygon {
namespace CIF {
class Polygon {
public:
CifPolygon(long);
Polygon(long);
void addPoint (long, long);
void write ( ofstream& );

View File

@ -1,12 +1,3 @@
FIND_PACKAGE(Boost 1.32.0 COMPONENTS python)
IF (Boost_FOUND)
MESSAGE(STATUS "Found Boost.Python libraries in ${Boost_INCLUDE_DIR} as ${Boost_LIBRARIES}")
FIND_PACKAGE(PythonLibs REQUIRED)
ELSE (Boost_FOUND)
MESSAGE(STATUS "Boost.Python libraries were not found")
ENDIF (Boost_FOUND)
INCLUDE_DIRECTORIES(${VLSISAPD_SOURCE_DIR}/src/dtr/src ${LIBXML2_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_PATH})
SET ( hpps vlsisapd/dtr/Techno.h