working on technology and Layer conversion ...
This commit is contained in:
parent
5a07df0d03
commit
2797086746
|
@ -10,7 +10,6 @@ namespace CRL {
|
||||||
OADriver::OADriver(Cell* cell) : _cell(cell) {}
|
OADriver::OADriver(Cell* cell) : _cell(cell) {}
|
||||||
|
|
||||||
void OADriver::save(const string& filePath) {
|
void OADriver::save(const string& filePath) {
|
||||||
unsigned int saveState;
|
CRL::OpenAccessWrapper::oaDriver(filePath, _cell);
|
||||||
CRL::OpenAccessWrapper::oaDriver(filePath, _cell, saveState);
|
|
||||||
}
|
}
|
||||||
}// namespace CRL
|
}// namespace CRL
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// -*-compile-command:"cd ../../../../.. && make"-*-
|
// -*-compile-command:"cd ../../../../.. && make"-*-
|
||||||
// Time-stamp: "2010-06-30 13:45:04" - OpenAccessWrapper.cpp
|
// Time-stamp: "2010-07-05 17:13:52" - OpenAccessWrapper.cpp
|
||||||
// x-----------------------------------------------------------------x
|
// x-----------------------------------------------------------------x
|
||||||
// | This file is part of the hurricaneAMS Software. |
|
// | This file is part of the hurricaneAMS Software. |
|
||||||
// | Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved |
|
// | Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved |
|
||||||
|
@ -17,11 +17,13 @@ using namespace oa;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "hurricane/DataBase.h"
|
#include "hurricane/DataBase.h"
|
||||||
|
#include "hurricane/Technology.h"
|
||||||
#include "hurricane/Library.h"
|
#include "hurricane/Library.h"
|
||||||
#include "hurricane/Cell.h"
|
#include "hurricane/Cell.h"
|
||||||
#include "hurricane/NetExternalComponents.h"
|
#include "hurricane/NetExternalComponents.h"
|
||||||
#include "hurricane/Segment.h"
|
#include "hurricane/Segment.h"
|
||||||
#include "hurricane/Pad.h"
|
#include "hurricane/Pad.h"
|
||||||
|
#include "hurricane/BasicLayer.h"
|
||||||
using namespace Hurricane;
|
using namespace Hurricane;
|
||||||
|
|
||||||
#include "OpenAccessWrapper.h"
|
#include "OpenAccessWrapper.h"
|
||||||
|
@ -118,11 +120,9 @@ namespace {
|
||||||
assert(design);
|
assert(design);
|
||||||
oaBlock* masterBlock = design->getTopBlock();
|
oaBlock* masterBlock = design->getTopBlock();
|
||||||
oaTerm* term = oaTerm::find(masterBlock, instTermName);
|
oaTerm* term = oaTerm::find(masterBlock, instTermName);
|
||||||
if (!term) {
|
|
||||||
cerr << "looking for " << plug->getName() << endl;
|
|
||||||
printBlockTerms(masterBlock);
|
|
||||||
}
|
|
||||||
assert(term);
|
assert(term);
|
||||||
|
cerr << "looking for " << plug->getName() << endl;
|
||||||
|
printBlockTerms(masterBlock);
|
||||||
instTerm = oaInstTerm::create(NULL, inst, term);
|
instTerm = oaInstTerm::create(NULL, inst, term);
|
||||||
return instTerm;
|
return instTerm;
|
||||||
}
|
}
|
||||||
|
@ -133,6 +133,7 @@ namespace {
|
||||||
typedef map<const Cell*, oaDesign*> Cell2OADesignMap;
|
typedef map<const Cell*, oaDesign*> Cell2OADesignMap;
|
||||||
typedef pair<oaModInst*, oaInst*> OAInstPair;
|
typedef pair<oaModInst*, oaInst*> OAInstPair;
|
||||||
typedef map<Instance*, oaInst*> Instance2OAInstsMap;
|
typedef map<Instance*, oaInst*> Instance2OAInstsMap;
|
||||||
|
typedef map<Layer*, oaPhysicalLayer*> Layer2OAPhysicalLayerMap;
|
||||||
|
|
||||||
string _path;
|
string _path;
|
||||||
oaTech* _oaTech;
|
oaTech* _oaTech;
|
||||||
|
@ -140,6 +141,7 @@ namespace {
|
||||||
Library2OALibMap _library2OALibMap;
|
Library2OALibMap _library2OALibMap;
|
||||||
Cell2OADesignMap _cell2OADesignMap;
|
Cell2OADesignMap _cell2OADesignMap;
|
||||||
Instance2OAInstsMap _instance2OAInstMap;
|
Instance2OAInstsMap _instance2OAInstMap;
|
||||||
|
Layer2OAPhysicalLayerMap _layer2OAPhysicalLayerMap;
|
||||||
DataBase* _db;
|
DataBase* _db;
|
||||||
Technology* _technology;
|
Technology* _technology;
|
||||||
public:
|
public:
|
||||||
|
@ -150,6 +152,7 @@ namespace {
|
||||||
_library2OALibMap(),
|
_library2OALibMap(),
|
||||||
_cell2OADesignMap(),
|
_cell2OADesignMap(),
|
||||||
_instance2OAInstMap(),
|
_instance2OAInstMap(),
|
||||||
|
_layer2OAPhysicalLayerMap(),
|
||||||
_db(NULL),
|
_db(NULL),
|
||||||
_technology(NULL) {
|
_technology(NULL) {
|
||||||
_db = DataBase::getDB();
|
_db = DataBase::getDB();
|
||||||
|
@ -212,15 +215,62 @@ namespace {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@todo complete with technology info
|
@todo verify
|
||||||
|
*/
|
||||||
|
oaMaterial basicLayerMaterial2oaMaterial(const BasicLayer::Material& material){
|
||||||
|
switch ( material.getCode() ) {
|
||||||
|
case BasicLayer::Material::nWell: return oacNWellMaterial;
|
||||||
|
case BasicLayer::Material::pWell: return oacPWellMaterial;
|
||||||
|
case BasicLayer::Material::nImplant: return oacNImplantMaterial;
|
||||||
|
case BasicLayer::Material::pImplant: return oacPImplantMaterial;
|
||||||
|
case BasicLayer::Material::active: return oacOtherMaterial;//is it OK?
|
||||||
|
case BasicLayer::Material::poly: return oacPolyMaterial;
|
||||||
|
case BasicLayer::Material::cut: return oacCutMaterial;
|
||||||
|
case BasicLayer::Material::metal: return oacMetalMaterial;
|
||||||
|
case BasicLayer::Material::blockage: return oacOtherMaterial;//is it OK?
|
||||||
|
case BasicLayer::Material::other: return oacOtherMaterial;
|
||||||
|
}
|
||||||
|
throw Error("ERROR : unknow Material");
|
||||||
|
return oacOtherMaterial;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@todo complete with technology info for layers
|
||||||
*/
|
*/
|
||||||
oaTech* createOATechForTechnology(const Technology* technology,oaLib* lib) {
|
oaTech* createOATechForTechnology(const Technology* technology,oaLib* lib) {
|
||||||
oaTech* oaTech = oaTech::create(lib);
|
oaTech* oaTech = oaTech::create(lib);
|
||||||
oaTech->setDefaultManufacturingGrid(10);
|
oaTech->setDefaultManufacturingGrid(10);
|
||||||
oaTech->setDBUPerUU(oaViewType::get(oacMaskLayout), 1000);
|
oaTech->setDBUPerUU(oaViewType::get(oacMaskLayout), 1000);
|
||||||
|
|
||||||
|
int layerID=0;
|
||||||
|
for_each_layer(layer, technology->getLayers()) {
|
||||||
|
oaString layerName = getString(layer->getName()).c_str();
|
||||||
|
oaPhysicalLayer* oaLayer = NULL;
|
||||||
|
{
|
||||||
|
BasicLayer* bLayer = dynamic_cast<BasicLayer*>(layer);
|
||||||
|
if(bLayer)
|
||||||
|
oaLayer = oaPhysicalLayer::create(oaTech, layerName, layerID++,basicLayerMaterial2oaMaterial(bLayer->getMaterial()));
|
||||||
|
else
|
||||||
|
oaLayer = oaPhysicalLayer::create(oaTech, layerName, layerID++);
|
||||||
|
}
|
||||||
|
assert(oaLayer);
|
||||||
|
_layer2OAPhysicalLayerMap[layer] = oaLayer;
|
||||||
|
DbU::Unit minSize = layer->getMinimalSize();
|
||||||
|
DbU::Unit minSpace = layer->getMinimalSpacing();
|
||||||
|
DbU::Unit pitch = layer->getPitch();
|
||||||
|
end_for;
|
||||||
|
}
|
||||||
|
|
||||||
|
for_each_basic_layer(basicLayer, technology->getBasicLayers()) {
|
||||||
|
Layer2OAPhysicalLayerMap::iterator it = _layer2OAPhysicalLayerMap.find((Layer*)(basicLayer));
|
||||||
|
if (it != _layer2OAPhysicalLayerMap.end()) {
|
||||||
|
oaPhysicalLayer* oaLayer = it->second;
|
||||||
|
unsigned gdsIInumber = basicLayer->getExtractNumber();
|
||||||
|
}
|
||||||
|
end_for;
|
||||||
|
}
|
||||||
|
|
||||||
assert(oaTech != NULL);
|
assert(oaTech != NULL);
|
||||||
|
|
||||||
return oaTech;
|
return oaTech;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,11 +285,13 @@ namespace {
|
||||||
cerr << "getOALibForLibrary" << endl;
|
cerr << "getOALibForLibrary" << endl;
|
||||||
oaLib* lib = getOALibForLibrary(cell->getLibrary());
|
oaLib* lib = getOALibForLibrary(cell->getLibrary());
|
||||||
oaScalarName scNameDesign(ns, getString(cell->getName()).c_str());
|
oaScalarName scNameDesign(ns, getString(cell->getName()).c_str());
|
||||||
|
oaScalarName scNameViewSchematic(ns, "schematic");
|
||||||
oaScalarName scNameView(ns, "layout");
|
oaScalarName scNameView(ns, "layout");
|
||||||
oaScalarName scNameLib;
|
oaScalarName scNameLib;
|
||||||
lib->getName(scNameLib);
|
lib->getName(scNameLib);
|
||||||
|
|
||||||
oaDesign* design = oaDesign::open(scNameLib, scNameDesign, scNameView, oaViewType::get(oacSchematic), 'w');
|
oaDesign* designSch = oaDesign::open(scNameLib, scNameDesign, scNameViewSchematic, oaViewType::get(oacSchematic), 'w');
|
||||||
|
oaDesign* design = oaDesign::open(scNameLib, scNameDesign, scNameView, oaViewType::get(oacMaskLayout), 'w');
|
||||||
oaBlock* block = oaBlock::create(design);
|
oaBlock* block = oaBlock::create(design);
|
||||||
|
|
||||||
cerr << "transformation of instance" << endl;
|
cerr << "transformation of instance" << endl;
|
||||||
|
@ -297,7 +349,7 @@ namespace {
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace CRL {
|
namespace CRL {
|
||||||
void OpenAccessWrapper::oaDriver(const string& path, Cell* cell, unsigned int& saveState) {
|
void OpenAccessWrapper::oaDriver(const string& path, Cell* cell) {
|
||||||
#ifdef HAVE_OPENACCESS
|
#ifdef HAVE_OPENACCESS
|
||||||
//for the moment a driver for hurricaneAMS
|
//for the moment a driver for hurricaneAMS
|
||||||
//save the Cell and all used Cells
|
//save the Cell and all used Cells
|
||||||
|
@ -308,10 +360,7 @@ namespace CRL {
|
||||||
oacAPIMinorRevNumber,
|
oacAPIMinorRevNumber,
|
||||||
oacDataModelRevNumber);
|
oacDataModelRevNumber);
|
||||||
|
|
||||||
Library* library = cell->getLibrary();
|
OADriver oaDriver(path);
|
||||||
string pathLib = path + "/" + getString(library->getName());
|
|
||||||
|
|
||||||
OADriver oaDriver(pathLib);
|
|
||||||
oaDesign* design = oaDriver.getOADesignForCell(cell);
|
oaDesign* design = oaDriver.getOADesignForCell(cell);
|
||||||
if(design)
|
if(design)
|
||||||
cerr << getDesignName(design) << endl;
|
cerr << getDesignName(design) << endl;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// -*-compile-command:"cd ../../../../.. && make"-*-
|
// -*-compile-command:"cd ../../../../.. && make"-*-
|
||||||
// Time-stamp: "2010-06-29 11:55:46" - OpenAccessWrapper.h
|
// Time-stamp: "2010-07-01 15:34:45" - OpenAccessWrapper.h
|
||||||
// x-----------------------------------------------------------------x
|
// x-----------------------------------------------------------------x
|
||||||
// | This file is part of the hurricaneAMS Software. |
|
// | This file is part of the hurricaneAMS Software. |
|
||||||
// | Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved |
|
// | Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved |
|
||||||
|
@ -25,7 +25,7 @@ namespace Hurricane {
|
||||||
namespace CRL {
|
namespace CRL {
|
||||||
class OpenAccessWrapper {
|
class OpenAccessWrapper {
|
||||||
public:
|
public:
|
||||||
static void oaDriver(const string& cellPath, Cell* cell, unsigned int& saveState);
|
static void oaDriver(const string& cellPath, Cell* cell);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ FIND_PACKAGE(CORIOLIS REQUIRED)
|
||||||
FIND_PACKAGE(VLSISAPD REQUIRED)
|
FIND_PACKAGE(VLSISAPD REQUIRED)
|
||||||
FIND_PACKAGE(HURRICANEAMS REQUIRED)
|
FIND_PACKAGE(HURRICANEAMS REQUIRED)
|
||||||
FIND_PACKAGE(AMSCORE REQUIRED)
|
FIND_PACKAGE(AMSCORE REQUIRED)
|
||||||
|
FIND_PACKAGE(Qt4 REQUIRED) # find and setup Qt4 for this project
|
||||||
FIND_PACKAGE(LibXml2 REQUIRED)
|
FIND_PACKAGE(LibXml2 REQUIRED)
|
||||||
FIND_PACKAGE(PythonLibs REQUIRED)
|
FIND_PACKAGE(PythonLibs REQUIRED)
|
||||||
|
|
||||||
|
|
|
@ -6,5 +6,8 @@ all:
|
||||||
run:
|
run:
|
||||||
cd x86_64/usr/local/bin && ./testOAWrapper /asim/chams/etc/chams/config.freePDK45.xml
|
cd x86_64/usr/local/bin && ./testOAWrapper /asim/chams/etc/chams/config.freePDK45.xml
|
||||||
|
|
||||||
|
debug:
|
||||||
|
cd x86_64/usr/local/bin && gdb -args ./testOAWrapper /asim/chams/etc/chams/config.freePDK45.xml
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf x86_64
|
rm -rf x86_64
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
|
|
||||||
|
INCLUDE(${QT_USE_FILE})
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES ( ${HURRICANE_INCLUDE_DIR}
|
INCLUDE_DIRECTORIES ( ${HURRICANE_INCLUDE_DIR}
|
||||||
${CORIOLIS_INCLUDE_DIR}
|
${CORIOLIS_INCLUDE_DIR}
|
||||||
${HURRICANEAMS_INCLUDE_DIR}
|
${HURRICANEAMS_INCLUDE_DIR}
|
||||||
|
|
|
@ -18,6 +18,7 @@ using namespace std;
|
||||||
using namespace Hurricane;
|
using namespace Hurricane;
|
||||||
|
|
||||||
#include "crlcore/Catalog.h"
|
#include "crlcore/Catalog.h"
|
||||||
|
#include "crlcore/RealTechnologyParser.h"
|
||||||
#include "crlcore/AllianceFramework.h"
|
#include "crlcore/AllianceFramework.h"
|
||||||
|
|
||||||
#include "hurricaneAMS/environment/AnalogEnv.h"
|
#include "hurricaneAMS/environment/AnalogEnv.h"
|
||||||
|
@ -35,20 +36,16 @@ void testCell(Cell* dev){
|
||||||
if(dev)
|
if(dev)
|
||||||
cout << "Cell created" << endl;
|
cout << "Cell created" << endl;
|
||||||
|
|
||||||
cout << "driving GDS" << endl;
|
// cout << "driving GDS" << endl;
|
||||||
CRL::GdsDriver(dev).save("/tmp/testGDS");
|
// CRL::GdsDriver(dev).save("/tmp/testGDS");
|
||||||
|
|
||||||
cout << "driving OA" << endl;
|
cout << "driving OA" << endl;
|
||||||
CRL::OADriver(dev).save("/tmp/testOA");
|
CRL::OADriver(dev).save("/tmp/testOA");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void testAnalog(char* pathToConf){
|
||||||
int main(int argc,char** argv) {
|
AnalogEnv::create(pathToConf);//create Database ...
|
||||||
if(argc != 2)
|
cout << "analog environment loaded and database created" << endl;
|
||||||
exit(-5);
|
|
||||||
|
|
||||||
AnalogEnv::create(argv[1]);//create Database ...
|
|
||||||
cout << "analog environment loaded and database created" << endl;
|
|
||||||
DataBase* db = DataBase::getDB();
|
DataBase* db = DataBase::getDB();
|
||||||
assert(db != NULL);
|
assert(db != NULL);
|
||||||
Library* rootLib = db->getRootLibrary();
|
Library* rootLib = db->getRootLibrary();
|
||||||
|
@ -78,10 +75,31 @@ int main(int argc,char** argv) {
|
||||||
cout << "testing cell myCM" << endl;
|
cout << "testing cell myCM" << endl;
|
||||||
|
|
||||||
testCell(dev);
|
testCell(dev);
|
||||||
|
db->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
// cout << "creating and testing cell from sxlib inv_x1" << endl;
|
void testNum(){
|
||||||
|
cout << "creating cell from sxlib inv_x1" << endl;
|
||||||
|
CRL::AllianceFramework::get();
|
||||||
|
DataBase* db = DataBase::getDB();
|
||||||
|
assert(db != NULL);
|
||||||
|
CRL::RealTechnologyParser::load(db, "/asim/coriolis2/etc/coriolis2/technology.freePDK45.s2r.xml");
|
||||||
|
Cell* mySxlibCell = CRL::AllianceFramework::get()->getCell( "inv_x1", CRL::Catalog::State::Views );
|
||||||
|
cout << "testing cell from sxlib inv_x1" << endl;
|
||||||
|
testCell(mySxlibCell);
|
||||||
|
db = DataBase::getDB();
|
||||||
|
assert(db != NULL);
|
||||||
|
db->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
// testCell(CRL::AllianceFramework::get()->getCell( "inv_x1", CRL::Catalog::State::Views ));
|
|
||||||
|
|
||||||
|
int main(int argc,char** argv) {
|
||||||
|
if(argc != 2)
|
||||||
|
exit(-5);
|
||||||
|
|
||||||
|
testAnalog(argv[1]);
|
||||||
|
// testNum();
|
||||||
|
|
||||||
cout << "ending normally" << endl;
|
cout << "ending normally" << endl;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue