From 5887a0b59f4a5651c94a54556cb6082b67be7333 Mon Sep 17 00:00:00 2001 From: Damien Dupuis Date: Mon, 22 Nov 2010 10:21:52 +0000 Subject: [PATCH] !! Adding support for subCircuits !!! * New section in that lists the pathes that contain subCircuits xml files * New Device object that inherits from simplified Instance object. - Instance has a name, a model, some connectors and optionnal parameters - Device has the same attributes plus mosType, sourceBulkConnected and transistors * Updated readFromFile and wrtieToFile methods to support these modifications * Updated parse and drive examples to support these modifications - Note: only C++ examples has been updated since my boost.python environment is actually totaly broken * New buffer.xml example that uses subCircuits. --- vlsisapd/src/openChams/src/CMakeLists.txt | 2 + vlsisapd/src/openChams/src/Circuit.cpp | 89 ++++++++++++++----- vlsisapd/src/openChams/src/Device.cpp | 34 +++++++ vlsisapd/src/openChams/src/Instance.cpp | 17 +--- vlsisapd/src/openChams/src/Netlist.cpp | 22 ++++- vlsisapd/src/openChams/src/PyOpenChams.cpp | 12 +-- .../src/vlsisapd/openChams/Circuit.h | 7 +- .../openChams/src/vlsisapd/openChams/Device.h | 51 +++++++++++ .../src/vlsisapd/openChams/Instance.h | 19 +--- .../src/vlsisapd/openChams/Netlist.h | 6 +- 10 files changed, 194 insertions(+), 65 deletions(-) create mode 100644 vlsisapd/src/openChams/src/Device.cpp create mode 100644 vlsisapd/src/openChams/src/vlsisapd/openChams/Device.h diff --git a/vlsisapd/src/openChams/src/CMakeLists.txt b/vlsisapd/src/openChams/src/CMakeLists.txt index 6d67dde6..0bba11a1 100644 --- a/vlsisapd/src/openChams/src/CMakeLists.txt +++ b/vlsisapd/src/openChams/src/CMakeLists.txt @@ -3,6 +3,7 @@ INCLUDE_DIRECTORIES(${VLSISAPD_SOURCE_DIR}/src/openChams/src ${LIBXML2_INCLUDE_D SET ( hpps vlsisapd/openChams/Circuit.h vlsisapd/openChams/Netlist.h vlsisapd/openChams/Instance.h + vlsisapd/openChams/Device.h vlsisapd/openChams/Net.h vlsisapd/openChams/Name.h vlsisapd/openChams/Operator.h @@ -17,6 +18,7 @@ SET ( hpps vlsisapd/openChams/Circuit.h SET ( cpps Circuit.cpp Netlist.cpp Instance.cpp + Device.cpp Net.cpp Name.cpp Operator.cpp diff --git a/vlsisapd/src/openChams/src/Circuit.cpp b/vlsisapd/src/openChams/src/Circuit.cpp index b81a3831..dc8d424e 100644 --- a/vlsisapd/src/openChams/src/Circuit.cpp +++ b/vlsisapd/src/openChams/src/Circuit.cpp @@ -17,6 +17,7 @@ using namespace std; #include "vlsisapd/openChams/Circuit.h" #include "vlsisapd/openChams/Netlist.h" #include "vlsisapd/openChams/Instance.h" +#include "vlsisapd/openChams/Device.h" #include "vlsisapd/openChams/Net.h" #include "vlsisapd/openChams/Schematic.h" #include "vlsisapd/openChams/SimulModel.h" @@ -38,6 +39,7 @@ namespace { namespace OpenChams { +static bool readSubCircuitsPathesDone = false; static bool readCircuitParametersDone = false; static bool readSimulModelsDone = false; static bool readNetListDone = false; @@ -48,6 +50,7 @@ static bool readSizingDone = false; static bool readLayoutDone = false; Circuit::Circuit(Name name, Name techno) : _name(name), _techno(techno), _netlist(NULL), _schematic(NULL), _sizing(NULL), _layout(NULL) { + readSubCircuitsPathesDone = false; readCircuitParametersDone = false; readSimulModelsDone = false; readNetListDone = false; @@ -142,6 +145,32 @@ Name Circuit::readConnector(xmlNode* node) { } // CIRCUIT // +void Circuit::readSubCircuitsPathes(xmlNode* node) { + if (readSubCircuitsPathesDone) { + cerr << "[WARNING] Only one 'subCircuitsPathes' node is allowed in circuit, others will be ignored." << endl; + return; + } + if (node->type == XML_ELEMENT_NODE && node->children) { + for (xmlNode* pathNode = node->children ; pathNode ; pathNode = pathNode->next) { + if (pathNode->type == XML_ELEMENT_NODE) { + if (xmlStrEqual(pathNode->name, (xmlChar*)"path")) { + xmlChar* pathC = xmlGetProp(pathNode, (xmlChar*)"path"); + if (pathC) { + string path((const char*)pathC); + _subCircuitsPathes.push_back(path); + } else { + throw OpenChamsException("[ERROR] 'path' node must have 'path' property."); + } + } else { + cerr << "[WARNING] Only 'path' nodes are allowed under 'subCircuitsPathes' node." << endl; + return; + } + } + } + } + readSubCircuitsPathesDone = true; +} + void Circuit::readCircuitParameters(xmlNode* node) { if (readCircuitParametersDone) { cerr << "[WARNING] Only one 'parameters' node is allowed in circuit, others will be ignored." << endl; @@ -281,7 +310,7 @@ Instance* Circuit::readInstance(xmlNode* node, Netlist* netlist) { xmlChar* iMOSC = xmlGetProp(node, (xmlChar*)"mostype"); xmlChar* iSBCC = xmlGetProp(node, (xmlChar*)"sourceBulkConnected"); Instance* inst = NULL; - if (iNameC && iModelC && iMOSC && iSBCC) { + if (iNameC && iModelC && iMOSC && iSBCC) { // this is a device Name instanceName((const char*)iNameC); Name modelName((const char*)iModelC); string mosStr((const char*)iMOSC); @@ -293,9 +322,13 @@ Instance* Circuit::readInstance(xmlNode* node, Netlist* netlist) { vector sbcComps(sbcComp, sbcComp+4); check_lowercase(sourceBulkStr, sbcComps, "[ERROR] In 'instance', 'sourceBulkConnected' must 'true', 'false', 'on' or 'off'."); bool sourceBulkConnected = ((sourceBulkStr == "true") || (sourceBulkStr == "on")) ? true : false; - inst = netlist->addInstance(instanceName, modelName, Name(mosStr), sourceBulkConnected); + inst = (Instance*)netlist->addDevice(instanceName, modelName, Name(mosStr), sourceBulkConnected); + } else if (iNameC && iModelC && !iMOSC && !iSBCC) { // this is a subcircuit + Name instanceName((const char*)iNameC); + Name modelName((const char*)iModelC); + inst = netlist->addInstance(instanceName, modelName); } else { - throw OpenChamsException("[ERROR] 'instance' node must have 'name', 'model', 'mostype' and 'sourceBulkConnected' properties."); + throw OpenChamsException("[ERROR] 'instance' node must have ('name' and 'model') or ('name', 'model', 'mostype' and 'sourceBulkConnected') properties."); //return inst; } @@ -307,7 +340,9 @@ Instance* Circuit::readInstance(xmlNode* node, Netlist* netlist) { } else if (xmlStrEqual(node->name, (xmlChar*)"parameters")) { readInstanceParameters(node, inst); } else if (xmlStrEqual(node->name, (xmlChar*)"transistors")) { - readInstanceTransistors(node, inst); + if (!dynamic_cast(inst)) + throw OpenChamsException("[ERROR] Only device 'instance' (with 'mostype' and 'sourceBulkConnected' properties) can have 'transistors' section."); + readInstanceTransistors(node, static_cast(inst)); } else { //cerr << "[WARNING] Only 'parameters' node is allowed in 'instance', others will be ignored." << endl; cerr << "[WARNING] Only 'conectors', 'transistors' and 'parameters' nodes are allowed in 'instance', others will be ignored." << endl; @@ -352,12 +387,12 @@ void Circuit::readInstanceParameters(xmlNode* node, Instance* inst) { } } -void Circuit::readInstanceTransistors(xmlNode* node, Instance* inst) { +void Circuit::readInstanceTransistors(xmlNode* node, Device* dev) { xmlNode* child = node->children; for (xmlNode* node = child; node; node = node->next) { if (node->type == XML_ELEMENT_NODE) { if (xmlStrEqual(node->name, (xmlChar*)"transistor")) { - readTransistor(node, inst); + readTransistor(node, dev); } else { cerr << "[WARNING] Only 'transistor' nodes are allowed in 'transistors', others will be ignored." << endl; } @@ -366,12 +401,12 @@ void Circuit::readInstanceTransistors(xmlNode* node, Instance* inst) { } } -void Circuit::readTransistor(xmlNode* node, Instance* inst) { +void Circuit::readTransistor(xmlNode* node, Device* dev) { xmlChar* tNameC = xmlGetProp(node, (xmlChar*)"name"); Transistor* trans = NULL; if (tNameC) { Name tName((const char*)tNameC); - trans = inst->addTransistor(tName); + trans = dev->addTransistor(tName); } else { throw OpenChamsException("[ERROR] 'transistor' node must have 'name' property."); //return inst; @@ -708,7 +743,10 @@ Circuit* Circuit::readFromFile(const string filePath) { xmlNode* child = rootElement->children; for (xmlNode* node = child; node; node = node->next) { if (node->type == XML_ELEMENT_NODE) { - if (xmlStrEqual(node->name, (xmlChar*)"parameters")) { + if (xmlStrEqual(node->name, (xmlChar*)"subCircuitsPathes")) { + cir->readSubCircuitsPathes(node); + } + else if (xmlStrEqual(node->name, (xmlChar*)"parameters")) { cir->readCircuitParameters(node); } else if (xmlStrEqual(node->name, (xmlChar*)"simulModels")) { @@ -830,6 +868,7 @@ bool Circuit::writeToFile(string filePath) { sort(instances.begin(), instances.end(), InstanceNameSort); // sort based on instances' names for (vector::iterator it = instances.begin() ; it != instances.end() ; ++it) { Instance* inst = (*it); + Device* dev = dynamic_cast(inst); if (inst->hasNoConnectors()) { string error("[ERROR] Cannot writeToFile since instance ("); error += inst->getName().getString(); @@ -837,27 +876,33 @@ bool Circuit::writeToFile(string filePath) { throw OpenChamsException(error); //return false; } - if (inst->hasNoTransistors()) { - string error("[ERROR] Cannot writeToFile since instance ("); - error += inst->getName().getString(); + if (dev && dev->hasNoTransistors()) { + string error("[ERROR] Cannot writeToFile since device instance ("); + error += dev->getName().getString(); error += ") has no transistors !"; throw OpenChamsException(error); } - string sourceBulkStr = (inst->isSourceBulkConnected()) ? "True" : "False"; - file << " getName().getString() << "\" model=\"" << inst->getModel().getString() << "\" mostype=\"" << inst->getMosType().getString() << "\" sourceBulkConnected=\"" << sourceBulkStr << "\">" << endl; + if (dev) { + string sourceBulkStr = (dev->isSourceBulkConnected()) ? "True" : "False"; + file << " getName().getString() << "\" model=\"" << dev->getModel().getString() << "\" mostype=\"" << dev->getMosType().getString() << "\" sourceBulkConnected=\"" << sourceBulkStr << "\">" << endl; + } else { + file << " getName().getString() << "\" model=\"" << inst->getModel().getString() << "\">" << endl; + } file << " " << endl; for (map::const_iterator it = inst->getConnectors().begin() ; it != inst->getConnectors().end() ; ++it) { file << " " << endl; } - file << " " << endl - << " " << endl; - for (vector::const_iterator it = inst->getTransistors().begin() ; it != inst->getTransistors().end() ; ++it ) { - Transistor* tr = (*it); - file << " getName().getString() << "\">" << endl - << " getGate().getString() << "\" source=\"" << tr->getSource().getString() << "\" drain=\"" << tr->getDrain().getString() << "\" bulk=\"" << tr->getBulk().getString() << "\"/>" << endl - << " " << endl; + file << " " << endl; + if (dev) { + file << " " << endl; + for (vector::const_iterator it = dev->getTransistors().begin() ; it != dev->getTransistors().end() ; ++it ) { + Transistor* tr = (*it); + file << " getName().getString() << "\">" << endl + << " getGate().getString() << "\" source=\"" << tr->getSource().getString() << "\" drain=\"" << tr->getDrain().getString() << "\" bulk=\"" << tr->getBulk().getString() << "\"/>" << endl + << " " << endl; + } + file << " " << endl; } - file << " " << endl; if (!inst->getParameters().isEmpty()) { Parameters params = inst->getParameters(); file << " " << endl; diff --git a/vlsisapd/src/openChams/src/Device.cpp b/vlsisapd/src/openChams/src/Device.cpp new file mode 100644 index 00000000..b5754879 --- /dev/null +++ b/vlsisapd/src/openChams/src/Device.cpp @@ -0,0 +1,34 @@ +/* + * Device.cpp + * openChams + * + * Created by damien dupuis on 22/11/10. + * Copyright 2010 UPMC / LIP6. All rights reserved. + * + */ + +#include +using namespace std; + +#include "vlsisapd/openChams/Device.h" +#include "vlsisapd/openChams/Netlist.h" +#include "vlsisapd/openChams/Transistor.h" +#include "vlsisapd/openChams/OpenChamsException.h" + +namespace OpenChams { +Device::Device(Name name, Name model, Name mosType, bool sourceBulkConnected, Netlist* netlist) + : Instance(name, model, netlist) + , _mosType(mosType) + , _sourceBulkConnected(sourceBulkConnected) + , _trans() {} + +Transistor* Device::addTransistor(Name name) { + Transistor* tr = new Transistor(name, this); + if (!tr) + throw OpenChamsException("[ERROR] Cannot create transistor."); + + _trans.push_back(tr); + return tr; +} +} + diff --git a/vlsisapd/src/openChams/src/Instance.cpp b/vlsisapd/src/openChams/src/Instance.cpp index 2c239851..36be85a8 100644 --- a/vlsisapd/src/openChams/src/Instance.cpp +++ b/vlsisapd/src/openChams/src/Instance.cpp @@ -13,19 +13,15 @@ using namespace std; #include "vlsisapd/openChams/Instance.h" #include "vlsisapd/openChams/Netlist.h" #include "vlsisapd/openChams/Net.h" -#include "vlsisapd/openChams/Transistor.h" #include "vlsisapd/openChams/OpenChamsException.h" namespace OpenChams { -Instance::Instance(Name name, Name model, Name mosType, bool sourceBulkConnected, Netlist* netlist) +Instance::Instance(Name name, Name model, Netlist* netlist) : _name(name) , _model(model) - , _mosType(mosType) - , _sourceBulkConnected(sourceBulkConnected) , _netlist(netlist) , _params() - , _netMap() - , _trans() {} + , _netMap() {} void Instance::addConnector(Name name) { // si name n'est pas déjà présent dans la map on ajoute name, NULL (pas de net) @@ -64,14 +60,5 @@ void Instance::connect(Name connectorName, Name netName) { throw OpenChamsException(error); } } - -Transistor* Instance::addTransistor(Name name) { - Transistor* tr = new Transistor(name, this); - if (!tr) - throw OpenChamsException("[ERROR] Cannot create transistor."); - - _trans.push_back(tr); - return tr; -} } diff --git a/vlsisapd/src/openChams/src/Netlist.cpp b/vlsisapd/src/openChams/src/Netlist.cpp index 22456553..d51518cc 100644 --- a/vlsisapd/src/openChams/src/Netlist.cpp +++ b/vlsisapd/src/openChams/src/Netlist.cpp @@ -13,6 +13,7 @@ using namespace std; #include "vlsisapd/openChams/Netlist.h" #include "vlsisapd/openChams/Instance.h" +#include "vlsisapd/openChams/Device.h" #include "vlsisapd/openChams/Net.h" #include "vlsisapd/openChams/Circuit.h" #include "vlsisapd/openChams/OpenChamsException.h" @@ -20,7 +21,7 @@ using namespace std; namespace OpenChams { Netlist::Netlist(Circuit* circuit) : _circuit(circuit) {} -Instance* Netlist::addInstance(Name name, Name model, Name mosType, bool sourceBulkConnected) { +Instance* Netlist::addInstance(Name name, Name model) { for (vector::iterator it = _instances.begin() ; it != _instances.end() ; ++it) { if ((*it)->getName() == name) { string error("[ERROR] Cannot define two instances with the same name in netlist ("); @@ -29,7 +30,7 @@ Instance* Netlist::addInstance(Name name, Name model, Name mosType, bool sourceB throw OpenChamsException(error); } } - Instance* inst = new Instance(name, model, mosType, sourceBulkConnected, this); + Instance* inst = new Instance(name, model, this); if (!inst) throw OpenChamsException("[ERROR] Cannot creeate instance."); _instances.push_back(inst); @@ -37,6 +38,23 @@ Instance* Netlist::addInstance(Name name, Name model, Name mosType, bool sourceB return inst; } +Device* Netlist::addDevice(Name name, Name model, Name mosType, bool sourceBulkConnected) { + for (vector::iterator it = _instances.begin() ; it != _instances.end() ; ++it) { + if ((*it)->getName() == name) { + string error("[ERROR] Cannot define two instances with the same name in netlist ("); + error += name.getString(); + error += ")."; + throw OpenChamsException(error); + } + } + Device* dev = new Device(name, model, mosType, sourceBulkConnected, this); + if (!dev) + throw OpenChamsException("[ERROR] Cannot creeate device."); + _instances.push_back(dev); + + return dev; +} + Net* Netlist::addNet(Name name, Name type, bool external) { for (vector::iterator it = _nets.begin() ; it != _nets.end() ; ++it ) { if ((*it)->getName() == name) { diff --git a/vlsisapd/src/openChams/src/PyOpenChams.cpp b/vlsisapd/src/openChams/src/PyOpenChams.cpp index 9a05a3cc..80eff154 100644 --- a/vlsisapd/src/openChams/src/PyOpenChams.cpp +++ b/vlsisapd/src/openChams/src/PyOpenChams.cpp @@ -102,26 +102,26 @@ BOOST_PYTHON_MODULE(OPENCHAMS) { .def(vector_indexing_suite, true>()) ; // class OpenChams::Instance - class_("Instance", init()) + class_("Instance", init()) // properties .add_property("name" , &Instance::getName ) .add_property("model" , &Instance::getModel ) - .add_property("mosType" , &Instance::getMosType ) - .add_property("sourceBulkConnected", &Instance::isSourceBulkConnected) +// .add_property("mosType" , &Instance::getMosType ) +// .add_property("sourceBulkConnected", &Instance::isSourceBulkConnected) .add_property("parameters" , &Instance::getParameters ) .add_property("netlist" , make_function(&Instance::getNetlist ,return_value_policy())) //make_function since we need to specify a return value policy // accessors .def("hasNoConnectors" , &Instance::hasNoConnectors ) - .def("hasNoTransistors", &Instance::hasNoTransistors) +// .def("hasNoTransistors", &Instance::hasNoTransistors) // modifiers .def("addConnector" , &Instance::addConnector ) .def("connect" , &Instance::connect ) - .def("addTransistor", &Instance::addTransistor, return_value_policy()) +// .def("addTransistor", &Instance::addTransistor, return_value_policy()) .def("addParameter" , static_cast(&Transistor::addParameter)) .def("addParameter" , static_cast(&Transistor::addParameter)) // stl containers .def("getConnectors" , &Instance::getConnectors , return_internal_reference<>()) - .def("getTransistors", &Instance::getTransistors, return_internal_reference<>()) +// .def("getTransistors", &Instance::getTransistors, return_internal_reference<>()) ; // vector_indexing for OpenChams::Net diff --git a/vlsisapd/src/openChams/src/vlsisapd/openChams/Circuit.h b/vlsisapd/src/openChams/src/vlsisapd/openChams/Circuit.h index a024f6b6..871680f1 100644 --- a/vlsisapd/src/openChams/src/vlsisapd/openChams/Circuit.h +++ b/vlsisapd/src/openChams/src/vlsisapd/openChams/Circuit.h @@ -23,6 +23,7 @@ namespace OpenChams { class Netlist; class Instance; +class Device; class Net; class Schematic; class Sizing; @@ -62,6 +63,7 @@ class Circuit { Name readParameter(xmlNode*, double&); Name readParameterEq(xmlNode*, std::string&); Name readConnector(xmlNode*); + void readSubCircuitsPathes(xmlNode*); void readCircuitParameters(xmlNode*); void readSimulModels(xmlNode*); void readNetList(xmlNode*); @@ -69,8 +71,8 @@ class Circuit { Instance* readInstance (xmlNode*, Netlist*); void readInstanceParameters(xmlNode*, Instance*); void readInstanceConnectors(xmlNode*, Instance*); - void readInstanceTransistors(xmlNode*, Instance*); - void readTransistor(xmlNode*, Instance*); + void readInstanceTransistors(xmlNode*, Device*); + void readTransistor(xmlNode*, Device*); void readTransistorConnection(xmlNode*, Transistor*); void readNets(xmlNode*, Netlist*); Net* readNet (xmlNode*, Netlist*); @@ -95,6 +97,7 @@ class Circuit { Schematic* _schematic; Sizing* _sizing; Layout* _layout; + std::vector _subCircuitsPathes; std::map _simulModels; }; diff --git a/vlsisapd/src/openChams/src/vlsisapd/openChams/Device.h b/vlsisapd/src/openChams/src/vlsisapd/openChams/Device.h new file mode 100644 index 00000000..e1edc279 --- /dev/null +++ b/vlsisapd/src/openChams/src/vlsisapd/openChams/Device.h @@ -0,0 +1,51 @@ +/* + * Device.h + * openChams + * + * Created by damien dupuis on 22/11/10. + * Copyright 2010 UPMC / LIP6. All rights reserved. + * + */ + +#ifndef __OPENCHAMS_DEVICE_H__ +#define __OPENCHAMS_DEVICE_H__ + +#include +#include + +#include "vlsisapd/openChams/Name.h" +#include "vlsisapd/openChams/Instance.h" +#include "vlsisapd/openChams/Parameters.h" + +namespace OpenChams { +class Netlist; +class Transistor; +class Device : public Instance { + public: + Device(Name name, Name model, Name mosType, bool, Netlist*); + + virtual ~Device() {}; + + inline Name getMosType(); + inline bool isSourceBulkConnected(); + // pour parcourir les transistors + inline bool hasNoTransistors(); + inline const std::vector& getTransistors(); + + Transistor* addTransistor(Name); + + private: + Name _mosType; + bool _sourceBulkConnected; + std::vector _trans; +}; + +inline Name Device::getMosType() { return _mosType; }; +inline bool Device::isSourceBulkConnected() { return _sourceBulkConnected; }; +inline bool Device::hasNoTransistors() { return (_trans.size() == 0)? true : false; }; +inline const std::vector& Device::getTransistors() { return _trans; }; + +} // namespace +#endif + + diff --git a/vlsisapd/src/openChams/src/vlsisapd/openChams/Instance.h b/vlsisapd/src/openChams/src/vlsisapd/openChams/Instance.h index fd961bb6..dcd53abc 100644 --- a/vlsisapd/src/openChams/src/vlsisapd/openChams/Instance.h +++ b/vlsisapd/src/openChams/src/vlsisapd/openChams/Instance.h @@ -19,10 +19,11 @@ namespace OpenChams { class Netlist; class Net; -class Transistor; class Instance { public: - Instance(Name name, Name model, Name mosType, bool, Netlist*); + Instance(Name name, Name model, Netlist*); + + virtual ~Instance() {}; void addConnector(Name); void connect(Name connectorName, Name netName); @@ -31,42 +32,28 @@ class Instance { inline void addParameter(Name, std::string); inline Name getName() const; inline Name getModel(); - inline Name getMosType(); - inline bool isSourceBulkConnected(); inline Netlist* getNetlist(); inline Parameters getParameters(); // pour parcourir les connecteurs inline bool hasNoConnectors(); inline const std::map& getConnectors(); - // pour parcourir les transistors - inline bool hasNoTransistors(); - inline const std::vector& getTransistors(); - - Transistor* addTransistor(Name); private: Name _name; Name _model; - Name _mosType; - bool _sourceBulkConnected; Netlist* _netlist; Parameters _params; std::map _netMap; //map associant nom de connecteur a un net - std::vector _trans; }; inline void Instance::addParameter(Name name, double value) { _params.addParameter(name, value); }; inline void Instance::addParameter(Name name, std::string eqStr) { _params.addParameter(name, eqStr); }; inline Name Instance::getName() const { return _name; }; inline Name Instance::getModel() { return _model; }; -inline Name Instance::getMosType() { return _mosType; }; -inline bool Instance::isSourceBulkConnected() { return _sourceBulkConnected; }; inline Netlist* Instance::getNetlist() { return _netlist; }; inline Parameters Instance::getParameters() { return _params; }; inline bool Instance::hasNoConnectors() { return (_netMap.size() == 0)? true : false; }; inline const std::map& Instance::getConnectors() { return _netMap; }; -inline bool Instance::hasNoTransistors() { return (_trans.size() == 0)? true : false; }; -inline const std::vector& Instance::getTransistors() { return _trans; }; } // namespace #endif diff --git a/vlsisapd/src/openChams/src/vlsisapd/openChams/Netlist.h b/vlsisapd/src/openChams/src/vlsisapd/openChams/Netlist.h index d75e9833..5be6eaaf 100644 --- a/vlsisapd/src/openChams/src/vlsisapd/openChams/Netlist.h +++ b/vlsisapd/src/openChams/src/vlsisapd/openChams/Netlist.h @@ -15,6 +15,7 @@ namespace OpenChams { class Name; class Instance; +class Device; class Net; class Circuit; @@ -22,7 +23,8 @@ class Netlist { public: Netlist(Circuit*); - Instance* addInstance(Name name, Name model, Name mosType, bool); + Instance* addInstance(Name name, Name model); + Device* addDevice (Name name, Name model, Name mosType, bool); Net* addNet (Name name, Name type , bool); Instance* getInstance(Name); @@ -34,7 +36,7 @@ class Netlist { inline const std::vector& getNets(); private: - Circuit* _circuit; + Circuit* _circuit; std::vector _instances; std::vector _nets; };