parameters: (self, params, placedb, pin_pos_op, device)
return_statement: return build_wirelength_op
docstring: @brief compute rectilinear minimum spanning tree wirelength with flute
          @param params parameters
          @param placedb placement database
          @param pin_pos_op the op to compute pin locations according to cell locations
          @param device cpu or cuda
function: def build_rmst_wl(self, params, placedb, pin_pos_op, device):
          """
          @brief compute rectilinear minimum spanning tree wirelength with flute
          @param params parameters
          @param placedb placement database
          @param pin_pos_op the op to compute pin locations according to cell locations
          @param device cpu or cuda
          """
          # wirelength cost
  
          POWVFILE = os.path.abspath(
              os.path.join(os.path.dirname(__file__),
                           "../../thirdparty/NCTUgr.ICCAD2012/POWV9.dat"))
          POSTFILE = os.path.abspath(
              os.path.join(os.path.dirname(__file__),
                           "../../thirdparty/NCTUgr.ICCAD2012/POST9.dat"))
          logging.info("POWVFILE = %s" % (POWVFILE))
          logging.info("POSTFILE = %s" % (POSTFILE))
          wirelength_for_pin_op = rmst_wl.RMSTWL(
              flat_netpin=torch.from_numpy(placedb.flat_net2pin_map).to(device),
              netpin_start=torch.from_numpy(
                  placedb.flat_net2pin_start_map).to(device),
              ignore_net_degree=params.ignore_net_degree,
              POWVFILE=POWVFILE,
              POSTFILE=POSTFILE)
  
          # wirelength for position
          def build_wirelength_op(pos):
              pin_pos = pin_pos_op(pos)
              wls = wirelength_for_pin_op(pin_pos.clone().cpu(),
                                          self.read_lut_flag)
              self.read_lut_flag = False
              return wls
  
          return build_wirelength_op
function_tokens: def build_rmst_wl ( self , params , placedb , pin_pos_op , device ) : # wirelength cost POWVFILE = os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , "../../thirdparty/NCTUgr.ICCAD2012/POWV9.dat" ) ) POSTFILE = os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , "../../thirdparty/NCTUgr.ICCAD2012/POST9.dat" ) ) logging . info ( "POWVFILE = %s" % ( POWVFILE ) ) logging . info ( "POSTFILE = %s" % ( POSTFILE ) ) wirelength_for_pin_op = rmst_wl . RMSTWL ( flat_netpin = torch . from_numpy ( placedb . flat_net2pin_map ) . to ( device ) , netpin_start = torch . from_numpy ( placedb . flat_net2pin_start_map ) . to ( device ) , ignore_net_degree = params . ignore_net_degree , POWVFILE = POWVFILE , POSTFILE = POSTFILE ) # wirelength for position def build_wirelength_op ( pos ) : pin_pos = pin_pos_op ( pos ) wls = wirelength_for_pin_op ( pin_pos . clone ( ) . cpu ( ) , self . read_lut_flag ) self . read_lut_flag = False return wls return build_wirelength_op