openfpga/src/fabric/build_top_module_utils.cpp
/********************************************************************
 * Find the GSB coordinate for a CB in the top-level module 
 * depending on the side of a SB
 * TODO: use vtr::Point<size_t> to replace DeviceCoordinator
 *******************************************************************/
Find the GSB coordinate for a CB in the top-level module
depending on the side of a SB
TODO: use vtr::Point to replace DeviceCoordinator
Find the GSB coordinate for a CB in the top - level module depending on the side of a SB TODO : use vtr :: Point to replace DeviceCoordinator
vtr::Point<size_t> find_top_module_gsb_coordinate_by_sb_side(const RRGSB& rr_gsb,
                                                             const e_side& sb_side) {
  VTR_ASSERT(NUM_SIDES != sb_side);
  vtr::Point<size_t> gsb_coordinate;
  if ((TOP == sb_side) || (LEFT == sb_side)) {
    gsb_coordinate.set_x(rr_gsb.get_x()); 
    gsb_coordinate.set_y(rr_gsb.get_y()); 
    return gsb_coordinate;
  }
  VTR_ASSERT((RIGHT == sb_side) || (BOTTOM == sb_side));
  if (RIGHT == sb_side) {
    gsb_coordinate.set_x(rr_gsb.get_x() + 1); 
    gsb_coordinate.set_y(rr_gsb.get_y()); 
  }
  if (BOTTOM == sb_side) {
    gsb_coordinate.set_x(rr_gsb.get_x()); 
    gsb_coordinate.set_y(rr_gsb.get_y() - 1); 
  }
  return gsb_coordinate;
}
vtr :: Point < size_t > find_top_module_gsb_coordinate_by_sb_side ( const RRGSB & rr_gsb , const e_side & sb_side ) { VTR_ASSERT ( NUM_SIDES != sb_side ) ; vtr :: Point < size_t > gsb_coordinate ; if ( ( TOP == sb_side ) || ( LEFT == sb_side ) ) { gsb_coordinate . set_x ( rr_gsb . get_x ( ) ) ; gsb_coordinate . set_y ( rr_gsb . get_y ( ) ) ; return gsb_coordinate ; } VTR_ASSERT ( ( RIGHT == sb_side ) || ( BOTTOM == sb_side ) ) ; if ( RIGHT == sb_side ) { gsb_coordinate . set_x ( rr_gsb . get_x ( ) + 1 ) ; gsb_coordinate . set_y ( rr_gsb . get_y ( ) ) ; } if ( BOTTOM == sb_side ) { gsb_coordinate . set_x ( rr_gsb . get_x ( ) ) ; gsb_coordinate . set_y ( rr_gsb . get_y ( ) - 1 ) ; } return gsb_coordinate ; }
Find the GSB coordinate for a CB in the top-level module
 depending on the side of a SB
 TODO: use vtr::Point<size_t> to replace DeviceCoordinator
Find the GSB coordinate for a CB in the top - level module depending on the side of a SB TODO : use vtr :: Point<size_t > to replace DeviceCoordinator
/* RIGHT side: x + 1 */ /* BOTTOM side: y - 1 */