Limbo 3.5.4
Loading...
Searching...
No Matches
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
19namespace EbeamParser {
20
22using std::cout;
23using std::endl;
24using std::cerr;
25using std::string;
26using std::vector;
27using std::pair;
28using std::make_pair;
29using std::ostringstream;
30typedef int int32_t;
31typedef unsigned int uint32_t;
32typedef long int64_t;
34
35
38class 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
62class 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
86struct 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
112struct EbeamBoundary : public Item
113{
114 double offset;
115 double width;
116 double step;
119
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
149struct ConfSite : public Item
150{
152 int32_t layer_id;
153 string layer;
155
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
181struct Macro : public Item
182{
183 string macro_name;
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
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
Base class for ebeam database. Only pure virtual functions are defined. User needs to inheritate th...
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
virtual void set_ebeam_boundary(EbeamBoundary const &)=0
set ebeam boundary
virtual void add_ebeam_macro(Macro const &)=0
add ebeam macro for each standard cell
IntegerArray(size_type n, const value_type &val, const allocator_type &alloc=allocator_type())
IntegerArray(const allocator_type &alloc=allocator_type())
StringArray(const allocator_type &alloc=allocator_type())
StringArray(size_type n, const value_type &val, const allocator_type &alloc=allocator_type())
namespace for EbeamParser
virtual void print(ostringstream &ss) const
print data members
int32_t layer_id
layer id
string layer
layer name
vector< int32_t > vSiteCnt
array of site indices that are conflicted
void reset()
reset all data members
describe ebeam boundary
double width
width of beam
void reset()
reset all data members
double step
step of beam
virtual void print(ostringstream &ss) const
print data members
vector< string > vLayer
array of layer name
vector< int32_t > vLayerId
array of layer id
double offset
offset of beam
Temporary data structures to hold parsed data. Base class for all temporary data structures.
friend ostringstream & operator<<(ostringstream &ss, Item const &rhs)
virtual void print(ostringstream &) const
print data members
friend std::ostream & operator<<(std::ostream &os, Item const &rhs)
describe conflict sites for each standard cell type
void reset()
reset all data members
string macro_name
standard cell type
virtual void print(ostringstream &ss) const
print data members
vector< ConfSite > vConfSite