abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
place_base.h
Go to the documentation of this file.
1 /*===================================================================*/
2 //
3 // place_base.h
4 //
5 // Aaron P. Hurst, 2003-2007
6 // ahurst@eecs.berkeley.edu
7 //
8 /*===================================================================*/
9 
10 #if !defined(PLACE_BASE_H_)
11 #define ABC__phys__place__place_base_h
12 
13 
15 
16 
17 // --------------------------------------------------------------------
18 // Data structures
19 //
20 // --------------------------------------------------------------------
21 
22 // --- a C++ bool-like type
23 //typedef char bool;
24 #ifndef ABC__phys__place__place_base_h
25 #define bool int
26 #endif
27 
28 #define true 1
29 #define false 0
30 
31 
32 // --- Rect - rectangle
33 
34 typedef struct Rect {
35  float x, y;
36  float w, h;
37 } Rect;
38 
39 
40 // --- AbstractCell - a definition of a cell type
41 
42 typedef struct AbstractCell {
43  char *m_label; // string description
44 
45  float m_width, m_height; // dimensions
46 
47  bool m_pad; // a pad (external I/O) cell?
48 } AbstractCell;
49 
50 
51 // --- ConcreteCell - a design object
52 
53 typedef struct ConcreteCell {
54  int m_id; // a unique ID (see below)
55  char *m_label; // string description
56 
57  AbstractCell *m_parent; // cell type
58 
59  bool m_fixed; // position is fixed?
60  float m_x, m_y; // center of cell
61 
62  int m_data;
63 } ConcreteCell;
64 
65 
66 // --- ConcreteNet - a design net
67 
68 typedef struct ConcreteNet {
69  int m_id; // a unique ID (see below)
70 
71  int m_numTerms; // num. of connected cells
72  ConcreteCell **m_terms; // connected cells
73 
74  float m_weight; // relative weight
75 
76  int m_data;
77 } ConcreteNet;
78 
79 
80 // A note about IDs - the IDs are non-nonegative integers. They need not
81 // be contiguous, but this is certainly a good idea, as they are stored
82 // in a non-sparse array.
83 // Cells and nets have separate ID spaces.
84 
85 // --------------------------------------------------------------------
86 // Global variable prototypes
87 //
88 // --------------------------------------------------------------------
89 
90 // NOTE: None of these need to be managed externally.
91 
92 extern int g_place_numCells; // number of cells
93 extern int g_place_numNets; // number of nets
94 extern float g_place_rowHeight; // height of placement row
95 extern Rect g_place_coreBounds; // border of placeable area
96  // (x,y) = corner
97 extern Rect g_place_padBounds; // border of total die area
98  // (x,y) = corner
99 
100 extern ConcreteCell **g_place_concreteCells; // all concrete cells
101 extern ConcreteNet **g_place_concreteNets; // all concrete nets
102 
103 
104 // --------------------------------------------------------------------
105 // Function prototypes
106 //
107 // --------------------------------------------------------------------
108 
109 void addConcreteNet(ConcreteNet *net);
110 void addConcreteCell(ConcreteCell *cell);
111 void delConcreteNet(ConcreteNet *net);
112 void delConcreteCell(ConcreteCell *cell);
113 
114 void globalPreplace(float utilization);
115 void globalPlace();
116 void globalIncremental();
117 void globalFixDensity(int numBins, float maxMovement);
118 
119 float fastEstimate(ConcreteCell *cell,
120  int numNets, ConcreteNet *nets[]);
122  int numNets, ConcreteNet *nets[]);
123 
124 Rect getNetBBox(const ConcreteNet *net);
125 float getNetWirelength(const ConcreteNet *net);
126 float getTotalWirelength();
127 float getCellArea(const ConcreteCell *cell);
128 
129 void writeBookshelf(const char *filename);
130 
131 // comparative qsort-style functions
132 int netSortByL(const void *a, const void *b);
133 int netSortByR(const void *a, const void *b);
134 int netSortByB(const void *a, const void *b);
135 int netSortByT(const void *a, const void *b);
136 int netSortByID(const void *a, const void *b);
137 int cellSortByX(const void *a, const void *b);
138 int cellSortByY(const void *a, const void *b);
139 int cellSortByID(const void *a, const void *b);
140 
141 
142 
144 
145 #endif
char * filename
Definition: globals.c:40
void delConcreteCell(ConcreteCell *cell)
Removes a cell from the placement database.
Definition: place_base.c:216
int netSortByL(const void *a, const void *b)
Sorts nets by position of one of its corners.
Definition: place_base.c:235
float g_place_rowHeight
Definition: place_base.c:28
AbstractCell * m_parent
Definition: place_base.h:57
int cellSortByX(const void *a, const void *b)
Sorts cells by either position coordinate.
Definition: place_base.c:314
int g_place_numCells
Definition: place_base.c:26
int cellSortByID(const void *a, const void *b)
Definition: place_base.c:338
ConcreteCell * cells
Definition: abcPlace.c:34
float h
Definition: place_base.h:36
struct Rect Rect
float x
Definition: place_base.h:35
void globalPlace()
Performs analytic placement using a GORDIAN-like algorithm.
Definition: place_gordian.c:39
float m_width
Definition: place_base.h:45
Rect getNetBBox(const ConcreteNet *net)
Returns the bounding box of a net.
Definition: place_base.c:45
Rect g_place_padBounds
Definition: place_base.c:31
int g_place_numNets
Definition: place_base.c:27
struct ConcreteCell ConcreteCell
ConcreteCell ** g_place_concreteCells
Definition: place_base.c:33
float getCellArea(const ConcreteCell *cell)
Definition: place_base.c:99
float m_weight
Definition: place_base.h:74
int netSortByB(const void *a, const void *b)
Definition: place_base.c:263
float y
Definition: place_base.h:35
int netSortByID(const void *a, const void *b)
Definition: place_base.c:291
char * m_label
Definition: place_base.h:55
ConcreteNet * nets
Definition: abcPlace.c:35
Rect g_place_coreBounds
Definition: place_base.c:30
void delConcreteNet(ConcreteNet *net)
Does not deallocate memory.
Definition: place_base.c:141
int netSortByT(const void *a, const void *b)
Definition: place_base.c:277
bool m_fixed
Definition: place_base.h:59
ConcreteCell ** m_terms
Definition: place_base.h:72
int netSortByR(const void *a, const void *b)
Definition: place_base.c:249
float m_height
Definition: place_base.h:45
int numNets
Definition: place_test.c:68
void globalFixDensity(int numBins, float maxMovement)
Doesn't deal well with fixed cells in the core area.
Definition: place_bin.c:43
int cellSortByY(const void *a, const void *b)
Definition: place_base.c:326
float getTotalWirelength()
Returns the total HPWL of all nets.
Definition: place_base.c:86
void globalIncremental()
Performs analytic placement using a GORDIAN-like algorithm.
Definition: place_gordian.c:94
ConcreteNet ** g_place_concreteNets
Definition: place_base.c:35
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
struct ConcreteNet ConcreteNet
void globalPreplace(float utilization)
Place pad ring, leaving a core area to meet a desired utilization.
Definition: place_pads.c:31
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
int m_numTerms
Definition: place_base.h:71
char * m_label
Definition: place_base.h:43
float w
Definition: place_base.h:36
int numCells
Definition: place_test.c:68
float getNetWirelength(const ConcreteNet *net)
Returns the half-perimeter wirelength of a net.
Definition: place_base.c:70
float fastEstimate(ConcreteCell *cell, int numNets, ConcreteNet *nets[])
Definition: place_inc.c:92
void writeBookshelf(const char *filename)
Definition: place_io.c:94
struct AbstractCell AbstractCell
void addConcreteNet(ConcreteNet *net)
Adds a net to the placement database.
Definition: place_base.c:114
void addConcreteCell(ConcreteCell *cell)
Definition: place_base.c:155
float fastTopoPlace(int numCells, ConcreteCell *cells[], int numNets, ConcreteNet *nets[])