Limbo 3.5.4
Loading...
Searching...
No Matches
BookshelfDriver.h
Go to the documentation of this file.
1
7
8#ifndef BOOKSHELFPARSER_DRIVER_H
9#define BOOKSHELFPARSER_DRIVER_H
10
11#include "BookshelfDataBase.h"
12
16namespace BookshelfParser {
17
18using std::cout;
19using std::endl;
20using std::cerr;
21using std::string;
22using std::vector;
23using std::pair;
24using std::make_pair;
25using std::ostringstream;
26
36class Driver
37{
38public:
42
45
48
50 string streamname;
51
57 bool parse_stream(std::istream& in,
58 const string& sname = "stream input");
59
65 bool parse_string(const string& input,
66 const string& sname = "string stream");
67
73 bool parse_file(const string& filename);
74
75 // To demonstrate pure handling of parse errors, instead of
76 // simply dumping them on the standard error output, we will pass
77 // them to the driver using the following two member functions.
78
81 void error(const class location& l, const string& m);
82
85 void error(const string& m);
86
89 class Scanner* lexer;
90
94
97 void setPlFlag(bool flag);
98 // .nodes file
100 void numNodeTerminalsCbk(int, int);
102 void terminalEntryCbk(string&, int, int);
104 void terminalNIEntryCbk(string&, int, int);
106 void nodeEntryCbk(string&, int, int, string&);
108 void nodeEntryCbk(string&, int, int);
109 // .nets file
111 void numNetCbk(int);
113 void numPinCbk(int);
115 void netPinEntryCbk(string&, char, double, double, double, double, string&);
117 void netPinEntryCbk(string&, char, double, double, double=0.0, double=0.0);
119 void netNameAndDegreeCbk(string&, int);
122 // .pl file
124 void plNodeEntryCbk(string&, double, double, string&, string&);
126 void plNodeEntryCbk(string&, double, double, string&);
127 // .scl file
129 void sclNumRows(int);
131 void sclCoreRowStart(string const&);
143 void sclCoreRowSiteorient(string&);
154 // .wts file
156 void wtsNetWeightEntry(string&, double);
161 void shapesEntryCbk(string&, double, double, double, double);
163 void shapesNodeNameCbk(string&, int);
167 void routeGridCbk(int, int, int);
179 void routeGridOriginCbk(double, double);
181 void routeTileSizeCbk(double, double);
188 void routePinLayerCbk(string&, int);
189 void routePinLayerCbk(string&, string&);
194 void routeBlockageNodeLayerCbk(string&, int, StringArray&);
195 // .aux file
197 void auxCbk(string&, vector<string>&);
198
202protected:
208 bool m_plFlag;
209};
210
215bool read(BookshelfDataBase& db, const string& auxFile);
219bool readPl(BookshelfDataBase& db, const string& plFile);
220
221} // namespace example
222
223#endif // EXAMPLE_DRIVER_H
Database for Bookshelf parser.
Base class for bookshelf database. Only pure virtual functions are defined. User needs to inheritat...
void routeHorizontalCapacityCbk(IntegerArray &)
from .route file, Horizontal capacity per tile edge on each layer
void setPlFlag(bool flag)
control m_plFlag
void terminalEntryCbk(string &, int, int)
from .nodes file, terminal entry
bool m_plFlag
if true, indicate that only reads .pl file, this will result in different callbacks in the database
NodeShape m_shape
temporary storage of shape
bool trace_scanning
enable debug output in the flex scanner
void shapesEndCbk()
from .shapes file, end file
void sclCoreRowSitespacing(int)
from .scl file, site spacing
void plNodeEntryCbk(string &, double, double, string &)
from .pl file, node entry in placement
void routeBlockagePorosityCbk(int)
from .route file, Porosity for routing blockages (Zero implies the blockage completely blocks overlap...
void routeBlockageNodeLayerCbk(string &, int, IntegerArray &)
from .route file, for blockages, (node_name num_blocked_layers list_of_blocked_layers)
void routeVerticalCapacityCbk(IntegerArray &)
from .route file, Vertical capacity per tile edge on each layer
void routeMinWireSpacingCbk(IntegerArray &)
from .route file, Minimum spacing on each layer
Row m_row
temporary storage of row
bool parse_string(const string &input, const string &sname="string stream")
void routeNumBlockageNodes(int)
from .route file, number of blockage nodes
void routePinLayerCbk(string &, int)
from .route file, for IO pins, (node_name layer_id_for_all_node_pins)
void netEntryCbk()
from .nets file, net entry
void netPinEntryCbk(string &, char, double, double, double=0.0, double=0.0)
from .nets file, entry of net and pin
void sclCoreRowSitesymmetry(int)
from .scl file, site symmetry
void error(const string &m)
void wtsNetWeightEntry(string &, double)
from .wts file, net weight entry
void numPinCbk(int)
from .nets file, number of pins
void routeGridCbk(int, int, int)
from .route file, Global routing grid (num_X_grids num_Y_grids num_layers)
Driver(BookshelfDataBase &db)
void shapesEntryCbk(string &, double, double, double, double)
from .shapes file, one box entry
RouteInfo m_routeInfo
temporary storage of routing information
void sclCoreRowEnd()
from .scl file, end of core row
void sclCoreRowHeight(int)
from .scl file, core row height
Net m_net
temporary storage of net
void routeGridOriginCbk(double, double)
from .route file, Absolute coordinates of the origin of the grid (grid_lowerleft_X grid_lowerleft_Y)
void sclCoreRowSitewidth(int)
from .scl file, site width
void terminalNIEntryCbk(string &, int, int)
from .nodes file, terminal_NI entry
void sclCoreRowNumSites(int)
from .scl file, number of sites
void routeTileSizeCbk(double, double)
from .route file, tile_width tile_height
void error(const class location &l, const string &m)
void nodeEntryCbk(string &, int, int, string &)
from .nodes file, node entry
void nodeEntryCbk(string &, int, int)
from .nodes file, node entry
void sclCoreRowSitesymmetry(string &)
from .scl file, site symmetry
void routeNumNiTerminalsCbk(int)
from .route file, number of IO pins
void routeMinWireWidthCbk(IntegerArray &)
from .route file, Minimum metal width on each layer
bool parse_stream(std::istream &in, const string &sname="stream input")
void sclNumRows(int)
from .scl file, number of rows
void sclCoreRowSubRowOrigin(int)
from .scl file, subrow origin
bool parse_file(const string &filename)
void auxCbk(string &, vector< string > &)
from .aux file, other bookshelf files
vector< string > m_vBookshelfFiles
store bookshelf files except .aux
string streamname
stream name (file or input stream) used for error messages.
void sclCoreRowSiteorient(int)
from .scl file, site orientation
bool trace_parsing
enable debug output in the bison parser
void netNameAndDegreeCbk(string &, int)
from .nets file, net name and degree
void sclCoreRowCoordinate(int)
from .scl file, core row coordinate
BookshelfDataBase & m_db
void numNetCbk(int)
from .nets file, number of nets
void shapesNumNonRectangularNodesCbk(int)
from .shapes file, number of nodes with non-rectangular shapes
void routeViaSpacingCbk(IntegerArray &)
from .route file, Via spacing per layer
void numNodeTerminalsCbk(int, int)
from .nodes file, number of node and terminals
vector< string > const & bookshelfFiles() const
void netPinEntryCbk(string &, char, double, double, double, double, string &)
from .nets file, entry of net and pin
void sclCoreRowStart(string const &)
from .scl file, core row start
void plNodeEntryCbk(string &, double, double, string &, string &)
from .pl file, node entry in placement
void sclCoreRowSiteorient(string &)
from .scl file, site orientation
void shapesNodeNameCbk(string &, int)
from .shapes file, node name and number of boxes
bison does not support vector very well, so here create a dummy class for integer array.
bison does not support vector very well, so here create a dummy class for string array.
namespace for BookshelfParser
bool readPl(BookshelfDataBase &db, const string &plFile)
Read .pl file only, the callback only provide positions and orientation.
bool read(BookshelfDataBase &db, const string &auxFile)
API for BookshelfParser. Read .aux file and parse all other files.
net to describe interconnection of netlist
node shape to describe the shapes of node
information for routing to describe .route refer to DAC 2012 contest http://archive....