add similar interface as Gds driver for OA driver

This commit is contained in:
Jean-Manuel Caba 2010-06-24 13:19:42 +00:00
parent 45c864dcf5
commit fe342a9849
4 changed files with 46 additions and 6 deletions

View File

@ -39,6 +39,7 @@
crlcore/COptions.h crlcore/COptions.h
crlcore/XmlParser.h crlcore/XmlParser.h
crlcore/GdsDriver.h crlcore/GdsDriver.h
crlcore/OADriver.h
crlcore/CifDriver.h crlcore/CifDriver.h
crlcore/SearchPath.h crlcore/SearchPath.h
crlcore/Environment.h crlcore/Environment.h
@ -71,6 +72,7 @@
COptions.cpp COptions.cpp
XmlParser.cpp XmlParser.cpp
GdsDriver.cpp GdsDriver.cpp
OADriver.cpp
CifDriver.cpp CifDriver.cpp
SearchPath.cpp SearchPath.cpp
Environment.cpp Environment.cpp

View File

@ -0,0 +1,16 @@
// -*- C++ -*-
#include "hurricane/Cell.h"
using namespace Hurricane;
#include "crlcore/OADriver.h"
#include "openaccess/OpenAccessWrapper.h"
namespace CRL {
OADriver::OADriver(Cell* cell) : _cell(cell) {}
void OADriver::save(const string& filePath) {
unsigned int saveState;
CRL::OpenAccessWrapper::oaDriver(filePath, _cell, saveState);
}
}// namespace CRL

View File

@ -0,0 +1,24 @@
// -*- C++ -*-
#ifndef __OA_DRIVER_H__
#define __OA_DRIVER_H__
#include <string>
namespace Hurricane {
class Cell;
}
namespace CRL {
class OADriver {
public:
OADriver(Hurricane::Cell*);
void save(const std::string& path);
private:
Hurricane::Cell* _cell;
};
} // End of CRL namespace.
#endif//__OA_DRIVER_H__

View File

@ -203,6 +203,7 @@ class OADriver {
} }
// libDefList->save(); // libDefList->save();
cerr << "ALL SAVED" << endl;
} }
@ -220,8 +221,6 @@ class OADriver {
//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;
oaScalarName scNameLib(ns, strNameLib); oaScalarName scNameLib(ns, strNameLib);
//for the moment absolute path
//strPathLib = "/dsk/l1/oatest/test";
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::create(scNameLib, strPathLib.c_str(), oacSharedLibMode, "oaDMFileSys"); oaLib* lib = oaLib::create(scNameLib, strPathLib.c_str(), oacSharedLibMode, "oaDMFileSys");
@ -379,11 +378,10 @@ void OpenAccessWrapper::oaDriver(const string& path, Cell* cell, unsigned int& s
const char* strPathLib = pathLib.c_str(); const char* strPathLib = pathLib.c_str();
if (oaLib::exists(strPathLib)) { // if (oaLib::exists(strPathLib)) {
throw Error("impossible to drive Cell, there is an existing OpenAccess db"); // throw Error("impossible to drive Cell, there is an existing OpenAccess db");
} // }
pathLib = "/dsk/l1/oatest";
OADriver oaDriver(pathLib); OADriver oaDriver(pathLib);
oaDesign* design = oaDriver.getOADesignForCell(cell); oaDesign* design = oaDriver.getOADesignForCell(cell);