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"-*-
|
||||
// Time-stamp: "2010-07-06 17:24:31" - OpenAccessWrapper.cpp
|
||||
// Time-stamp: "2010-07-07 16:25:24" - OpenAccessWrapper.cpp
|
||||
// x-----------------------------------------------------------------x
|
||||
// | This file is part of the hurricaneAMS Software. |
|
||||
// | Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved |
|
||||
|
@ -11,6 +11,11 @@
|
|||
// | E-mail : Jean-Manuel.Caba@asim.lip6.fr |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
#ifdef HAVE_OPENACCESS
|
||||
#include "oa/oaDesignDB.h"
|
||||
using namespace oa;
|
||||
|
@ -28,7 +33,7 @@ using namespace Hurricane;
|
|||
|
||||
#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)
|
||||
|
||||
|
||||
|
@ -224,6 +229,8 @@ namespace {
|
|||
|
||||
~OADriver() {
|
||||
cerr << "SAVING ALL" << endl;
|
||||
_oaTech->save();
|
||||
_oaTech->close();
|
||||
for (Cell2OADesignMap::iterator it = _cell2OADesign4SchematicMap.begin();
|
||||
it != _cell2OADesign4SchematicMap.end();
|
||||
++it) {
|
||||
|
@ -240,8 +247,7 @@ namespace {
|
|||
design->save();
|
||||
design->close();
|
||||
}
|
||||
_oaTech->save();
|
||||
_oaTech->close();
|
||||
|
||||
for (Library2OALibMap::iterator it = _library2OALibMap.begin();
|
||||
it != _library2OALibMap.end();
|
||||
++it) {
|
||||
|
@ -268,17 +274,17 @@ namespace {
|
|||
cerr << "Creating new Library for Lib name="
|
||||
<< strNameLib << " to filesystem path=" << strPathLib << endl;
|
||||
|
||||
oaLib *lib = oaLib::find(scNameLib);
|
||||
if (!lib) {
|
||||
if (oaLib::exists(strPathLib.c_str())){
|
||||
lib = oaLib::open(scNameLib, strPathLib.c_str());
|
||||
}
|
||||
// string cmd = "rm -rf "+strPathLib+"; mkdir -p "+strPathLib;
|
||||
// system(cmd.c_str());
|
||||
oaLib *lib = NULL;//oaLib::find(scNameLib);
|
||||
// if (!lib) {
|
||||
// if (oaLib::exists(strPathLib.c_str())){
|
||||
// lib = oaLib::open(scNameLib, strPathLib.c_str());
|
||||
// }
|
||||
string cmd = "rm -rf "+strPathLib+"; mkdir -p "+strPathLib;
|
||||
system(cmd.c_str());
|
||||
// oaLib* lib = oaLib::create(scNameLib, strPathLib.c_str(), oacSharedLibMode, "oaDMFileSys");
|
||||
if(!lib)
|
||||
// if(!lib)
|
||||
lib = oaLib::create(scNameLib, strPathLib.c_str());
|
||||
}
|
||||
// }
|
||||
|
||||
assert(lib);
|
||||
assert(lib->isValid());
|
||||
|
@ -356,9 +362,26 @@ namespace {
|
|||
oaScalarName scNameLib;
|
||||
lib->getName(scNameLib);
|
||||
|
||||
oaDesign* design4Schematic = oaDesign::open(scNameLib, scNameDesign, scNameViewSchematic, oaViewType::get(oacSchematic), 'w');
|
||||
_cell2OADesign4SchematicMap[cell] = design4Schematic;
|
||||
oaBlock* designBlock4Layout = oaBlock::create(design4Schematic);
|
||||
// create a Schematic CellView of the design
|
||||
oaDesign* schematicView = oaDesign::open(scNameLib, scNameDesign, scNameViewSchematic, oaViewType::get(oacSchematic), 'w');
|
||||
_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;
|
||||
for_each_instance(instance, cell->getInstances()) {
|
||||
|
@ -372,14 +395,20 @@ namespace {
|
|||
|
||||
oaTransform transform;
|
||||
getOATransformFromTransformation(transform, instance->getTransformation());
|
||||
oaScalarInst* blockInst = oaScalarInst::create(designBlock4Layout, masterDesign, scInstName, transform);
|
||||
oaScalarInst* blockInst = oaScalarInst::create(topBlock, masterDesign, scInstName, transform);
|
||||
_instance2OAInstMap[instance] = blockInst;
|
||||
end_for;
|
||||
}
|
||||
cerr << "transformation of nets" << endl;
|
||||
for_each_net(net, cell->getNets()) {
|
||||
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()) {
|
||||
oaTerm* term = oaTerm::create(blockNet, scNetName, getOATermType(net->getDirection()));
|
||||
oaPin* pin = oaPin::create(term);
|
||||
|
@ -387,7 +416,16 @@ namespace {
|
|||
for_each_component(component, externalComponents) {
|
||||
oaBox box;
|
||||
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(),
|
||||
box);
|
||||
rect->addToPin(pin);
|
||||
|
@ -407,14 +445,7 @@ namespace {
|
|||
}
|
||||
end_for;
|
||||
}
|
||||
// create a Layout View of the design
|
||||
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;
|
||||
return layoutView;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
@ -427,10 +458,10 @@ namespace CRL {
|
|||
//save the Cell and all used Cells
|
||||
cerr << "Saving " << cell << " in " << path << endl;
|
||||
try {
|
||||
oaDesignInit(
|
||||
oacAPIMajorRevNumber,
|
||||
oacAPIMinorRevNumber,
|
||||
oacDataModelRevNumber);
|
||||
oaDesignInit();
|
||||
// oaDesignInit(oacAPIMajorRevNumber,
|
||||
// oacAPIMinorRevNumber,
|
||||
// oacDataModelRevNumber);
|
||||
|
||||
OADriver oaDriver(path);
|
||||
oaDesign* design = oaDriver.getOADesignForCell(cell);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// -*-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
|
||||
// | This file is part of the hurricaneAMS Software. |
|
||||
// | Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved |
|
||||
|
@ -15,7 +15,6 @@
|
|||
#define __OPENACCESSWRAPPER_H__
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
namespace Hurricane {
|
||||
class Library;
|
||||
|
@ -25,7 +24,7 @@ namespace Hurricane {
|
|||
namespace CRL {
|
||||
class OpenAccessWrapper {
|
||||
public:
|
||||
static void oaDriver(const string& cellPath, Cell* cell);
|
||||
static void oaDriver(const std::string& cellPath, Cell* cell);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue