8 #ifndef BOOKSHELFPARSER_DATABASE_H
9 #define BOOKSHELFPARSER_DATABASE_H
31 typedef unsigned int uint32_t;
41 typedef vector<int> base_type;
42 using base_type::size_type;
43 using base_type::value_type;
44 using base_type::allocator_type;
55 IntegerArray(size_type n,
const value_type& val,
const allocator_type& alloc = allocator_type())
56 : base_type(n, val, alloc) {}
65 typedef vector<string> base_type;
66 using base_type::size_type;
67 using base_type::value_type;
68 using base_type::allocator_type;
79 StringArray(size_type n,
const value_type& val,
const allocator_type& alloc = allocator_type())
80 : base_type(n, val, alloc) {}
88 virtual void print(ostream&)
const {};
119 origin[0] = origin[1] = -1;
122 site_width = site_spacing = site_orient = site_symmetry = 0;
126 virtual void print(ostream& ss)
const
128 ss <<
"//////// Row ////////" << endl
129 <<
"origin = " << origin[0] <<
" " << origin[1] << endl
130 <<
"orient = " << orient << endl
131 <<
"site width = " << site_width << endl
132 <<
"site_spacing = " << site_spacing << endl
133 <<
"site_orient = " << site_orient << endl
134 <<
"site_symmetry = " << site_symmetry << endl;
163 NetPin(
string& nn,
char d,
double x,
double y,
double w,
double h,
string& pn)
178 NetPin(
string& nn,
char d,
double x,
double y,
double w,
double h)
194 offset[0] = offset[1] = 0;
195 size[0] = size[1] = 0;
211 virtual void print(ostream& ss)
const
213 ss <<
"//////// Net ////////" << endl
214 <<
"net_name = " << net_name << endl;
215 for (uint32_t i = 0; i < vNetPin.size(); ++i)
216 ss <<
"(" << vNetPin[i].node_name <<
", " << vNetPin[i].pin_name <<
") "
217 << vNetPin[i].direct <<
" @(" << vNetPin[i].offset[0] <<
", " << vNetPin[i].offset[1] <<
")";
StringArray(size_type n, const value_type &val, const allocator_type &alloc=allocator_type())
virtual void print(ostream &ss) const
virtual void resize_bookshelf_row(int)=0
set number of rows
StringArray(const allocator_type &alloc=allocator_type())
IntegerArray(const allocator_type &alloc=allocator_type())
virtual void add_bookshelf_node(string &, int, int)=0
add node
double offset[2]
offset (x, y) to node origin
Base class for bookshelf database. Only pure virtual functions are defined. User needs to inheritate ...
namespace for BookshelfParser
net to describe interconnection of netlist
friend ostream & operator<<(ostream &ss, Item const &rhs)
virtual void set_bookshelf_node_position(string const &, double, double, string const &, string const &, bool)=0
set node position
NetPin(string &nn, char d, double x, double y, double w, double h)
IntegerArray(size_type n, const value_type &val, const allocator_type &alloc=allocator_type())
int32_t site_orient
orientation of a site
virtual void print(ostream &) const
print data members
virtual void add_bookshelf_terminal(string &, int, int)=0
add terminal
void reset()
reset all data members
virtual void set_bookshelf_design(string &)=0
set design name
string node_name
node name
virtual void print(ostream &ss) const
bison does not support vector very well, so here create a dummy class for string array.
double size[2]
sizes (x, y) of pin
Temporary data structures to hold parsed data. Base class for all temporary data structures.
int32_t site_spacing
spacing of a site
bison does not support vector very well, so here create a dummy class for integer array...
virtual void add_bookshelf_net(Net const &)=0
add net
int32_t site_width
width of a site
virtual void resize_bookshelf_pin(int)=0
set number of pins
void reset()
reset all data members
int32_t site_num
number of sites
virtual void add_bookshelf_row(Row const &)=0
add row
NetPin(string &nn, char d, double x, double y, double w, double h, string &pn)
virtual void resize_bookshelf_net(int)=0
set number of nets
virtual void resize_bookshelf_node_terminals(int, int)=0
set number of terminals
void reset()
reset all data members
virtual void bookshelf_end()=0
a callback when a bookshelf file reaches to the end