abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
place_qpsolver.h
Go to the documentation of this file.
1 /*===================================================================*/
2 //
3 // place_qpsolver.h
4 //
5 // Philip Chong
6 // pchong@cadence.com
7 //
8 /*===================================================================*/
9 
10 #if !defined(_QPS_H)
11 #define ABC__phys__place__place_qpsolver_h
12 
13 
14 #include <stdio.h>
15 
17 
18 
19 #if defined(__cplusplus)
20 extern "C" {
21 #endif /* __cplusplus */
22 
23  typedef float qps_float_t;
24 
25  typedef struct qps_problem {
26 
27  /* Basic stuff */
28  int num_cells; /* Total number of cells (both fixed and
29  floating) to be placed. */
30  int *connect; /* Connectivity array. Must contain at least
31  num_cells elements with value -1. The
32  entries which precede the first element
33  with value -1 are the indices of the cells
34  which connect to cell 0; the entries
35  which lie between the first and second
36  elements with value -1 are the indices of
37  the cells which connect to cell 1; etc.
38  Example: cells 0 and 1 are connected
39  together, and 1 and 2 are connected as
40  well. *connect = { 1, -1, 0, 2, -1, 1, -1
41  }. */
42  qps_float_t *edge_weight; /* Same structure as connectivity array, but
43  giving the weights assigned to each edge
44  instead. */
45  qps_float_t *x; /* num_cells element array which contains the
46  x-coordinates of the cells. This is used
47  for the initial values in the iterative
48  solution of floating cells, and for the
49  fixed location of fixed cells. */
50  qps_float_t *y; /* num_cells element array of
51  y-coordinates. */
52  int *fixed; /* num_cells element array with value 1 if
53  corresponding cell is fixed, 0 if
54  floating. */
55  qps_float_t f; /* return value for sum-of-square
56  wirelengths. */
57 
58  /* COG stuff */
59  int cog_num; /* Number of COG constraints. */
60  int *cog_list; /* Array indicating for each COG constraint
61  which cells belong to that constraint.
62  Format is similar to c array: there must
63  be at least cog_num elements with value
64  -1. The entries of cog_list preceding the
65  first -1 element are the indices of the
66  cells which belong to the first COG
67  constraint; etc. Example: cells 0 and 1
68  belong to one COG constraint, cells 4 and
69  5 belong to another. *cog_list= { 0, 1,
70  -1, 4, 5, -1 }. */
71  qps_float_t *cog_x; /* cog_num element array whose values are the
72  x-coordinates for the corresponding COG
73  constraints. */
74  qps_float_t *cog_y; /* cog_num element array whose values are the
75  y-coordinates for the corresponding COG
76  constraints. */
77  qps_float_t *area; /* num_cells element array whose values are
78  the areas for the corresponding cells;
79  only useful with COG constraints. */
80 
81  /* Loop constraint stuff */
82  int loop_num; /* Number of loop constraints. */
83  int *loop_list; /* Array with list of cells for each loop
84  constraint. Format is similar to cog_list.
85  */
86  qps_float_t *loop_max; /* loop_num element array indicating maximum
87  distance for each loop. */
88  qps_float_t *loop_penalty; /* loop_num element array indicating penalty
89  for each loop. */
90  int loop_k; /* Current iteration for loop optimization. */
91  int loop_done; /* Done flag for loop optimization. */
92  int loop_fail;
93 
94  /* max_x/max_y stuff */
95  qps_float_t max_x; /* max x location; only used in
96  constrained optimization. */
97  qps_float_t max_y; /* max y location; only used in
98  constrained optimization. */
99  int max_enable; /* Set to 1 after qps_init() to enable
100  max_x/max_y. */
101  int max_done; /* Done flag for max optimization. */
102 
103  /* Private stuff */
104  int *priv_ii;
105  int *priv_cc, *priv_cr;
106  qps_float_t *priv_cw, *priv_ct;
107  int priv_cm;
108  int *priv_gt;
109  int *priv_la;
110  int priv_lm;
111  qps_float_t *priv_gm, *priv_gw;
112  qps_float_t *priv_g, *priv_h, *priv_xi;
113  qps_float_t *priv_tp, *priv_tp2;
114  int priv_n;
115  qps_float_t *priv_cp;
116  qps_float_t priv_f;
117  qps_float_t *priv_lt;
118  qps_float_t *priv_pcg, *priv_pcgt;
119  qps_float_t priv_fmax;
120  qps_float_t priv_fprev;
121  qps_float_t priv_fopt;
122  qps_float_t priv_eps;
123  int priv_pn;
124  qps_float_t *priv_mxl, *priv_mxh, *priv_myl, *priv_myh;
125  int priv_ik;
126  FILE *priv_fp;
127 
128  } qps_problem_t;
129 
130  /* call qps_init() as soon as the qps_problem_t has been set up */
131  /* this initializes some private data structures */
132  extern void qps_init(qps_problem_t *);
133 
134  /* call qps_solve() to solve the given qp problem */
135  extern void qps_solve(qps_problem_t *);
136 
137  /* call qps_clean() when finished with the qps_problem_t */
138  /* this discards the private data structures assigned by qps_init() */
139  extern void qps_clean(qps_problem_t *);
140 
141 #if defined(__cplusplus)
142 }
143 #endif /* __cplusplus */
144 
145 
147 
148 #endif /* _QPS_H */
qps_float_t * priv_lt
qps_float_t * priv_mxh
qps_float_t max_y
void qps_init(qps_problem_t *)
qps_float_t priv_fopt
qps_float_t * priv_h
qps_float_t * y
qps_float_t * priv_gm
ABC_NAMESPACE_HEADER_START typedef float qps_float_t
qps_float_t priv_fprev
qps_float_t * priv_cw
qps_float_t * priv_xi
qps_float_t * area
qps_float_t priv_fmax
struct qps_problem qps_problem_t
qps_float_t * x
qps_float_t * cog_x
void qps_solve(qps_problem_t *)
qps_float_t * priv_ct
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
qps_float_t * priv_myl
void qps_clean(qps_problem_t *)
qps_float_t * edge_weight
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
qps_float_t * priv_mxl
qps_float_t * priv_cp
qps_float_t * priv_gw
qps_float_t * loop_penalty
qps_float_t * cog_y
qps_float_t * priv_myh
qps_float_t priv_f
qps_float_t * priv_tp
qps_float_t * priv_tp2
qps_float_t priv_eps
qps_float_t * priv_pcgt
qps_float_t * priv_pcg
qps_float_t * loop_max
qps_float_t f
qps_float_t * priv_g
qps_float_t max_x