#include <stdio.h>
Go to the source code of this file.
#define ABC__phys__place__place_qpsolver_h |
Definition at line 542 of file place_qpsolver.c.
547 #if defined(QPS_DEBUG)
548 p->priv_fp = fopen(QPS_DEBUG_FILE,
"a");
553 fprintf(
p->priv_fp,
"### n=%d gn=%d ln=%d\n",
p->num_cells,
p->cog_num,
556 fprintf(
p->priv_fp,
"### (c w) values\n");
557 for (i = 0; i <
p->num_cells; i++) {
558 fprintf(
p->priv_fp,
"net %d: ", i);
559 while (
p->connect[pr] >= 0) {
560 fprintf(
p->priv_fp,
"(%d %f) ",
p->connect[pr],
p->edge_weight[pr]);
563 fprintf(
p->priv_fp,
"(-1 -1.0)\n");
566 fprintf(
p->priv_fp,
"### (x y f) values\n");
567 for (i = 0; i <
p->num_cells; i++) {
568 fprintf(
p->priv_fp,
"cell %d: (%f %f %d)\n", i,
p->x[i],
p->y[i],
573 fprintf(
p->priv_fp,
"### ga values\n");
574 for (i = 0; i <
p->num_cells; i++) {
575 fprintf(
p->priv_fp,
"cell %d: (%f)\n", i,
p->area[i]);
579 fprintf(
p->priv_fp,
"### gl values\n");
580 for (i = 0; i <
p->cog_num; i++) {
581 fprintf(
p->priv_fp,
"cog %d: ", i);
582 while (
p->cog_list[pr] >= 0) {
583 fprintf(
p->priv_fp,
"%d ",
p->cog_list[pr]);
586 fprintf(
p->priv_fp,
"-1\n");
589 fprintf(
p->priv_fp,
"### (gx gy) values\n");
590 for (i = 0; i <
p->cog_num; i++) {
591 fprintf(
p->priv_fp,
"cog %d: (%f %f)\n", i,
p->cog_x[i],
p->cog_y[i]);
596 p->priv_ii = (
int *)
malloc(
p->num_cells *
sizeof(
int));
605 for (i = 0; i <
p->num_cells; i++) {
606 while ((j =
p->connect[pr]) >= 0) {
615 p->priv_cc = (
int *)
malloc(pw *
sizeof(
int));
617 p->priv_cr = (
int *)
malloc(
p->num_cells *
sizeof(
int));
625 for (i = 0; i <
p->num_cells; i++) {
627 while ((j =
p->connect[pr]) >= 0) {
629 p->priv_cc[pw] =
p->connect[pr];
630 p->priv_ct[pw] =
p->edge_weight[pr];
636 p->priv_ct[pw] = -1.0;
645 p->priv_tp2 =
p->priv_tp + 2 *
p->num_cells;
ABC_NAMESPACE_HEADER_START typedef float qps_float_t
Definition at line 981 of file place_qpsolver.c.
988 #if defined(QPS_PRECON)
993 #if defined(QPS_HOIST)
1003 p->priv_mxh =
p->priv_mxl +
p->num_cells;
1004 p->priv_myl =
p->priv_mxl + 2 *
p->num_cells;
1005 p->priv_myh =
p->priv_mxl + 3 *
p->num_cells;
1006 for (i = 4 *
p->num_cells; i--;) {
1007 p->priv_mxl[i] = 0.0;
1012 for (i =
p->num_cells; i--;) {
1013 p->priv_ii[i] = (
p->fixed[i]) ? (-1) : (0);
1018 p->priv_gt = (
int *)
malloc(
p->cog_num *
sizeof(
int));
1023 for (i = 0; i <
p->cog_num; i++) {
1027 while ((j =
p->cog_list[pr++]) >= 0) {
1030 if (
p->area[j] > bk) {
1038 p->priv_ii[tk] = -2 - i;
1045 for (i = 0; i <
p->cog_num; i++) {
1046 while ((j =
p->cog_list[pr]) >= 0) {
1047 p->priv_gw[pr] =
p->area[j] /
p->priv_gm[i];
1050 p->priv_gw[pr] = -1.0;
1057 for (i =
p->num_cells; i--;) {
1058 if (!
p->priv_ii[i]) {
1059 p->priv_ii[i] = 2 * (
p->priv_n++);
1065 for (i = 0; i <
p->num_cells; i++) {
1066 fprintf(
p->priv_fp,
"### ii %d %d\n", i,
p->priv_ii[i]);
1070 #if defined(QPS_PRECON)
1075 for (i =
p->num_cells; i--;) {
1076 p->priv_pcg[i] = 0.0;
1079 for (i = 0; i <
p->num_cells; i++) {
1080 while ((c =
p->priv_cc[pr]) >= 0) {
1082 p->priv_pcg[i] += t;
1083 p->priv_pcg[c] += t;
1089 for (i = 0; i <
p->loop_num; i++) {
1090 t = 2.0 *
p->loop_penalty[i];
1091 while ((c =
p->loop_list[pr++]) >= 0) {
1092 p->priv_pcg[c] += t;
1097 for (i =
p->num_cells; i--;) {
1098 fprintf(
p->priv_fp,
"### precon %d %.2e\n", i,
p->priv_pcg[i]);
1101 for (i =
p->priv_n; i--;) {
1102 p->priv_pcgt[i] = 0.0;
1104 for (i = 0; i <
p->num_cells; i++) {
1108 p->priv_pcgt[c] += t;
1109 p->priv_pcgt[c + 1] += t;
1113 pr =
p->priv_gt[-(c+2)];
1114 while ((j =
p->cog_list[pr++]) >= 0) {
1117 w =
p->area[j] /
p->area[i];
1118 t = w * w *
p->priv_pcg[i];
1119 p->priv_pcgt[ji] += t;
1120 p->priv_pcgt[ji + 1] += t;
1126 for (i = 0; i <
p->priv_n; i++) {
1127 t =
p->priv_pcgt[i];
1129 p->priv_pcgt[i] = 1.0;
1132 p->priv_pcgt[i] = 1.0 /
p->priv_pcgt[i];
1142 p->priv_g =
p->priv_cp +
p->priv_n;
1143 p->priv_h =
p->priv_cp + 2 *
p->priv_n;
1144 p->priv_xi =
p->priv_cp + 3 *
p->priv_n;
1147 for (i =
p->num_cells; i--;) {
1148 if (
p->priv_ii[i] >= 0) {
1149 p->priv_cp[
p->priv_ii[i]] =
p->x[i];
1150 p->priv_cp[
p->priv_ii[i] + 1] =
p->y[i];
1157 #if defined(QPS_HOIST)
1159 for (i=
p->loop_num; i--;) {
1160 while (
p->loop_list[pr++] >= 0) {
1165 p->priv_la = (
int *)
malloc(pr *
sizeof(
int));
1168 for (i = 0; i <
p->loop_num; i++) {
1169 j = st =
p->loop_list[pr++];
1170 while ((k =
p->loop_list[pr]) >= 0) {
1180 pw =
p->priv_cr[m1];
1181 while (
p->priv_cc[pw] != m2) {
1183 if (
p->priv_cc[pw] < 0) {
1189 p->priv_la[pr-1] = pw;
1202 pw =
p->priv_cr[m1];
1203 while (
p->priv_cc[pw] != m2) {
1205 if (
p->priv_cc[pw] < 0) {
1211 p->priv_la[pr-1] = pw;
1212 p->priv_la[pr] = -1;
1220 }
while (!
p->loop_done || !
p->max_done);
1224 for (i =
p->num_cells; i--;) {
1225 p->x[i] =
p->priv_tp[i * 2];
1226 p->y[i] =
p->priv_tp[i * 2 + 1];
1229 for (i =
p->num_cells; i--;) {
1230 fprintf(
p->priv_fp,
"### cloc %d %f %f\n", i,
p->x[i],
p->y[i]);
1235 if (
p->max_enable) {
1245 #if defined(QPS_HOIST)
1250 #if defined(QPS_PRECON)
static void qps_solve_inner(qps_problem_t *p)
ABC_NAMESPACE_HEADER_START typedef float qps_float_t