Technology in progress

beginning layout of transistor
This commit is contained in:
Christophe Alexandre 2008-05-26 16:37:14 +00:00
parent 4fb6f4c886
commit 643477f270
7 changed files with 81 additions and 20 deletions

View File

@ -13,3 +13,4 @@ find_package(Qt4 REQUIRED) # find and setup Qt4 for this project
find_package(LibXml2 REQUIRED)
add_subdirectory(src)
add_subdirectory(etc)

View File

@ -0,0 +1 @@
install(FILES technology.hcmos9.dtr.xml DESTINATION /share/etc)

View File

@ -0,0 +1,7 @@
<technology name="hcmos9">
<physical_rules>
<rule name="L_TRANS" value="0.13" ref="13-1.a"/>
<rule name="RD" layer="diff" value="0.21" ref="2-3"/>
<rule name="RE" layer1="nImplant" layer2="GATE" value="0.4" ref="16-6"/>
</physical_rules>
</technology>

View File

@ -1,3 +1,5 @@
#include "hurricane/DataBase.h"
#include "hurricane/Technology.h"
#include "hurricane/UpdateSession.h"
using namespace Hurricane;
@ -5,11 +7,21 @@ using namespace Hurricane;
#include "ATechnology.h"
#include "Transistor.h"
namespace {
const Name Transistor::DrainName("DRAIN");
const Name Transistor::SourceName("SOURCE");
const Name Transistor::GridName("GRID");
const Name Transistor::BulkName("BULK");
Contact* createContact(Technology* technology, Net* net, const string& layerName) {
Layer* layer = technology->getLayer(Name(layerName));
Contact* contact = Contact::create(net, layer, 0, 0);
return contact;
}
}
Transistor::Transistor(Library* library, const Name& name, const Polarity& polarity):
Cell(library, name),
_drain(NULL),
@ -37,6 +49,8 @@ Transistor* Transistor::create(Library* library, const Name& name, const Polarit
void Transistor::_postCreate() {
Inherit::_postCreate();
DataBase* db = getDataBase();
Technology* technology = db->getTechnology();
_drain = Net::create(this, DrainName);
_drain->setExternal(true);
_source = Net::create(this, SourceName);
@ -45,10 +59,10 @@ void Transistor::_postCreate() {
_grid->setExternal(true);
_bulk = Net::create(this, BulkName);
_bulk->setExternal(true);
//_source20 = Contact::create(_source);
//_source22 = Contact::create(_source);
//_drain40 = Contact::create(_drain);
//_drain42 = Contact::create(_drain);
_source20 = createContact(technology, _source, "cut0");
_source22 = createContact(technology, _source, "cut1");
_drain40 = createContact(technology, _drain, "cut0");
_drain42 = createContact(technology, _drain, "cut1");
}
void Transistor::createLayout() {

View File

@ -6,6 +6,17 @@ using namespace Hurricane;
namespace {
static Name ATechnologyPropertyName("ATechnologyProperty");
void printPhysicalRules(ATechnology::PhysicalRules& physicalRules) {
for (ATechnology::PhysicalRules::iterator prit = physicalRules.begin();
prit != physicalRules.end();
prit++) {
ATechnology::PhysicalRule* physicalRule = *prit;
cout << " - name = " << physicalRule->_name <<
", value = " << physicalRule->_value <<
", ref = " << physicalRule->_reference << endl;
}
}
}
Name ATechnology::getName() const {
@ -17,12 +28,13 @@ string ATechnology::_getTypeName() const {
}
void ATechnology::addPhysicalRule(const Name& name, double value, const string& reference) {
PhysicalRules::iterator prit = _noLayerPhysicalRules.find(name);
PhysicalRule searchPR(name, 0, "");
PhysicalRules::iterator prit = _noLayerPhysicalRules.find(&searchPR);
if (prit != _noLayerPhysicalRules.end()) {
throw Error("");
}
PhysicalRule* newPhysicalRule = new PhysicalRule(name, value, reference);
_noLayerPhysicalRules[newPhysicalRule->_name] = newPhysicalRule;
_noLayerPhysicalRules.insert(newPhysicalRule);
}
void ATechnology::addPhysicalRule(const Name& name, const Name& layerName, double value, const string& reference) {
@ -34,14 +46,15 @@ void ATechnology::addPhysicalRule(const Name& name, const Name& layerName, doubl
assert(result.second);
olprit = result.first;
PhysicalRule* newPhysicalRule = new PhysicalRule(name, value, reference);
olprit->second[name] = newPhysicalRule;
olprit->second.insert(newPhysicalRule);
} else {
PhysicalRules& physicalRules = olprit->second;
if (physicalRules.find(name) != physicalRules.end()) {
PhysicalRule searchPR(name, 0, "");
if (physicalRules.find(&searchPR) != physicalRules.end()) {
throw Error("duplicate rule");
}
PhysicalRule* newPhysicalRule = new PhysicalRule(name, value, reference);
physicalRules[name] = newPhysicalRule;
physicalRules.insert(newPhysicalRule);
}
}
@ -71,29 +84,43 @@ ATechnology* ATechnology::getATechnology(Technology* technology) {
void ATechnology::print() {
cout << "Printing ATechnology" << endl;
cout << " o No Layer Physical Rules" << endl;
for (PhysicalRules::iterator prit = _noLayerPhysicalRules.begin();
prit != _noLayerPhysicalRules.end();
prit++) {
PhysicalRule* physicalRule = prit->second;
cout << " - name = " << physicalRule->_name <<
", value = " << physicalRule->_value <<
", ref = " << physicalRule->_reference << endl;
printPhysicalRules(_noLayerPhysicalRules);
cout << endl;
cout << " o One Layer Physical Rules" << endl;
for (OneLayerPhysicalRules::iterator olprit = _oneLayerPhysicalRules.begin();
olprit != _oneLayerPhysicalRules.end();
olprit++) {
Layer* layer = olprit->first;
cout << " o layer " << layer << endl;
printPhysicalRules(olprit->second);
cout << endl;
}
for (TwoLayersPhysicalRules::iterator tlprit = _twoLayersPhysicalRules.begin();
tlprit != _twoLayersPhysicalRules.end();
tlprit++) {
Layer* layer1 = tlprit->first.first;
Layer* layer2 = tlprit->first.second;
cout << " o layer1 " << layer1 << endl;
cout << " o layer2 " << layer2 << endl;
printPhysicalRules(tlprit->second);
cout << endl;
}
}
const ATechnology::PhysicalRule* ATechnology::getPhysicalRule(const Name& name) {
PhysicalRules::iterator prit = _noLayerPhysicalRules.find(name);
PhysicalRule searchPR(name, 0, "");
PhysicalRules::iterator prit = _noLayerPhysicalRules.find(&searchPR);
if (prit == _noLayerPhysicalRules.end()) {
throw Error("Cannot find Physical Rule " + getString(name));
}
return prit->second;
return *prit;
}
Layer* ATechnology::getLayer(const Name& layerName) {
Technology* technology = static_cast<Technology*>(getOwner());
Layer* layer = technology->getLayer(layerName);
if (!layer) {
throw Error("cannot find layer");
throw Error("cannot find layer " + getString(layerName));
}
return layer;
}

View File

@ -30,10 +30,19 @@ class ATechnology : public PrivateProperty {
const string _reference;
double getValue() const { return _value; }
};
typedef map<Name, ATechnology::PhysicalRule*> PhysicalRules;
struct PhysicalRuleNameCompare:
public std::binary_function<const PhysicalRule*, const PhysicalRule*, bool> {
bool operator()(const PhysicalRule* pr1, const PhysicalRule* pr2) const {
return pr1->_name < pr2->_name;
}
};
typedef set<ATechnology::PhysicalRule*, PhysicalRuleNameCompare> PhysicalRules;
typedef map<Layer*, PhysicalRules> OneLayerPhysicalRules;
typedef pair<Layer*, Layer*> LayerPair;
typedef map<LayerPair, PhysicalRules> TwoLayersPhysicalRules;
static ATechnology* create(Hurricane::Technology* technology);
static ATechnology* getATechnology(Hurricane::Technology* technology);
const PhysicalRule* getPhysicalRule(const Name& name);

View File

@ -74,6 +74,8 @@ ATechnology* parseFileAsTechnology(const char* filePath, Technology* technology)
if (node->type == XML_ELEMENT_NODE) {
if (xmlStrEqual(node->name, (xmlChar*)"physical_rules")) {
readPhysicalRules(node, aTechnology);
} else {
syntaxError("unknown tag");
}
}
}