ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
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
34typedef struct Rect {
35 float x, y;
36 float w, h;
38
39
40// --- AbstractCell - a definition of a cell type
41
42typedef 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?
49
50
51// --- ConcreteCell - a design object
52
53typedef 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;
64
65
66// --- ConcreteNet - a design net
67
68typedef 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;
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
92extern int g_place_numCells; // number of cells
93extern int g_place_numNets; // number of nets
94extern float g_place_rowHeight; // height of placement row
95extern Rect g_place_coreBounds; // border of placeable area
96 // (x,y) = corner
97extern Rect g_place_padBounds; // border of total die area
98 // (x,y) = corner
99
100extern ConcreteCell **g_place_concreteCells; // all concrete cells
101extern ConcreteNet **g_place_concreteNets; // all concrete nets
102
103
104// --------------------------------------------------------------------
105// Function prototypes
106//
107// --------------------------------------------------------------------
108
109void addConcreteNet(ConcreteNet *net);
110void addConcreteCell(ConcreteCell *cell);
111void delConcreteNet(ConcreteNet *net);
112void delConcreteCell(ConcreteCell *cell);
113
114void globalPreplace(float utilization);
115void globalPlace();
116void globalIncremental();
117void globalFixDensity(int numBins, float maxMovement);
118
119float fastEstimate(ConcreteCell *cell,
120 int numNets, ConcreteNet *nets[]);
122 int numNets, ConcreteNet *nets[]);
123
124Rect getNetBBox(const ConcreteNet *net);
125float getNetWirelength(const ConcreteNet *net);
126float getTotalWirelength();
127float getCellArea(const ConcreteCell *cell);
128
129void writeBookshelf(const char *filename);
130
131// comparative qsort-style functions
132int netSortByL(const void *a, const void *b);
133int netSortByR(const void *a, const void *b);
134int netSortByB(const void *a, const void *b);
135int netSortByT(const void *a, const void *b);
136int netSortByID(const void *a, const void *b);
137int cellSortByX(const void *a, const void *b);
138int cellSortByY(const void *a, const void *b);
139int cellSortByID(const void *a, const void *b);
140
141
142
144
145#endif
ConcreteNet * nets
Definition abcPlace.c:35
ConcreteCell * cells
Definition abcPlace.c:34
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
char * filename
Definition globals.c:40
ConcreteCell ** g_place_concreteCells
Definition place_base.c:33
ConcreteNet ** g_place_concreteNets
Definition place_base.c:35
Rect g_place_padBounds
Definition place_base.c:31
int g_place_numNets
Definition place_base.c:27
ABC_NAMESPACE_IMPL_START int g_place_numCells
Definition place_base.c:26
float g_place_rowHeight
Definition place_base.c:28
Rect g_place_coreBounds
Definition place_base.c:30
float getTotalWirelength()
Returns the total HPWL of all nets.
Definition place_base.c:86
Rect getNetBBox(const ConcreteNet *net)
Returns the bounding box of a net.
Definition place_base.c:45
void globalPreplace(float utilization)
Place pad ring, leaving a core area to meet a desired utilization.
Definition place_pads.c:31
int netSortByB(const void *a, const void *b)
Definition place_base.c:263
int netSortByR(const void *a, const void *b)
Definition place_base.c:249
float fastEstimate(ConcreteCell *cell, int numNets, ConcreteNet *nets[])
Definition place_inc.c:92
float getNetWirelength(const ConcreteNet *net)
Returns the half-perimeter wirelength of a net.
Definition place_base.c:70
void globalPlace()
Performs analytic placement using a GORDIAN-like algorithm.
int cellSortByID(const void *a, const void *b)
Definition place_base.c:338
void delConcreteCell(ConcreteCell *cell)
Removes a cell from the placement database.
Definition place_base.c:216
float getCellArea(const ConcreteCell *cell)
Definition place_base.c:99
void addConcreteNet(ConcreteNet *net)
Adds a net to the placement database.
Definition place_base.c:114
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
int netSortByID(const void *a, const void *b)
Definition place_base.c:291
int netSortByT(const void *a, const void *b)
Definition place_base.c:277
void globalIncremental()
Performs analytic placement using a GORDIAN-like algorithm.
void writeBookshelf(const char *filename)
Definition place_io.c:94
int netSortByL(const void *a, const void *b)
Sorts nets by position of one of its corners.
Definition place_base.c:235
void delConcreteNet(ConcreteNet *net)
Does not deallocate memory.
Definition place_base.c:141
void addConcreteCell(ConcreteCell *cell)
Definition place_base.c:155
float fastTopoPlace(int numCells, ConcreteCell *cells[], int numNets, ConcreteNet *nets[])
int cellSortByX(const void *a, const void *b)
Sorts cells by either position coordinate.
Definition place_base.c:314
int numNets
Definition place_test.c:68
int numCells
Definition place_test.c:68
float m_width
Definition place_base.h:45
char * m_label
Definition place_base.h:43
float m_height
Definition place_base.h:45
char * m_label
Definition place_base.h:55
AbstractCell * m_parent
Definition place_base.h:57
ConcreteCell ** m_terms
Definition place_base.h:72
float m_weight
Definition place_base.h:74
float w
Definition place_base.h:36
float x
Definition place_base.h:35
float y
Definition place_base.h:35
float h
Definition place_base.h:36