8#ifndef DEFPARSER_DATABASE_H
9#define DEFPARSER_DATABASE_H
11#include "limbo/thirdparty/lefdef/5.8/def/def/defiNet.hpp"
12#include "limbo/thirdparty/lefdef/5.8/def/def/defiRowTrack.hpp"
13#include "limbo/thirdparty/lefdef/5.8/def/def/defiVia.hpp"
22#include <limbo/thirdparty/lefdef/5.8/def/def/defrReader.hpp>
23#include <limbo/thirdparty/lefdef/5.8/def/def/defiAlias.hpp>
36using std::ostringstream;
38typedef unsigned int uint32_t;
47 virtual void print(ostringstream&)
const {};
54 std::ostringstream ss;
88 virtual void print(ostringstream& ss)
const
90 ss <<
"//////// Row ////////" << endl
94 <<
"orient = " <<
orient << endl
96 <<
"step = " <<
step[0] <<
" " <<
step[1] << endl;
115 virtual void print(ostringstream& ss)
const
117 ss <<
"//////// Component ////////" << endl
120 <<
"status = " <<
status << endl
122 <<
"orient = " <<
orient << endl;
143 virtual void print(ostringstream& ss)
const
145 ss <<
"//////// Port ////////" << endl
146 <<
"status = " <<
status << endl
148 <<
"orient = " <<
orient << endl;
149 for (uint32_t i = 0; i <
vLayer.size(); ++i)
178 virtual void print(ostringstream& ss)
const
180 ss <<
"//////// Pin ////////" << endl
181 <<
"pin_name = " <<
pin_name << endl
182 <<
"net_name = " <<
net_name << endl
183 <<
"direct = " <<
direct << endl
184 <<
"status = " <<
status << endl
186 <<
"orient = " <<
orient << endl;
187 for (uint32_t i = 0; i <
vLayer.size(); ++i)
189 ss <<
"use = " <<
use << endl;
190 for (uint32_t i = 0; i <
vPinPort.size(); ++i)
209 virtual void print(ostringstream& ss)
const
211 ss <<
"//////// Net ////////" << endl
212 <<
"net_name = " <<
net_name << endl
214 for (uint32_t i = 0; i <
vNetPin.size(); ++i)
215 ss <<
"(" <<
vNetPin[i].first <<
", " <<
vNetPin[i].second <<
") ";
241 virtual void print(ostringstream& ss)
const
243 ss <<
"//////// Region ////////" << endl
246 for (uint32_t i = 0; i <
vRectangle.size(); ++i)
283 virtual void print(ostringstream& ss)
const
285 ss <<
"//////// Group ////////" << endl
288 <<
"perim = " <<
perim << endl
289 <<
"maxx = " << maxx <<
", " <<
"maxy = " << maxy << endl;
294 for (uint32_t i = 0; i <
vRectangle.size(); ++i)
325 virtual void print(ostringstream& ss)
const
327 ss <<
"//////// Track ////////" << endl
328 <<
"start = " << start << endl
329 <<
"step = " << step << endl
330 <<
"num = " << num << endl
333 ss << layername <<
" ";
356 virtual void print(ostringstream& ss)
const
358 ss <<
"//////// GCellGrid ////////" << endl
360 <<
"start = " << start << endl
361 <<
"step = " << step << endl
362 <<
"num = " << num << endl;
379 virtual void print(ostringstream& ss)
const
381 ss <<
"//////// Via ////////" << endl
383 <<
"coord = ()" << x <<
", " << y <<
")" << endl;
400 virtual void print(ostringstream& ss)
const
402 ss <<
"//////// Via ////////" << endl
404 <<
"coord = ()" << x <<
", " << y <<
")" << endl;
426 virtual void print(ostringstream& ss)
const
428 ss <<
"//////// Special Net ////////" << endl
430 <<
"type = " << type << endl
432 for (
auto const& via: vias) {
435 ss << endl <<
"shapes = ";
436 for (
auto const& rect:
shapes) {
438 for (
int i = 0; i < rect.size(); ++i) {
439 ss << rect[i] <<
", ";
483 virtual void add_def_track(defiTrack
const&);
484 virtual void add_def_gcellgrid(
GCellGrid const&);
485 virtual void add_def_snet(defiNet
const&);
486 virtual void add_def_via(defiVia
const&);
Base class for def database. Only pure virtual functions are defined. User needs to inheritate this...
virtual void add_def_route_blockage(std::vector< std::vector< int > > const &, std::string const &)
add placement blockages, array of boxes with xl, yl, xh, yh
virtual void set_def_dividerchar(string const &)=0
set divider characters
virtual void add_def_component(Component const &)=0
add component/cell
virtual void resize_def_component(int)=0
add component/cell
virtual void add_def_row(Row const &)=0
add row
virtual void set_def_version(string const &)=0
set DEF version
virtual void set_def_diearea(int, int, int, int)=0
set die area xl, yl, xh, yh
virtual void resize_def_net(int)=0
set number of nets
virtual void resize_def_blockage(int)
set number of blockages
virtual void add_def_pin(Pin const &)=0
add pin
virtual void resize_def_group(int)
set number of groups
virtual void end_def_design()
end of design
virtual void add_def_placement_blockage(std::vector< std::vector< int > > const &)
add placement blockages, array of boxes with xl, yl, xh, yh
virtual void set_def_design(string const &)=0
set design name
virtual void set_def_unit(int)=0
set DEF unit
virtual void resize_def_region(int)
set number of regions
virtual void set_def_busbitchars(string const &)=0
set BUS bit characters
virtual void add_def_region(Region const &)
add region
virtual void add_def_net(Net const &)=0
add net
virtual void add_def_group(Group const &)
add group
virtual void resize_def_pin(int)=0
set number of pins
void def_user_cbk_reminder(const char *str) const
remind users to define some optional callback functions at runtime
virtual void set_def_diearea(int, const int *, const int *)
set die area, optional parameters for non-rectangular shapes defined as points
string status
placement status
void reset()
reset all data members
virtual void print(ostringstream &ss) const
print data members
string macro_name
macro name of component, standard cell type
int32_t origin[2]
x, y of origin
string comp_name
component name
string gcellgrid_name
group name
void reset()
reset all data members
virtual void print(ostringstream &ss) const
print data members
group to describe cells corresponding to region
std::vector< std::vector< int > > vRectangle
array of regions with (xl, yl, xh, yh)
void reset()
reset all data members
std::vector< string > vPropertyName
array of property names
string region_name
region name
std::vector< string > vPropertyValue
array of property values
string group_name
group name
int perim
MAXHALFPERIMETER, I do not know what they are used for.
std::vector< char > vPropertyType
array of property types
virtual void print(ostringstream &ss) const
print data members
std::vector< string > vGroupMember
group members
Temporary data structures to hold parsed data. Base class for all temporary data structures.
friend ostringstream & operator<<(ostringstream &ss, Item const &rhs)
friend std::ostream & operator<<(std::ostream &os, Item const &rhs)
virtual void print(ostringstream &) const
print data members
net to describe interconnection of netlist
void reset()
reset all data members
int32_t net_weight
net weight
vector< std::pair< string, string > > vNetPin
virtual void print(ostringstream &ss) const
print data members
void reset()
reset all data members
vector< vector< int32_t > > vBbox
bounding box on each layer
vector< string > vLayer
layers
vector< PinPort > vPinPort
string use
"use" token in DEF file
virtual void print(ostringstream &ss) const
print data members
int32_t origin[2]
offset to node origin
string status
placement status
vector< string > vLayer
layers
virtual void print(ostringstream &ss) const
print data members
vector< vector< int32_t > > vBbox
int32_t origin[2]
offset to node origin
void reset()
reset all data members
string status
placement status
region to describe regions like fence
void reset()
reset all data members
string region_type
region type
std::vector< string > vPropertyName
array of property names
std::vector< std::vector< int > > vRectangle
array of rectangles with (xl, yl, xh, yh)
std::vector< char > vPropertyType
array of property types
virtual void print(ostringstream &ss) const
print data members
std::vector< string > vPropertyValue
array of property values
string region_name
region name
int32_t repeat[2]
do x by y
string macro_name
macro name of row
int32_t origin[2]
x, y of origin
void reset()
reset all data members
virtual void print(ostringstream &ss) const
print data members
void reset()
reset all data members
std::string net_name
group name
vector< vector< int > > shapes
shapes in snet, only support rectangles yet
virtual void print(ostringstream &ss) const
print data members
string track_name
group name
virtual void print(ostringstream &ss) const
print data members
void reset()
reset all data members
std::vector< string > vLayerNames
group members
void reset()
reset all data members
virtual void print(ostringstream &ss) const
print data members
std::string viatype_name
group name
void reset()
reset all data members
std::string viatype_name
group name
virtual void print(ostringstream &ss) const
print data members