abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
place_gordian.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#include <limits.h>
#include "place_gordian.h"
#include "place_base.h"

Go to the source code of this file.

Functions

void globalPlace ()
 Performs analytic placement using a GORDIAN-like algorithm. More...
 
void globalIncremental ()
 Performs analytic placement using a GORDIAN-like algorithm. More...
 
void sanitizePlacement ()
 Moves any cells that are outside of the core bounds to the nearest location within. More...
 

Variables

ABC_NAMESPACE_IMPL_START int g_place_numPartitions
 

Function Documentation

void globalIncremental ( )

Performs analytic placement using a GORDIAN-like algorithm.

Requires a valid set of partitions.

Definition at line 94 of file place_gordian.c.

94  {
95  if (!g_place_rootPartition) {
96  printf("WARNING: Can not perform incremental placement\n");
97  globalPlace();
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 }
Partition * g_place_rootPartition
void constructQuadraticProblem()
Constructs the matrices necessary to do analytical placement.
Definition: place_genqp.c:53
#define IGNORE_COG
Definition: place_gordian.h:29
void globalFixDensity(int numBins, float maxMovement)
Doesn't deal well with fixed cells in the core area.
Definition: place_bin.c:43
float getTotalWirelength()
Returns the total HPWL of all nets.
Definition: place_base.c:86
void incrementalPartition()
Adds new cells to an existing partition. Partition sizes/locations are unchanged. ...
void globalPlace()
Performs analytic placement using a GORDIAN-like algorithm.
Definition: place_gordian.c:39
void sanitizePlacement()
Moves any cells that are outside of the core bounds to the nearest location within.
float g_place_rowHeight
Definition: place_base.c:28
void solveQuadraticProblem(bool useCOG)
Calls quadratic solver.
Definition: place_genqp.c:275
void globalPlace ( )

Performs analytic placement using a GORDIAN-like algorithm.

Updates the positions of all non-fixed non-pad cells.

Definition at line 39 of file place_gordian.c.

39  {
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 }
ABC_NAMESPACE_IMPL_START int g_place_numPartitions
Definition: place_gordian.c:28
#define REALLOCATE_PARTITIONS
Definition: place_gordian.h:27
void constructQuadraticProblem()
Constructs the matrices necessary to do analytical placement.
Definition: place_genqp.c:53
#define IGNORE_COG
Definition: place_gordian.h:29
#define FINAL_REALLOCATE_PARTITIONS
Definition: place_gordian.h:28
void globalFixDensity(int numBins, float maxMovement)
Doesn't deal well with fixed cells in the core area.
Definition: place_bin.c:43
bool refinePartitions()
Splits large leaf partitions.
float getTotalWirelength()
Returns the total HPWL of all nets.
Definition: place_base.c:86
void sanitizePlacement()
Moves any cells that are outside of the core bounds to the nearest location within.
float g_place_rowHeight
Definition: place_base.c:28
void reallocPartitions()
Reallocates the partitions based on placement information.
void solveQuadraticProblem(bool useCOG)
Calls quadratic solver.
Definition: place_genqp.c:275
void initPartitioning()
Initializes data structures necessary for partitioning.
void sanitizePlacement ( )

Moves any cells that are outside of the core bounds to the nearest location within.

Definition at line 125 of file place_gordian.c.

125  {
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 }
AbstractCell * m_parent
Definition: place_base.h:57
float h
Definition: place_base.h:36
float x
Definition: place_base.h:35
float m_width
Definition: place_base.h:45
float y
Definition: place_base.h:35
ConcreteCell ** g_place_concreteCells
Definition: place_base.c:33
bool m_fixed
Definition: place_base.h:59
float m_height
Definition: place_base.h:45
Rect g_place_coreBounds
Definition: place_base.c:30
float w
Definition: place_base.h:36
ABC_NAMESPACE_IMPL_START int g_place_numCells
Definition: place_base.c:26
float g_place_rowHeight
Definition: place_base.c:28

Variable Documentation

ABC_NAMESPACE_IMPL_START int g_place_numPartitions

Definition at line 28 of file place_gordian.c.