vpr7_x2p/libarchfpgavpr7/SRC/circuit_library_utils.cpp
/********************************************************************
 * A generic function to find all the global ports in a circuit library
 * 
 * IMPORTANT: This function will uniquify the global ports whose share 
 * share the same name !!!
 *******************************************************************/
A generic function to find all the global ports in a circuit library

This function will uniquify the global ports whose share
share the same name
A generic function to find all the global ports in a circuit library This function will uniquify the global ports whose share share the same name
std::vector<CircuitPortId> find_circuit_library_global_ports(const CircuitLibrary& circuit_lib) {
  std::vector<CircuitPortId> global_ports;
  for (auto port : circuit_lib.ports()) {
    if (false == circuit_lib.port_is_global(port)) {
      continue;
    }
    bool add_to_list = true;
    for (const auto& global_port : global_ports) {
      if (0 == circuit_lib.port_prefix(port).compare(circuit_lib.port_prefix(global_port))) {
        add_to_list = false;
        break;
      }
    }
    if (true == add_to_list) {
      global_ports.push_back(port);
    }
  } 
  return global_ports;
}
std :: vector < CircuitPortId > find_circuit_library_global_ports ( const CircuitLibrary & circuit_lib ) { std :: vector < CircuitPortId > global_ports ; for ( auto port : circuit_lib . ports ( ) ) { if ( false == circuit_lib . port_is_global ( port ) ) { continue ; } bool add_to_list = true ; for ( const auto & global_port : global_ports ) { if ( 0 == circuit_lib . port_prefix ( port ) . compare ( circuit_lib . port_prefix ( global_port ) ) ) { add_to_list = false ; break ; } } if ( true == add_to_list ) { global_ports . push_back ( port ) ; } } return global_ports ; }
A generic function to find all the global ports in a circuit library
A generic function to find all the global ports in a circuit library
/* By pass non-global ports*/ /* Check if a same port with the same name has already been in the list */ /* Same name, skip list update */ /* Add the global_port to the list */