Since svn move failed (once again) I need to remove this by hand
This commit is contained in:
parent
c89ee9f1ca
commit
6a2fe112ac
|
@ -1,9 +0,0 @@
|
||||||
INCLUDE_DIRECTORIES(${CHAMS_SOURCE_DIR}/agds)
|
|
||||||
|
|
||||||
SET ( includes GdsLibrary.h GdsStructure.h GdsElement.h GdsRectangle.h )
|
|
||||||
SET ( cpps GdsLibrary.cpp GdsStructure.cpp GdsRectangle.cpp )
|
|
||||||
|
|
||||||
ADD_LIBRARY(agds ${cpps})
|
|
||||||
INSTALL(TARGETS agds DESTINATION lib${LIB_SUFFIX})
|
|
||||||
|
|
||||||
INSTALL(FILES ${includes} DESTINATION include/vlsisapd/agds)
|
|
|
@ -1,20 +0,0 @@
|
||||||
#ifndef __GDS_ELEMENT_H
|
|
||||||
#define __GDS_ELEMENT_H
|
|
||||||
|
|
||||||
namespace vlsisapd {
|
|
||||||
class GdsElement {
|
|
||||||
protected:
|
|
||||||
inline GdsElement (int layer);
|
|
||||||
virtual ~GdsElement ();
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual bool write ( ofstream &file ) = 0;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
int _layer;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline GdsElement::GdsElement(int layer) : _layer(layer) {}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,59 +0,0 @@
|
||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
|
||||||
#include <ctime>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#include "GdsLibrary.h"
|
|
||||||
|
|
||||||
namespace vlsisapd {
|
|
||||||
|
|
||||||
GdsLibrary::GdsLibrary(string libName)
|
|
||||||
: _libName(libName)
|
|
||||||
, _userUnits(0.00)
|
|
||||||
, _physUnits(0.00) {}
|
|
||||||
|
|
||||||
|
|
||||||
bool GdsLibrary::addStructure(GdsStructure* gdsStruct) {
|
|
||||||
if(gdsStruct)
|
|
||||||
_structs.push_back(gdsStruct);
|
|
||||||
else {
|
|
||||||
cerr << "[GDS DRIVE ERROR]: cannot hold GdsStructure: " << gdsStruct->getName() << endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GdsLibrary::write(string filename) {
|
|
||||||
time_t curtime = time(0);
|
|
||||||
tm now = *localtime(&curtime);
|
|
||||||
char date[BUFSIZ]={0};
|
|
||||||
const char format[]="%y-%m-%d %H:%M:%S";
|
|
||||||
if (!strftime(date, sizeof(date)-1, format, &now)>0)
|
|
||||||
cerr << "[GDS DRIVE ERROR]: cannot build current date." << endl;
|
|
||||||
|
|
||||||
ofstream file;
|
|
||||||
file.open(filename.c_str(), ios::out);
|
|
||||||
// Header
|
|
||||||
file << "HEADER 5;" << endl
|
|
||||||
<< "BGNLIB;" << endl
|
|
||||||
<< " LASTMOD {" << date << "};" << endl
|
|
||||||
<< " LASTACC {" << date << "};" << endl
|
|
||||||
<< "LIBNAME " << _libName << ".DB;" << endl
|
|
||||||
<< "UNITS;" << endl
|
|
||||||
<< " USERUNITS " << _userUnits << ";" << endl;
|
|
||||||
file << scientific << " PHYSUNITS " << _physUnits << ";" << endl
|
|
||||||
<< endl;
|
|
||||||
file.unsetf(ios::floatfield);
|
|
||||||
|
|
||||||
// For each Struct : write struct.
|
|
||||||
for ( vector<GdsStructure*>::iterator it = _structs.begin() ; it < _structs.end() ; it++ ) {
|
|
||||||
(*it)->write(file);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Footer
|
|
||||||
file << "ENDLIB;" << endl;
|
|
||||||
|
|
||||||
file.close();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} // namespace
|
|
|
@ -1,31 +0,0 @@
|
||||||
#ifndef __GDS_LIBRARY_H
|
|
||||||
#define __GDS_LIBRARY_H
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#include "GdsStructure.h"
|
|
||||||
|
|
||||||
namespace vlsisapd {
|
|
||||||
class GdsLibrary {
|
|
||||||
public:
|
|
||||||
GdsLibrary(string libName);
|
|
||||||
|
|
||||||
inline void setUserUnits ( double userUnits );
|
|
||||||
inline void setPhysUnits ( double physUnits );
|
|
||||||
|
|
||||||
bool addStructure ( GdsStructure* );
|
|
||||||
bool write ( string fileName );
|
|
||||||
|
|
||||||
private:
|
|
||||||
string _libName;
|
|
||||||
double _userUnits;
|
|
||||||
double _physUnits;
|
|
||||||
|
|
||||||
vector<GdsStructure*> _structs;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline void GdsLibrary::setUserUnits(double userUnits) { _userUnits = userUnits; };
|
|
||||||
inline void GdsLibrary::setPhysUnits(double physUnits) { _physUnits = physUnits; };
|
|
||||||
} // namespace
|
|
||||||
#endif
|
|
|
@ -1,34 +0,0 @@
|
||||||
#include <iostream>
|
|
||||||
#include <iomanip>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#include "GdsRectangle.h"
|
|
||||||
|
|
||||||
namespace vlsisapd {
|
|
||||||
GdsElement::~GdsElement () { }
|
|
||||||
|
|
||||||
GdsRectangle::GdsRectangle(int layer, double xmin, double ymin, double xmax, double ymax)
|
|
||||||
: GdsElement(layer)
|
|
||||||
, _xmin(xmin)
|
|
||||||
, _ymin(ymin)
|
|
||||||
, _xmax(xmax)
|
|
||||||
, _ymax(ymax) {}
|
|
||||||
|
|
||||||
GdsRectangle::~GdsRectangle () { }
|
|
||||||
|
|
||||||
bool GdsRectangle::write(ofstream &file) {
|
|
||||||
file << "BOUNDARY;" << endl
|
|
||||||
<< "LAYER " << _layer << ";" << endl
|
|
||||||
<< "DATATYPE 0;" << endl
|
|
||||||
<< "XY 5;" << endl
|
|
||||||
<< " X: " << _xmin << ";\tY: " << _ymin << ";" << endl
|
|
||||||
<< " X: " << _xmin << ";\tY: " << _ymax << ";" << endl
|
|
||||||
<< " X: " << _xmax << ";\tY: " << _ymax << ";" << endl
|
|
||||||
<< " X: " << _xmax << ";\tY: " << _ymin << ";" << endl
|
|
||||||
<< " X: " << _xmin << ";\tY: " << _ymin << ";" << endl
|
|
||||||
<< "ENDEL;" << endl
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
#ifndef __GDS_RECTANGLE_H
|
|
||||||
#define __GDS_RECTANGLE_H
|
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
|
|
||||||
#include "GdsElement.h"
|
|
||||||
|
|
||||||
namespace vlsisapd {
|
|
||||||
class GdsRectangle : public GdsElement {
|
|
||||||
public:
|
|
||||||
GdsRectangle (int layer, double xmin, double ymin, double xmax, double ymax);
|
|
||||||
virtual ~GdsRectangle ();
|
|
||||||
virtual bool write ( ofstream &file );
|
|
||||||
private:
|
|
||||||
double _xmin;
|
|
||||||
double _ymin;
|
|
||||||
double _xmax;
|
|
||||||
double _ymax;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
#include <iostream>
|
|
||||||
#include <ctime>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#include "GdsStructure.h"
|
|
||||||
|
|
||||||
namespace vlsisapd {
|
|
||||||
GdsStructure::GdsStructure(string strName)
|
|
||||||
: _strName(strName) {}
|
|
||||||
|
|
||||||
|
|
||||||
bool GdsStructure::addElement(GdsElement* gdsElement) {
|
|
||||||
if(gdsElement)
|
|
||||||
_elements.push_back(gdsElement);
|
|
||||||
else {
|
|
||||||
cerr << "[GDS DRIVE ERROR]: cannot hold GdsElement." << endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GdsStructure::write(ofstream &file) {
|
|
||||||
time_t curtime = time(0);
|
|
||||||
tm now = *localtime(&curtime);
|
|
||||||
char date[BUFSIZ]={0};
|
|
||||||
const char format[]="%y-%m-%d %H:%M:%S";
|
|
||||||
if (!strftime(date, sizeof(date)-1, format, &now)>0)
|
|
||||||
cerr << "[GDS DRIVE ERROR]: cannot build current date." << endl;
|
|
||||||
|
|
||||||
// Header
|
|
||||||
file << "BGNSTR;" << endl
|
|
||||||
<< " CREATION {" << date << "};" << endl
|
|
||||||
<< " LASTMOD {" << date << "};" << endl
|
|
||||||
<< "STRNAME " << _strName << ";" << endl
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
// For each Element : write element.
|
|
||||||
for ( vector<GdsElement*>::iterator it = _elements.begin() ; it < _elements.end() ; it++ ) {
|
|
||||||
(*it)->write(file);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Footer
|
|
||||||
file << "ENDSTR;" << endl;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} // namespace
|
|
|
@ -1,29 +0,0 @@
|
||||||
#ifndef __GDS_STRUCTURE_H
|
|
||||||
#define __GDS_STRUCTURE_H
|
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#include "GdsElement.h"
|
|
||||||
|
|
||||||
namespace vlsisapd {
|
|
||||||
class GdsStructure {
|
|
||||||
public:
|
|
||||||
GdsStructure(string strName);
|
|
||||||
|
|
||||||
bool addElement ( GdsElement* );
|
|
||||||
bool write ( ofstream &file );
|
|
||||||
|
|
||||||
inline string getName();
|
|
||||||
|
|
||||||
private:
|
|
||||||
string _strName;
|
|
||||||
|
|
||||||
vector<GdsElement*> _elements;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline string GdsStructure::getName() { return _strName; };
|
|
||||||
}
|
|
||||||
#endif
|
|
Loading…
Reference in New Issue