abc/src/phys/place/place_gordian.c
// --------------------------------------------------------------------
// sanitizePlacement()
//
/// \brief Moves any cells that are outside of the core bounds to the nearest location within.
//
// --------------------------------------------------------------------
sanitizePlacement()
\brief Moves any cells that are outside of the core bounds to the nearest location within.
sanitizePlacement () \ brief Moves any cells that are outside of the core bounds to the nearest location within .
void sanitizePlacement() { 
  int c;
  float order_width = g_place_rowHeight;
  float x, y, edge, w, h;
  printf("QCLN-10 : \tsanitizing placement\n");
  for(c=0; c<g_place_numCells; c++) if (g_place_concreteCells[c]) {
    ConcreteCell *cell = g_place_concreteCells[c];
    if (cell->m_fixed || cell->m_parent->m_pad) {
      continue;
    }
    order_width = g_place_rowHeight;
    x = cell->m_x, y = cell->m_y,
      w = cell->m_parent->m_width, h = cell->m_parent->m_height;
    if ((edge=x-w*0.5) < g_place_coreBounds.x) {
      x = g_place_coreBounds.x+w*0.5 +
        order_width/(1.0+g_place_coreBounds.x-edge);
    }
    else if ((edge=x+w*0.5) > g_place_coreBounds.x+g_place_coreBounds.w) {
      x = g_place_coreBounds.x+g_place_coreBounds.w-w*0.5 -
        order_width/(1.0+edge-g_place_coreBounds.x-g_place_coreBounds.w);
    }
    if ((edge=y-h*0.5) < g_place_coreBounds.y) {
      y = g_place_coreBounds.y+h*0.5 +
        order_width/(1.0+g_place_coreBounds.y-edge);
    }
    else if ((edge=y+h*0.5) > g_place_coreBounds.y+g_place_coreBounds.h) {
      y = g_place_coreBounds.y+g_place_coreBounds.h-h*0.5 -
        order_width/(1.0+edge-g_place_coreBounds.x-g_place_coreBounds.w);
    }
    cell->m_x = x;
    cell->m_y = y;
  }
}
void sanitizePlacement ( ) { int c ; float order_width = g_place_rowHeight ; float x , y , edge , w , h ; printf ( " \t \n " ) ; for ( c = 0 ; c < g_place_numCells ; c ++ ) if ( g_place_concreteCells [ c ] ) { ConcreteCell * cell = g_place_concreteCells [ c ] ; if ( cell -> m_fixed || cell -> m_parent -> m_pad ) { continue ; } order_width = g_place_rowHeight ; x = cell -> m_x , y = cell -> m_y , w = cell -> m_parent -> m_width , h = cell -> m_parent -> m_height ; if ( ( edge = x - w * 0.5 ) < g_place_coreBounds . x ) { x = g_place_coreBounds . x + w * 0.5 + order_width / ( 1.0 + g_place_coreBounds . x - edge ) ; } else if ( ( edge = x + w * 0.5 ) > g_place_coreBounds . x + g_place_coreBounds . w ) { x = g_place_coreBounds . x + g_place_coreBounds . w - w * 0.5 - order_width / ( 1.0 + edge - g_place_coreBounds . x - g_place_coreBounds . w ) ; } if ( ( edge = y - h * 0.5 ) < g_place_coreBounds . y ) { y = g_place_coreBounds . y + h * 0.5 + order_width / ( 1.0 + g_place_coreBounds . y - edge ) ; } else if ( ( edge = y + h * 0.5 ) > g_place_coreBounds . y + g_place_coreBounds . h ) { y = g_place_coreBounds . y + g_place_coreBounds . h - h * 0.5 - order_width / ( 1.0 + edge - g_place_coreBounds . x - g_place_coreBounds . w ) ; } cell -> m_x = x ; cell -> m_y = y ; } }
sanitizePlacement()
\brief Moves any cells that are outside of the core bounds to the nearest location within.
sanitizePlacement () \ brief Moves any cells that are outside of the core bounds to the nearest location within .
// the new locations of the cells will be distributed within // a small margin inside the border so that ordering is preserved