Limbo 3.5.4
Loading...
Searching...
No Matches
test_driver.cpp
1
7
8#include <iostream>
10using std::cout;
11using std::endl;
12
15{
18 {
19 cout << "constructing DataBase" << endl;
20 }
21
24 virtual void add_gds_lib(GdsParser::GdsLib const& lib)
25 {
26 cout << "library name = " << lib.lib_name << endl;
27 cout << "library unit = " << lib.unit[0] << ", " << lib.unit[1] << endl;
28 cout << "# CELL = " << lib.vCell.size() << endl;
29 if (!lib.vCell.empty())
30 {
31 cout << "# BOUNDARY = " << lib.vCell.front().vBoundary.size() << endl;
32 cout << "cell name = " << lib.vCell.front().cell_name << endl;
33 vector<GdsParser::GdsBoundary> const& vBoundary = lib.vCell.front().vBoundary;
34 for (unsigned int i = 0; i < vBoundary.size(); ++i)
35 {
36 cout << ">> BOUNDARY" << endl;
37 cout << "XY: ";
38 for (unsigned int j = 0; j < vBoundary[i].vPoint.size(); ++j)
39 {
40 cout << vBoundary[i].vPoint[j][0] << ", " << vBoundary[i].vPoint[j][1] << endl;
41 }
42 }
43 vector<GdsParser::GdsText> const& vText = lib.vCell.front().vText;
44 for (unsigned int i = 0; i < vText.size(); ++i)
45 {
46 cout << ">> TEXT" << endl;
47 cout << "STRING: " << vText[i].content << endl;
48 cout << "XY: " << vText[i].position[0] << ", " << vText[i].position[1] << endl;
49 }
50 vector<GdsParser::GdsSref> const& vSref = lib.vCell.front().vSref;
51 for (unsigned int i = 0; i < vSref.size(); ++i)
52 {
53 cout << ">> SREF" << endl;
54 cout << "SNAME: " << vSref[i].sname << endl;
55 cout << "XY: " << vSref[i].position[0] << ", " << vSref[i].position[1] << endl;
56 }
57 }
58 }
59};
60
65int main(int argc, char** argv)
66{
67 DataBase db;
68 if (argc > 1)
69 cout << GdsParser::read(db, argv[1]) << endl;
70 else cout << "at least 1 argument is required" << endl;
71
72 return 0;
73}
high-level wrapper for GdsReader (deprecated)
database for the driver
Definition GdsDriver.h:127
bool read(GdsDriverDataBase &db, string const &filename)
API function for GdsDriver.
a database for GdsParser::GdsDriver
virtual void add_gds_lib(GdsParser::GdsLib const &lib)
add GDSII library
DataBase()
constructor
Top GDSII library.
Definition GdsDriver.h:108
vector< double > unit
unit
Definition GdsDriver.h:110
string lib_name
library name
Definition GdsDriver.h:109
vector< GdsCell > vCell
Definition GdsDriver.h:111
int main()