convert Components in the correct oaLayer ... embed schematic view in layout ...
This commit is contained in:
parent
4d9b6b465c
commit
09cd76f80f
|
@ -1,5 +1,5 @@
|
||||||
// -*-compile-command:"cd ../../../../.. && make"-*-
|
// -*-compile-command:"cd ../../../../.. && make"-*-
|
||||||
// Time-stamp: "2010-07-06 17:24:31" - OpenAccessWrapper.cpp
|
// Time-stamp: "2010-07-07 16:25:24" - 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 |
|
||||||
|
@ -11,6 +11,11 @@
|
||||||
// | E-mail : Jean-Manuel.Caba@asim.lip6.fr |
|
// | E-mail : Jean-Manuel.Caba@asim.lip6.fr |
|
||||||
// x-----------------------------------------------------------------x
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <vector>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
#ifdef HAVE_OPENACCESS
|
#ifdef HAVE_OPENACCESS
|
||||||
#include "oa/oaDesignDB.h"
|
#include "oa/oaDesignDB.h"
|
||||||
using namespace oa;
|
using namespace oa;
|
||||||
|
@ -28,7 +33,7 @@ using namespace Hurricane;
|
||||||
|
|
||||||
#include "OpenAccessWrapper.h"
|
#include "OpenAccessWrapper.h"
|
||||||
|
|
||||||
#define assert(cond) if (! (cond) ) throw Error("assertion failed")
|
#define assert(cond) if (! (cond) ) throw Error("assertion failed : " + string( #cond ) )
|
||||||
//#define assert(cond)
|
//#define assert(cond)
|
||||||
|
|
||||||
|
|
||||||
|
@ -224,6 +229,8 @@ namespace {
|
||||||
|
|
||||||
~OADriver() {
|
~OADriver() {
|
||||||
cerr << "SAVING ALL" << endl;
|
cerr << "SAVING ALL" << endl;
|
||||||
|
_oaTech->save();
|
||||||
|
_oaTech->close();
|
||||||
for (Cell2OADesignMap::iterator it = _cell2OADesign4SchematicMap.begin();
|
for (Cell2OADesignMap::iterator it = _cell2OADesign4SchematicMap.begin();
|
||||||
it != _cell2OADesign4SchematicMap.end();
|
it != _cell2OADesign4SchematicMap.end();
|
||||||
++it) {
|
++it) {
|
||||||
|
@ -240,8 +247,7 @@ namespace {
|
||||||
design->save();
|
design->save();
|
||||||
design->close();
|
design->close();
|
||||||
}
|
}
|
||||||
_oaTech->save();
|
|
||||||
_oaTech->close();
|
|
||||||
for (Library2OALibMap::iterator it = _library2OALibMap.begin();
|
for (Library2OALibMap::iterator it = _library2OALibMap.begin();
|
||||||
it != _library2OALibMap.end();
|
it != _library2OALibMap.end();
|
||||||
++it) {
|
++it) {
|
||||||
|
@ -268,17 +274,17 @@ namespace {
|
||||||
cerr << "Creating new Library for Lib name="
|
cerr << "Creating new Library for Lib name="
|
||||||
<< strNameLib << " to filesystem path=" << strPathLib << endl;
|
<< strNameLib << " to filesystem path=" << strPathLib << endl;
|
||||||
|
|
||||||
oaLib *lib = oaLib::find(scNameLib);
|
oaLib *lib = NULL;//oaLib::find(scNameLib);
|
||||||
if (!lib) {
|
// if (!lib) {
|
||||||
if (oaLib::exists(strPathLib.c_str())){
|
// if (oaLib::exists(strPathLib.c_str())){
|
||||||
lib = oaLib::open(scNameLib, strPathLib.c_str());
|
// lib = oaLib::open(scNameLib, strPathLib.c_str());
|
||||||
}
|
// }
|
||||||
// string cmd = "rm -rf "+strPathLib+"; mkdir -p "+strPathLib;
|
string cmd = "rm -rf "+strPathLib+"; mkdir -p "+strPathLib;
|
||||||
// system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
// oaLib* lib = oaLib::create(scNameLib, strPathLib.c_str(), oacSharedLibMode, "oaDMFileSys");
|
// oaLib* lib = oaLib::create(scNameLib, strPathLib.c_str(), oacSharedLibMode, "oaDMFileSys");
|
||||||
if(!lib)
|
// if(!lib)
|
||||||
lib = oaLib::create(scNameLib, strPathLib.c_str());
|
lib = oaLib::create(scNameLib, strPathLib.c_str());
|
||||||
}
|
// }
|
||||||
|
|
||||||
assert(lib);
|
assert(lib);
|
||||||
assert(lib->isValid());
|
assert(lib->isValid());
|
||||||
|
@ -356,9 +362,26 @@ namespace {
|
||||||
oaScalarName scNameLib;
|
oaScalarName scNameLib;
|
||||||
lib->getName(scNameLib);
|
lib->getName(scNameLib);
|
||||||
|
|
||||||
oaDesign* design4Schematic = oaDesign::open(scNameLib, scNameDesign, scNameViewSchematic, oaViewType::get(oacSchematic), 'w');
|
// create a Schematic CellView of the design
|
||||||
_cell2OADesign4SchematicMap[cell] = design4Schematic;
|
oaDesign* schematicView = oaDesign::open(scNameLib, scNameDesign, scNameViewSchematic, oaViewType::get(oacSchematic), 'w');
|
||||||
oaBlock* designBlock4Layout = oaBlock::create(design4Schematic);
|
_cell2OADesign4SchematicMap[cell] = schematicView;
|
||||||
|
oaModule::create(schematicView);
|
||||||
|
oaBlock::create(schematicView);
|
||||||
|
// create a Layout CellView of the design
|
||||||
|
oaDesign* layoutView = oaDesign::open(scNameLib, scNameDesign, scNameViewLayout, oaViewType::get(oacMaskLayout), 'w');
|
||||||
|
_cell2OADesign4LayoutMap[cell] = layoutView;
|
||||||
|
|
||||||
|
//embed "module" domain in block domain
|
||||||
|
oaModule* topModule = oaModule::embed(layoutView,schematicView);
|
||||||
|
layoutView->setTopModule(topModule);
|
||||||
|
oaBlock* topBlock = layoutView->getTopBlock();
|
||||||
|
assert(topBlock);
|
||||||
|
|
||||||
|
/// fail because the AbutmentBox is empty
|
||||||
|
// oaBox box;
|
||||||
|
// getOABoxForBox(box, cell->getAbutmentBox());
|
||||||
|
// cerr << cell << " " << cell->getAbutmentBox() << endl;
|
||||||
|
// oaRect::create(topBlock, 0, oaPurpose::get(_oaTech, oacDrawingPurposeType)->getNumber(), box);
|
||||||
|
|
||||||
cerr << "transformation of instances" << endl;
|
cerr << "transformation of instances" << endl;
|
||||||
for_each_instance(instance, cell->getInstances()) {
|
for_each_instance(instance, cell->getInstances()) {
|
||||||
|
@ -372,14 +395,20 @@ namespace {
|
||||||
|
|
||||||
oaTransform transform;
|
oaTransform transform;
|
||||||
getOATransformFromTransformation(transform, instance->getTransformation());
|
getOATransformFromTransformation(transform, instance->getTransformation());
|
||||||
oaScalarInst* blockInst = oaScalarInst::create(designBlock4Layout, masterDesign, scInstName, transform);
|
oaScalarInst* blockInst = oaScalarInst::create(topBlock, masterDesign, scInstName, transform);
|
||||||
_instance2OAInstMap[instance] = blockInst;
|
_instance2OAInstMap[instance] = blockInst;
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
cerr << "transformation of nets" << endl;
|
cerr << "transformation of nets" << endl;
|
||||||
for_each_net(net, cell->getNets()) {
|
for_each_net(net, cell->getNets()) {
|
||||||
oaScalarName scNetName(ns, getString(net->getName()).c_str());
|
oaScalarName scNetName(ns, getString(net->getName()).c_str());
|
||||||
oaScalarNet* blockNet = oaScalarNet::create(designBlock4Layout, scNetName, getOASigType(net->getType()));
|
oaScalarNet* blockNet = oaScalarNet::create(topBlock, scNetName, getOASigType(net->getType()));
|
||||||
|
assert(blockNet);
|
||||||
|
oaOccNet* occNet = blockNet->getOccNet();
|
||||||
|
assert(occNet);
|
||||||
|
assert(blockNet == occNet->getNet());
|
||||||
|
oaModNet* moduleNet = occNet->getModNet();
|
||||||
|
assert(moduleNet);
|
||||||
if (net->isExternal()) {
|
if (net->isExternal()) {
|
||||||
oaTerm* term = oaTerm::create(blockNet, scNetName, getOATermType(net->getDirection()));
|
oaTerm* term = oaTerm::create(blockNet, scNetName, getOATermType(net->getDirection()));
|
||||||
oaPin* pin = oaPin::create(term);
|
oaPin* pin = oaPin::create(term);
|
||||||
|
@ -387,7 +416,16 @@ namespace {
|
||||||
for_each_component(component, externalComponents) {
|
for_each_component(component, externalComponents) {
|
||||||
oaBox box;
|
oaBox box;
|
||||||
getOABoxForBox(box, component->getBoundingBox());
|
getOABoxForBox(box, component->getBoundingBox());
|
||||||
oaRect* rect = oaRect::create(designBlock4Layout, 0,
|
Layer* layer = (Layer*) component->getLayer();
|
||||||
|
assert(layer);
|
||||||
|
oaPhysicalLayer* physLayer = NULL;
|
||||||
|
Layer2OAPhysicalLayerMap::iterator it = _layer2OAPhysicalLayerMap.find(layer);
|
||||||
|
if (it != _layer2OAPhysicalLayerMap.end()) {
|
||||||
|
physLayer = it->second;
|
||||||
|
}
|
||||||
|
assert(physLayer);
|
||||||
|
oaLayerNum layerNum = physLayer->getNumber();
|
||||||
|
oaRect* rect = oaRect::create(topBlock, layerNum,
|
||||||
oaPurpose::get(_oaTech, oacDrawingPurposeType)->getNumber(),
|
oaPurpose::get(_oaTech, oacDrawingPurposeType)->getNumber(),
|
||||||
box);
|
box);
|
||||||
rect->addToPin(pin);
|
rect->addToPin(pin);
|
||||||
|
@ -407,16 +445,9 @@ namespace {
|
||||||
}
|
}
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
// create a Layout View of the design
|
return layoutView;
|
||||||
oaDesign* design4Layout = oaDesign::open(scNameLib, scNameDesign, scNameViewLayout, oaViewType::get(oacMaskLayout), 'w');
|
|
||||||
_cell2OADesign4LayoutMap[cell] = design4Layout;
|
|
||||||
if(design4Layout == design4Schematic)
|
|
||||||
cerr << "design4Layout == design4Schematic" << endl;
|
|
||||||
else
|
|
||||||
cerr << "design4Layout != design4Schematic" << endl;
|
|
||||||
return design4Schematic;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -427,10 +458,10 @@ namespace CRL {
|
||||||
//save the Cell and all used Cells
|
//save the Cell and all used Cells
|
||||||
cerr << "Saving " << cell << " in " << path << endl;
|
cerr << "Saving " << cell << " in " << path << endl;
|
||||||
try {
|
try {
|
||||||
oaDesignInit(
|
oaDesignInit();
|
||||||
oacAPIMajorRevNumber,
|
// oaDesignInit(oacAPIMajorRevNumber,
|
||||||
oacAPIMinorRevNumber,
|
// oacAPIMinorRevNumber,
|
||||||
oacDataModelRevNumber);
|
// oacDataModelRevNumber);
|
||||||
|
|
||||||
OADriver oaDriver(path);
|
OADriver oaDriver(path);
|
||||||
oaDesign* design = oaDriver.getOADesignForCell(cell);
|
oaDesign* design = oaDriver.getOADesignForCell(cell);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// -*-compile-command:"cd ../../../../.. && make"-*-
|
// -*-compile-command:"cd ../../../../.. && make"-*-
|
||||||
// Time-stamp: "2010-07-01 15:34:45" - OpenAccessWrapper.h
|
// Time-stamp: "2010-07-07 13:37:14" - 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 |
|
||||||
|
@ -15,7 +15,6 @@
|
||||||
#define __OPENACCESSWRAPPER_H__
|
#define __OPENACCESSWRAPPER_H__
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
class Library;
|
class Library;
|
||||||
|
@ -25,7 +24,7 @@ namespace Hurricane {
|
||||||
namespace CRL {
|
namespace CRL {
|
||||||
class OpenAccessWrapper {
|
class OpenAccessWrapper {
|
||||||
public:
|
public:
|
||||||
static void oaDriver(const string& cellPath, Cell* cell);
|
static void oaDriver(const std::string& cellPath, Cell* cell);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue