Limbo
3.5.4
Toggle main menu visibility
Loading...
Searching...
No Matches
test
parsers
gdsii
test_driver.cpp
1
7
8
#include <iostream>
9
#include <
limbo/parsers/gdsii/stream/GdsDriver.h
>
10
using
std::cout;
11
using
std::endl;
12
14
struct
DataBase
:
public
GdsParser::GdsDriverDataBase
15
{
17
DataBase
()
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
65
int
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
}
GdsDriver.h
high-level wrapper for GdsReader (deprecated)
GdsParser::GdsDriverDataBase
database for the driver
Definition
GdsDriver.h:127
GdsParser::read
bool read(GdsDriverDataBase &db, string const &filename)
API function for GdsDriver.
DataBase
a database for GdsParser::GdsDriver
Definition
test_driver.cpp:15
DataBase::add_gds_lib
virtual void add_gds_lib(GdsParser::GdsLib const &lib)
add GDSII library
Definition
test_driver.cpp:24
DataBase::DataBase
DataBase()
constructor
Definition
test_driver.cpp:17
GdsParser::GdsLib
Top GDSII library.
Definition
GdsDriver.h:108
GdsParser::GdsLib::unit
vector< double > unit
unit
Definition
GdsDriver.h:110
GdsParser::GdsLib::lib_name
string lib_name
library name
Definition
GdsDriver.h:109
GdsParser::GdsLib::vCell
vector< GdsCell > vCell
Definition
GdsDriver.h:111
main
int main()
Definition
test_ChromaticNumber.cpp:78
Generated on
for Limbo by
1.17.0