Limbo
3.5.4
Toggle main menu visibility
Loading...
Searching...
No Matches
limbo
parsers
ebeam
bison
EbeamDataBase.h
Go to the documentation of this file.
1
7
8
#ifndef EBEAMPARSER_DATABASE_H
9
#define EBEAMPARSER_DATABASE_H
10
11
#include <string>
12
#include <vector>
13
#include <iostream>
14
#include <fstream>
15
#include <sstream>
16
#include <cassert>
17
19
namespace
EbeamParser
{
20
22
using
std::cout;
23
using
std::endl;
24
using
std::cerr;
25
using
std::string;
26
using
std::vector;
27
using
std::pair;
28
using
std::make_pair;
29
using
std::ostringstream;
30
typedef
int
int32_t;
31
typedef
unsigned
int
uint32_t;
32
typedef
long
int64_t;
34
35
38
class
IntegerArray
:
public
vector
<int>
39
{
40
public
:
42
typedef
vector<int>
base_type;
43
using
base_type::size_type;
44
using
base_type::value_type;
45
using
base_type::allocator_type;
47
50
IntegerArray
(
const
allocator_type& alloc = allocator_type())
51
: base_type(alloc) {}
52
56
IntegerArray
(size_type n,
const
value_type& val,
const
allocator_type& alloc = allocator_type())
57
: base_type(n, val, alloc) {}
58
};
59
62
class
StringArray
:
public
vector
<string>
63
{
64
public
:
66
typedef
vector<string>
base_type;
67
using
base_type::size_type;
68
using
base_type::value_type;
69
using
base_type::allocator_type;
71
74
StringArray
(
const
allocator_type& alloc = allocator_type())
75
: base_type(alloc) {}
76
80
StringArray
(size_type n,
const
value_type& val,
const
allocator_type& alloc = allocator_type())
81
: base_type(n, val, alloc) {}
82
};
83
86
struct
Item
87
{
89
virtual
void
print
(ostringstream&)
const
{};
94
friend
std::ostream&
operator<<
(std::ostream& os,
Item
const
& rhs)
95
{
96
std::ostringstream ss;
97
rhs.
print
(ss);
98
os << ss.str();
99
return
os;
100
}
101
105
friend
ostringstream&
operator<<
(ostringstream& ss,
Item
const
& rhs)
106
{
107
rhs.
print
(ss);
108
return
ss;
109
}
110
};
111
112
struct
EbeamBoundary
:
public
Item
113
{
114
double
offset
;
115
double
width
;
116
double
step
;
117
vector<int32_t>
vLayerId
;
118
vector<string>
vLayer
;
119
121
EbeamBoundary
() {
reset
();}
123
void
reset
()
124
{
125
offset
= 0;
126
width
= 0;
127
step
= 0;
128
vLayerId
.clear();
129
vLayer
.clear();
130
}
131
133
virtual
void
print
(ostringstream& ss)
const
134
{
135
ss <<
"//////// EbeamBoundary ////////"
<< endl
136
<<
"offset = "
<<
offset
<< endl
137
<<
"width = "
<<
width
<< endl
138
<<
"step = "
<<
step
<< endl
139
<<
"vLayerId = "
;
140
for
(
vector<int32_t>::const_iterator
it =
vLayerId
.begin(); it !=
vLayerId
.end(); ++it)
141
ss << *it <<
"\t"
;
142
ss << endl;
143
ss <<
"vLayer = "
;
144
for
(
vector<string>::const_iterator
it =
vLayer
.begin(); it !=
vLayer
.end(); ++it)
145
ss << *it <<
"\t"
;
146
}
147
};
148
149
struct
ConfSite
:
public
Item
150
{
151
string
confsite_name
;
152
int32_t
layer_id
;
153
string
layer
;
154
vector<int32_t>
vSiteCnt
;
155
157
ConfSite
() {
reset
();}
159
void
reset
()
160
{
161
confsite_name
=
""
;
162
layer_id
= -1;
163
layer
=
""
;
164
vSiteCnt
.clear();
165
}
166
168
virtual
void
print
(ostringstream& ss)
const
169
{
170
ss <<
"//////// ConfSite ////////"
<< endl;
171
ss <<
"confsite_name = "
<<
confsite_name
<< endl;
172
ss <<
"layer_id = "
<<
layer_id
<< endl;
173
ss <<
"layer = "
<<
layer
<< endl;
174
ss <<
"vSiteCnt = "
;
175
for
(
vector<int32_t>::const_iterator
it =
vSiteCnt
.begin(); it !=
vSiteCnt
.end(); ++it)
176
ss << *it <<
"\t"
;
177
ss << endl;
178
}
179
};
180
181
struct
Macro
:
public
Item
182
{
183
string
macro_name
;
184
vector<ConfSite>
vConfSite
;
186
void
reset
()
187
{
188
macro_name
=
""
;
189
vConfSite
.clear();
190
}
191
193
virtual
void
print
(ostringstream& ss)
const
194
{
195
ss <<
"//////// Macro ////////"
<< endl;
196
ss <<
"macro_name = "
<<
macro_name
<< endl;
197
for
(
vector<ConfSite>::const_iterator
it =
vConfSite
.begin(); it !=
vConfSite
.end(); ++it)
198
ss << *it << endl;
199
}
200
};
201
202
// forward declaration
206
class
EbeamDataBase
207
{
208
public
:
211
virtual
void
set_ebeam_unit
(
int
) = 0;
213
virtual
void
set_ebeam_boundary
(
EbeamBoundary
const
&) = 0;
215
virtual
void
add_ebeam_macro
(
Macro
const
&) = 0;
216
};
217
218
}
// namespace EbeamParser
219
220
#endif
EbeamParser::EbeamDataBase
Base class for ebeam database. Only pure virtual functions are defined. User needs to inheritate th...
Definition
EbeamDataBase.h:207
EbeamParser::EbeamDataBase::set_ebeam_unit
virtual void set_ebeam_unit(int)=0
set unit of micron in database, e.g., unit 1000 denotes 1000 in database unit is equal to 1 micron
EbeamParser::EbeamDataBase::set_ebeam_boundary
virtual void set_ebeam_boundary(EbeamBoundary const &)=0
set ebeam boundary
EbeamParser::EbeamDataBase::add_ebeam_macro
virtual void add_ebeam_macro(Macro const &)=0
add ebeam macro for each standard cell
EbeamParser::IntegerArray::IntegerArray
IntegerArray(size_type n, const value_type &val, const allocator_type &alloc=allocator_type())
Definition
EbeamDataBase.h:56
EbeamParser::IntegerArray::IntegerArray
IntegerArray(const allocator_type &alloc=allocator_type())
Definition
EbeamDataBase.h:50
EbeamParser::StringArray::StringArray
StringArray(const allocator_type &alloc=allocator_type())
Definition
EbeamDataBase.h:74
EbeamParser::StringArray::StringArray
StringArray(size_type n, const value_type &val, const allocator_type &alloc=allocator_type())
Definition
EbeamDataBase.h:80
EbeamParser::vector
EbeamParser
namespace for EbeamParser
Definition
EbeamDataBase.h:19
EbeamParser::ConfSite::print
virtual void print(ostringstream &ss) const
print data members
Definition
EbeamDataBase.h:168
EbeamParser::ConfSite::layer_id
int32_t layer_id
layer id
Definition
EbeamDataBase.h:152
EbeamParser::ConfSite::layer
string layer
layer name
Definition
EbeamDataBase.h:153
EbeamParser::ConfSite::vSiteCnt
vector< int32_t > vSiteCnt
array of site indices that are conflicted
Definition
EbeamDataBase.h:154
EbeamParser::ConfSite::ConfSite
ConfSite()
constructor
Definition
EbeamDataBase.h:157
EbeamParser::ConfSite::reset
void reset()
reset all data members
Definition
EbeamDataBase.h:159
EbeamParser::ConfSite::confsite_name
string confsite_name
name
Definition
EbeamDataBase.h:151
EbeamParser::EbeamBoundary
describe ebeam boundary
Definition
EbeamDataBase.h:113
EbeamParser::EbeamBoundary::width
double width
width of beam
Definition
EbeamDataBase.h:115
EbeamParser::EbeamBoundary::reset
void reset()
reset all data members
Definition
EbeamDataBase.h:123
EbeamParser::EbeamBoundary::EbeamBoundary
EbeamBoundary()
constructor
Definition
EbeamDataBase.h:121
EbeamParser::EbeamBoundary::step
double step
step of beam
Definition
EbeamDataBase.h:116
EbeamParser::EbeamBoundary::print
virtual void print(ostringstream &ss) const
print data members
Definition
EbeamDataBase.h:133
EbeamParser::EbeamBoundary::vLayer
vector< string > vLayer
array of layer name
Definition
EbeamDataBase.h:118
EbeamParser::EbeamBoundary::vLayerId
vector< int32_t > vLayerId
array of layer id
Definition
EbeamDataBase.h:117
EbeamParser::EbeamBoundary::offset
double offset
offset of beam
Definition
EbeamDataBase.h:114
EbeamParser::Item
Temporary data structures to hold parsed data. Base class for all temporary data structures.
Definition
EbeamDataBase.h:87
EbeamParser::Item::operator<<
friend ostringstream & operator<<(ostringstream &ss, Item const &rhs)
Definition
EbeamDataBase.h:105
EbeamParser::Item::print
virtual void print(ostringstream &) const
print data members
Definition
EbeamDataBase.h:89
EbeamParser::Item::operator<<
friend std::ostream & operator<<(std::ostream &os, Item const &rhs)
Definition
EbeamDataBase.h:94
EbeamParser::Macro
describe conflict sites for each standard cell type
Definition
EbeamDataBase.h:182
EbeamParser::Macro::reset
void reset()
reset all data members
Definition
EbeamDataBase.h:186
EbeamParser::Macro::macro_name
string macro_name
standard cell type
Definition
EbeamDataBase.h:183
EbeamParser::Macro::print
virtual void print(ostringstream &ss) const
print data members
Definition
EbeamDataBase.h:193
EbeamParser::Macro::vConfSite
vector< ConfSite > vConfSite
Definition
EbeamDataBase.h:184
Generated on
for Limbo by
1.17.0