openfpga/src/utils/circuit_library_utils.cpp
/********************************************************************
 * A generic function to find all the unique user-defined
 * Verilog netlists in a circuit library
 * Netlists with same names will be considered as one
 *******************************************************************/
A generic function to find all the unique user-defined
Verilog netlists in a circuit library
Netlists with same names will be considered as one
A generic function to find all the unique user - defined Verilog netlists in a circuit library Netlists with same names will be considered as one
std::vector<std::string> find_circuit_library_unique_spice_netlists(const CircuitLibrary& circuit_lib) {
  std::vector<std::string> netlists;
  for (const CircuitModelId& model : circuit_lib.models()) {
    if (true == circuit_lib.model_spice_netlist(model).empty()) {
      continue;
    }
    std::vector<std::string>::iterator it = std::find(netlists.begin(), netlists.end(), circuit_lib.model_spice_netlist(model));
    if (it == netlists.end()) {
      netlists.push_back(circuit_lib.model_spice_netlist(model));
    }
  }
 return netlists;
}
std :: vector < std :: string > find_circuit_library_unique_spice_netlists ( const CircuitLibrary & circuit_lib ) { std :: vector < std :: string > netlists ; for ( const CircuitModelId & model : circuit_lib . models ( ) ) { if ( true == circuit_lib . model_spice_netlist ( model ) . empty ( ) ) { continue ; } std :: vector < std :: string > :: iterator it = std :: find ( netlists . begin ( ) , netlists . end ( ) , circuit_lib . model_spice_netlist ( model ) ) ; if ( it == netlists . end ( ) ) { netlists . push_back ( circuit_lib . model_spice_netlist ( model ) ) ; } } return netlists ; }
A generic function to find all the unique user-defined
 Verilog netlists in a circuit library
 Netlists with same names will be considered as one
A generic function to find all the unique user - defined Verilog netlists in a circuit library Netlists with same names will be considered as one
/* Skip empty netlist names */ /* See if the netlist name is already in the list */