ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
place_gordian.c
Go to the documentation of this file.
1/*===================================================================*/
2//
3// place_gordian.c
4//
5// Aaron P. Hurst, 2003-2007
6// ahurst@eecs.berkeley.edu
7//
8/*===================================================================*/
9
10#include <stdio.h>
11#include <stdlib.h>
12#include <math.h>
13#include <assert.h>
14#include <limits.h>
15
16#include "place_gordian.h"
17#include "place_base.h"
18
20
21
22
23// --------------------------------------------------------------------
24// Global variables
25//
26// --------------------------------------------------------------------
27
29
30
31// --------------------------------------------------------------------
32// globalPlace()
33//
35//
38// --------------------------------------------------------------------
40 bool completionFlag = false;
41 int iteration = 0;
42
43 printf("PLAC-10 : Global placement (wirelength-driven Gordian)\n");
44
46
47 // build matrices representing interconnections
48 printf("QMAN-00 : \tconstructing initial quadratic problem...\n");
50
51 // iterate placement until termination condition is met
52 while(!completionFlag) {
53 printf("QMAN-01 : \titeration %d numPartitions = %d\n",iteration,g_place_numPartitions);
54
55 // do the global optimization in each direction
56 printf("QMAN-01 : \t\tglobal optimization\n");
58
59 // -------- PARTITIONING BASED CELL SPREADING ------
60
61 // bisection
62 printf("QMAN-01 : \t\tpartition refinement\n");
64 completionFlag |= refinePartitions();
65
66 printf("QMAN-01 : \t\twirelength = %e\n", getTotalWirelength());
67
68 iteration++;
69 }
70
71 // final global optimization
72 printf("QMAN-02 : \t\tfinal pass\n");
75 printf("QMAN-01 : \t\twirelength = %e\n", getTotalWirelength());
76
77 // clean up
79 printf("QMAN-01 : \t\twirelength = %e\n", getTotalWirelength());
81 printf("QMAN-01 : \t\twirelength = %e\n", getTotalWirelength());
82}
83
84
85// --------------------------------------------------------------------
86// globalIncremental()
87//
89//
92// --------------------------------------------------------------------
93
96 printf("WARNING: Can not perform incremental placement\n");
98 return;
99 }
100
101 printf("PLAC-10 : Incremental global placement\n");
102
104
105 printf("QMAN-00 : \tconstructing initial quadratic problem...\n");
107
109 printf("QMAN-01 : \t\twirelength = %e\n", getTotalWirelength());
110
111 // clean up
113 printf("QMAN-01 : \t\twirelength = %e\n", getTotalWirelength());
115 printf("QMAN-01 : \t\twirelength = %e\n", getTotalWirelength());
116}
117
118
119// --------------------------------------------------------------------
120// sanitizePlacement()
121//
123//
124// --------------------------------------------------------------------
126 int c;
127 float order_width = g_place_rowHeight;
128 float x, y, edge, w, h;
129
130 printf("QCLN-10 : \tsanitizing placement\n");
131
132 for(c=0; c<g_place_numCells; c++) if (g_place_concreteCells[c]) {
134 if (cell->m_fixed || cell->m_parent->m_pad) {
135 continue;
136 }
137 // the new locations of the cells will be distributed within
138 // a small margin inside the border so that ordering is preserved
139 order_width = g_place_rowHeight;
140
141 x = cell->m_x, y = cell->m_y,
142 w = cell->m_parent->m_width, h = cell->m_parent->m_height;
143
144 if ((edge=x-w*0.5) < g_place_coreBounds.x) {
145 x = g_place_coreBounds.x+w*0.5 +
146 order_width/(1.0+g_place_coreBounds.x-edge);
147 }
148 else if ((edge=x+w*0.5) > g_place_coreBounds.x+g_place_coreBounds.w) {
150 order_width/(1.0+edge-g_place_coreBounds.x-g_place_coreBounds.w);
151 }
152 if ((edge=y-h*0.5) < g_place_coreBounds.y) {
153 y = g_place_coreBounds.y+h*0.5 +
154 order_width/(1.0+g_place_coreBounds.y-edge);
155 }
156 else if ((edge=y+h*0.5) > g_place_coreBounds.y+g_place_coreBounds.h) {
158 order_width/(1.0+edge-g_place_coreBounds.x-g_place_coreBounds.w);
159 }
160 cell->m_x = x;
161 cell->m_y = y;
162 }
163}
165
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
float getTotalWirelength()
Returns the total HPWL of all nets.
Definition place_base.c:86
ConcreteCell ** g_place_concreteCells
Definition place_base.c:33
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
void globalFixDensity(int numBins, float maxMovement)
Doesn't deal well with fixed cells in the core area.
Definition place_bin.c:43
void solveQuadraticProblem(bool useCOG)
Calls quadratic solver.
void constructQuadraticProblem()
Constructs the matrices necessary to do analytical placement.
Definition place_genqp.c:53
void globalPlace()
Performs analytic placement using a GORDIAN-like algorithm.
ABC_NAMESPACE_IMPL_START int g_place_numPartitions
void sanitizePlacement()
Moves any cells that are outside of the core bounds to the nearest location within.
void globalIncremental()
Performs analytic placement using a GORDIAN-like algorithm.
#define REALLOCATE_PARTITIONS
bool refinePartitions()
Splits large leaf partitions.
Partition * g_place_rootPartition
#define FINAL_REALLOCATE_PARTITIONS
void reallocPartitions()
Reallocates the partitions based on placement information.
void initPartitioning()
Initializes data structures necessary for partitioning.
void incrementalPartition()
Adds new cells to an existing partition. Partition sizes/locations are unchanged.
#define IGNORE_COG
float m_width
Definition place_base.h:45
float m_height
Definition place_base.h:45
AbstractCell * m_parent
Definition place_base.h:57