From de784342d6cf6f64feaeb027e0b971eaae678ad8 Mon Sep 17 00:00:00 2001 From: Stephanie Youssef Date: Wed, 23 Jul 2008 12:17:18 +0000 Subject: [PATCH] Capacitor Layout in progress --- chamsin/etc/technology.hcmos9.dtr.xml | 17 ++- chamsin/src/analogic/Capacitor.cpp | 147 ++++++++++++++++++++++++-- chamsin/src/analogic/Capacitor.h | 10 +- chamsin/src/tests/CMakeLists.txt | 6 +- chamsin/src/tests/CapacitorViewer.cpp | 16 +-- 5 files changed, 175 insertions(+), 21 deletions(-) diff --git a/chamsin/etc/technology.hcmos9.dtr.xml b/chamsin/etc/technology.hcmos9.dtr.xml index 02a39ab3..c3d225c9 100644 --- a/chamsin/etc/technology.hcmos9.dtr.xml +++ b/chamsin/etc/technology.hcmos9.dtr.xml @@ -38,5 +38,20 @@ - + + + + + + + + + + + + + + + + diff --git a/chamsin/src/analogic/Capacitor.cpp b/chamsin/src/analogic/Capacitor.cpp index 3b775143..3b719b84 100644 --- a/chamsin/src/analogic/Capacitor.cpp +++ b/chamsin/src/analogic/Capacitor.cpp @@ -1,13 +1,14 @@ -#include "hurricane/DataBase.h" #include "hurricane/Technology.h" #include "hurricane/Pad.h" #include "hurricane/UpdateSession.h" +#include "hurricane/DataBase.h" using namespace Hurricane; +#include "AEnv.h" +#include "ATechnology.h" #include "Capacitor.h" namespace { - Layer* getLayer(Technology* technology, const string& layerStr) { Layer* layer = technology->getLayer(layerStr); if (!layer) { @@ -22,27 +23,39 @@ Pad* createPad(Technology* technology, Net* net, const string& layerName) { Pad* pad = Pad::create(net, layer, emptyBox); return pad; } - - } + +//Déclaration des deux armatures: +//******************************* const Name Capacitor::BottomPlateName("BOTTOMPLATE"); const Name Capacitor::TopPlateName("TOPPLATE"); + +//la mise des valeurs initials: +//c'est le Constructeur: +//********************* Capacitor::Capacitor(Library* library, const Name& name): AnalogComponent(library, name), _bottomPlate(NULL), _topPlate(NULL), - _l(0), _w(0) + _l(0), _w(0), + _topPlate10(NULL), + _topPlate20(NULL),_topPlate30(NULL), + _bottomPlate00(NULL) {} + +//Déclaration de la library: +//************************* Capacitor* Capacitor::create(Library* library, const Name& name) { Capacitor* capacitor = new Capacitor(library, name); - capacitor->_postCreate(); - return capacitor; } + +//création des signaux et des noeuds: +//*********************************** void Capacitor::_postCreate() { Inherit::_postCreate(); @@ -54,5 +67,123 @@ void Capacitor::_postCreate() { _topPlate = Net::create(this, TopPlateName); _topPlate->setExternal(true); - _topPlate20 = createPad(technology, _topPlate, "cut6"); + _topPlate10 = createPad(technology, _topPlate, "topmim6"); + _topPlate20 = createPad(technology, _topPlate, "padopen"); + _topPlate30 = createPad(technology, _topPlate, "alucap"); + _bottomPlate00 = createPad(technology, _bottomPlate, "botmim6"); +} + + +//la fonction updateLayout +//qui met en oeuvre de nouvau les parametres du capa +//au cas ou il y a n' importe auel changement +//****************************************** +void Capacitor::updateLayout() { + DataBase* db = DataBase::getDB(); + + if (!db) { + throw Error("Error : no DataBase"); + } + Technology* techno = db->getTechnology(); + if (!techno) { + throw Error("Error : no Technology"); + } + + ATechnology* atechno = AEnv::getATechnology(); + + //**Pour topPlate20 -> PADOPEN-MIM + //******************************** + DbU::Unit widthCut6 = atechno->getPhysicalRule("padOpenMIMWidth")->getValue(); + DbU::Unit spacingCut6 = atechno->getPhysicalRule("padOpenMIMSpace")->getValue(); + DbU::Unit enclosureCut6 = atechno->getPhysicalRule("padOpenMIMMETAL6Enclosure")->getValue(); + + //**Pour topPlate30 -> ALUCAP-MIM + //******************************* + DbU::Unit widthAluCap = atechno->getPhysicalRule("aluCapMIMWidth")->getValue(); + DbU::Unit enclosureVia6 = atechno->getPhysicalRule("aluCapMIMVIA6Enclosure")->getValue(); + //DbU::Unit distanceAlucapTopmin = atechno->getPhysicalRule("aluCapMIMDistance")->getValue(); + DbU::Unit enclosureTopMim = atechno->getPhysicalRule("aluCapMIMTopMIM6Enclosure")->getValue(); + DbU::Unit enclosureBotMim = atechno->getPhysicalRule("aluCapMIMBotMIM6Enclosure")->getValue(); + //DbU::Unit distanceAluc = atechno->getPhysicalRule("minAlucapDistance")->getValue(); + + //**Pour topPlate10 -> TOPMIM6 + //**************************** + DbU::Unit widthTopmim = atechno->getPhysicalRule("topPlateMIMminWidth")->getValue(); + DbU::Unit spacingTopmim = atechno->getPhysicalRule("topPlateMIMSpacing")->getValue(); + DbU::Unit enclosureByBotmimTopmim = atechno->getPhysicalRule("topPlateMIMBotEnclosure")->getValue(); + //DbU::Unit enclosureVia6Topmim = atechno->getPhysicalRule("minViaEnclosure")->getValue(); + DbU::Unit enclosureBotmimContact = atechno->getPhysicalRule("topPlateMIMBotmimContact")->getValue(); + + //**Pour BottomPlate -> BOTMIM6 + //***************************** + DbU::Unit widthBotmim = atechno->getPhysicalRule("botPlateMIMWidth")->getValue(); + DbU::Unit spacingBotmim = atechno->getPhysicalRule("botPlateMIMSpacing")->getValue(); + DbU::Unit enclosureVia6Botmim = atechno->getPhysicalRule("botPlateMIMViaEnclosure")->getValue(); + + UpdateSession::open(); + DbU::setStringMode(1); + + + //*les Box*// + //*********// + + //topPlate 10: + //l'armature haute est le reference + //car la valeur du capa corespond au W et L de l'armature haute + //************************************************************* + DbU::Unit x10 = 0; + DbU::Unit y10 = 0; + DbU::Unit dx10 = _l; + DbU::Unit dy10 = _w; + Box box10(x10, y10, x10 + dx10, y10 + dy10); + _topPlate10->setBoundingBox(box10); + + //topPlate 30: + //*********** + DbU::Unit x30 = enclosureTopMim; + DbU::Unit y30 = enclosureTopMim; + DbU::Unit dx30 = _l -(2 * enclosureTopMim); + DbU::Unit dy30 = _w -(2 * enclosureTopMim) ; + Box box30(x30, y30, x30 + dx30, y30 + dy30); + _topPlate30->setBoundingBox(box30); + + //topPlate 20: + //*********** + DbU::Unit x20 = enclosureTopMim + enclosureVia6 ; + DbU::Unit y20 = enclosureTopMim + enclosureVia6 ; + DbU::Unit dx20 = _l -(2 * enclosureTopMim)-(2 * enclosureVia6 ); + DbU::Unit dy20 = _w -(2 * enclosureTopMim)-(2 * enclosureVia6 ); + Box box20(x20, y20, x20 + dx20, y20 + dy20); + _topPlate20->setBoundingBox(box20); + + //bottomPlate 00: + //************** + DbU::Unit x00 = 0 - enclosureByBotmimTopmim; + DbU::Unit y00 = 0 - enclosureByBotmimTopmim; + DbU::Unit dx00 = _l + (2 * enclosureByBotmimTopmim); + DbU::Unit dy00 = _w + (2 * enclosureByBotmimTopmim); + Box box00(x00, y00, x00 + dx00, y00 + dy00); + _bottomPlate00->setBoundingBox(box00); + + UpdateSession::close(); +} + + + +Record* Capacitor::_getRecord() const { + Record* record = Inherit::_getRecord(); + if (record) { + record->add(getSlot("BottomPlate", _bottomPlate)); + record->add(getSlot("TopPlate", _topPlate)); + + record->add(getSlot("L", &_l)); + record->add(getSlot("W", &_w)); + + record->add(getSlot("TopPlate20", _topPlate20)); + record->add(getSlot("TopPlate30", _topPlate30)); + record->add(getSlot("TopPlate10", _topPlate10)); + record->add(getSlot("BottomPlate00", _bottomPlate00)); + + } + return record; } diff --git a/chamsin/src/analogic/Capacitor.h b/chamsin/src/analogic/Capacitor.h index c2e52030..05ea9c50 100644 --- a/chamsin/src/analogic/Capacitor.h +++ b/chamsin/src/analogic/Capacitor.h @@ -9,7 +9,12 @@ class Capacitor : public AnalogComponent { static const Name TopPlateName; static Capacitor* create(Library* library, const Name& name); + void updateLayout(); + void setW(DbU::Unit value) { _w = value; updateLayout(); } + void setL(DbU::Unit value) { _l = value; updateLayout(); } + + virtual Record* _getRecord() const; protected: void _postCreate(); @@ -18,7 +23,10 @@ class Capacitor : public AnalogComponent { Net* _topPlate; DbU::Unit _l; DbU::Unit _w; - Pad *_topPlate20; + Pad* _topPlate10; + Pad* _topPlate20; + Pad* _topPlate30; + Pad* _bottomPlate00; Capacitor(Library* library, const Name& name); }; diff --git a/chamsin/src/tests/CMakeLists.txt b/chamsin/src/tests/CMakeLists.txt index 728cdfd2..18719b48 100644 --- a/chamsin/src/tests/CMakeLists.txt +++ b/chamsin/src/tests/CMakeLists.txt @@ -8,9 +8,9 @@ include_directories(${HURRICANE_INCLUDE_DIR} ${HURRICANE_GRAPHICAL_INCLUDE_DIR} ${CHAMSIN_SOURCE_DIR}/src/analogic ${CHAMSIN_SOURCE_DIR}/src/device) add_executable(transview TransistorViewer.cpp ${MOC_TRANSISTOR} TransistorTest.cpp) -add_executable(capview CapacitorViewer.cpp ${MOC_CAPACITOR} CapacitorTest.cpp) +add_executable(capaview CapacitorViewer.cpp ${MOC_CAPACITOR} CapacitorTest.cpp) target_link_libraries(transview atechnology analogic ${HURRICANE_LIBRARIES} ${HURRICANE_GRAPHICAL_LIBRARIES} ${QT_LIBRARIES}) -target_link_libraries(capview atechnology analogic ${HURRICANE_LIBRARIES} ${HURRICANE_GRAPHICAL_LIBRARIES} ${QT_LIBRARIES}) +target_link_libraries(capaview atechnology analogic ${HURRICANE_LIBRARIES} ${HURRICANE_GRAPHICAL_LIBRARIES} ${QT_LIBRARIES}) -install(TARGETS transview capview DESTINATION /bin) +install(TARGETS transview capaview DESTINATION /bin) diff --git a/chamsin/src/tests/CapacitorViewer.cpp b/chamsin/src/tests/CapacitorViewer.cpp index fabb3d4c..5d21c22e 100644 --- a/chamsin/src/tests/CapacitorViewer.cpp +++ b/chamsin/src/tests/CapacitorViewer.cpp @@ -18,14 +18,14 @@ CapacitorViewer::CapacitorViewer(Library* library) { exit(56); } - DbU::Unit capacitorMinL = 0; - DbU::Unit capacitorMaxL = 0; - DbU::Unit capacitorMinW = 0; - DbU::Unit capacitorMaxW = 0; + DbU::Unit capacitorMinL = aTechnology->getPhysicalRule("topPlateMIMminWidth")->getValue(); + DbU::Unit capacitorMaxL = 10 * capacitorMinL; + DbU::Unit capacitorMinW = aTechnology->getPhysicalRule("topPlateMIMminWidth")->getValue(); + DbU::Unit capacitorMaxW = 10 * capacitorMinW; _capacitor = Capacitor::create(library, Name("TEST")); - //_capacitor->setL(capacitorMinL); - //_capacitor->setW(capacitorMinW); + _capacitor->setL(capacitorMinL); + _capacitor->setW(capacitorMinW); _cellWidget = new CellWidget; _cellWidget->setCell(_capacitor); _cellWidget->fitToContents(); @@ -56,11 +56,11 @@ CapacitorViewer::CapacitorViewer(Library* library) { } void CapacitorViewer::wvalueChanged(int value) { - //_capacitor->setW(value); + _capacitor->setW(value); _cellWidget->redraw(); } void CapacitorViewer::lvalueChanged(int value) { - //_capacitor->setL(value); + _capacitor->setL(value); _cellWidget->redraw(); }