parameters: (self, params, placedb, data_collections,
                                   num_bins_x, num_bins_y, name, region_id=None, fence_regions=None)
return_statement: return electric_potential.ElectricPotential(
              node_size_x=data_collections.node_size_x,
              node_size_y=data_collections.node_size_y,
              bin_center_x=data_collections.bin_center_x_padded(placedb, 0, num_bins_x),
              bin_center_y=data_collections.bin_center_y_padded(placedb, 0, num_bins_y),
              target_density=target_density,
              xl=placedb.xl,
              yl=placedb.yl,
              xh=placedb.xh,
              yh=placedb.yh,
              bin_size_x=bin_size_x,
              bin_size_y=bin_size_y,
              num_movable_nodes=placedb.num_movable_nodes,
              num_terminals=placedb.num_terminals,
              num_filler_nodes=placedb.num_filler_nodes,
              padding=0,
              deterministic_flag=params.deterministic_flag,
              sorted_node_map=data_collections.sorted_node_map,
              movable_macro_mask=data_collections.movable_macro_mask,
              fast_mode=params.RePlAce_skip_energy_flag,
              region_id=region_id,
              fence_regions=fence_regions,
              node2fence_region_map=data_collections.node2fence_region_map,
              placedb=placedb)
docstring: @brief e-place electrostatic potential
          @param params parameters
          @param placedb placement database
          @param data_collections a collection of data and variables required for constructing ops
          @param num_bins_x number of bins in horizontal direction
          @param num_bins_y number of bins in vertical direction
          @param name string for printing
          @param fence_regions a [n_subregions, 4] tensor for fence regions potential penalty
function: def build_electric_potential(self, params, placedb, data_collections,
                                   num_bins_x, num_bins_y, name, region_id=None, fence_regions=None):
          """
          @brief e-place electrostatic potential
          @param params parameters
          @param placedb placement database
          @param data_collections a collection of data and variables required for constructing ops
          @param num_bins_x number of bins in horizontal direction
          @param num_bins_y number of bins in vertical direction
          @param name string for printing
          @param fence_regions a [n_subregions, 4] tensor for fence regions potential penalty
          """
          bin_size_x = (placedb.xh - placedb.xl) / num_bins_x
          bin_size_y = (placedb.yh - placedb.yl) / num_bins_y
  
          max_num_bins_x = np.ceil(
              (np.amax(placedb.node_size_x[0:placedb.num_movable_nodes]) +
               2 * bin_size_x) / bin_size_x)
          max_num_bins_y = np.ceil(
              (np.amax(placedb.node_size_y[0:placedb.num_movable_nodes]) +
               2 * bin_size_y) / bin_size_y)
          max_num_bins = max(int(max_num_bins_x), int(max_num_bins_y))
          logging.info(
              "%s #bins %dx%d, bin sizes %gx%g, max_num_bins = %d, padding = %d"
              % (name, num_bins_x, num_bins_y,
                 bin_size_x / placedb.row_height,
                 bin_size_y / placedb.row_height, max_num_bins, 0))
          if num_bins_x < max_num_bins:
              logging.warning("num_bins_x (%d) < max_num_bins (%d)" %
                              (num_bins_x, max_num_bins))
          if num_bins_y < max_num_bins:
              logging.warning("num_bins_y (%d) < max_num_bins (%d)" %
                              (num_bins_y, max_num_bins))
          #### for fence region, the target density is different from different regions
          target_density = data_collections.target_density.item() if fence_regions is None else placedb.target_density_fence_region[region_id]
          return electric_potential.ElectricPotential(
              node_size_x=data_collections.node_size_x,
              node_size_y=data_collections.node_size_y,
              bin_center_x=data_collections.bin_center_x_padded(placedb, 0, num_bins_x),
              bin_center_y=data_collections.bin_center_y_padded(placedb, 0, num_bins_y),
              target_density=target_density,
              xl=placedb.xl,
              yl=placedb.yl,
              xh=placedb.xh,
              yh=placedb.yh,
              bin_size_x=bin_size_x,
              bin_size_y=bin_size_y,
              num_movable_nodes=placedb.num_movable_nodes,
              num_terminals=placedb.num_terminals,
              num_filler_nodes=placedb.num_filler_nodes,
              padding=0,
              deterministic_flag=params.deterministic_flag,
              sorted_node_map=data_collections.sorted_node_map,
              movable_macro_mask=data_collections.movable_macro_mask,
              fast_mode=params.RePlAce_skip_energy_flag,
              region_id=region_id,
              fence_regions=fence_regions,
              node2fence_region_map=data_collections.node2fence_region_map,
              placedb=placedb)
function_tokens: def build_electric_potential ( self , params , placedb , data_collections , num_bins_x , num_bins_y , name , region_id = None , fence_regions = None ) : bin_size_x = ( placedb . xh - placedb . xl ) / num_bins_x bin_size_y = ( placedb . yh - placedb . yl ) / num_bins_y max_num_bins_x = np . ceil ( ( np . amax ( placedb . node_size_x [ 0 : placedb . num_movable_nodes ] ) + 2 * bin_size_x ) / bin_size_x ) max_num_bins_y = np . ceil ( ( np . amax ( placedb . node_size_y [ 0 : placedb . num_movable_nodes ] ) + 2 * bin_size_y ) / bin_size_y ) max_num_bins = max ( int ( max_num_bins_x ) , int ( max_num_bins_y ) ) logging . info ( "%s #bins %dx%d, bin sizes %gx%g, max_num_bins = %d, padding = %d" % ( name , num_bins_x , num_bins_y , bin_size_x / placedb . row_height , bin_size_y / placedb . row_height , max_num_bins , 0 ) ) if num_bins_x < max_num_bins : logging . warning ( "num_bins_x (%d) < max_num_bins (%d)" % ( num_bins_x , max_num_bins ) ) if num_bins_y < max_num_bins : logging . warning ( "num_bins_y (%d) < max_num_bins (%d)" % ( num_bins_y , max_num_bins ) ) #### for fence region, the target density is different from different regions target_density = data_collections . target_density . item ( ) if fence_regions is None else placedb . target_density_fence_region [ region_id ] return electric_potential . ElectricPotential ( node_size_x = data_collections . node_size_x , node_size_y = data_collections . node_size_y , bin_center_x = data_collections . bin_center_x_padded ( placedb , 0 , num_bins_x ) , bin_center_y = data_collections . bin_center_y_padded ( placedb , 0 , num_bins_y ) , target_density = target_density , xl = placedb . xl , yl = placedb . yl , xh = placedb . xh , yh = placedb . yh , bin_size_x = bin_size_x , bin_size_y = bin_size_y , num_movable_nodes = placedb . num_movable_nodes , num_terminals = placedb . num_terminals , num_filler_nodes = placedb . num_filler_nodes , padding = 0 , deterministic_flag = params . deterministic_flag , sorted_node_map = data_collections . sorted_node_map , movable_macro_mask = data_collections . movable_macro_mask , fast_mode = params . RePlAce_skip_energy_flag , region_id = region_id , fence_regions = fence_regions , node2fence_region_map = data_collections . node2fence_region_map , placedb = placedb )