libopenfpga/libarchopenfpga/src/check_circuit_library.cpp
/************************************************************************
 * A generic function to check the port list of a circuit model in a given type 
 *  If not found, we give an error
 ***********************************************************************/
A generic function to check the port list of a circuit model in a given type
If not found, we give an error
A generic function to check the port list of a circuit model in a given type If not found we give an error
size_t check_one_circuit_model_port_required(const CircuitLibrary& circuit_lib,
                                             const CircuitModelId& circuit_model, 
                                             const std::vector<enum e_circuit_model_port_type>& port_types_to_check) {
  size_t num_err = 0;
  for (const auto& port_type: port_types_to_check) {
    if (0 == circuit_lib.model_ports_by_type(circuit_model, port_type).size()) {
      VTR_LOG_ERROR("%s circuit model(name=%s) does not have %s port\n",
                    CIRCUIT_MODEL_TYPE_STRING[size_t(circuit_lib.model_type(circuit_model))], 
                    circuit_lib.model_name(circuit_model).c_str(), 
                    CIRCUIT_MODEL_PORT_TYPE_STRING[size_t(port_type)]);
      num_err++;
    }
  }
  return num_err;
}
size_t check_one_circuit_model_port_required ( const CircuitLibrary & circuit_lib , const CircuitModelId & circuit_model , const std :: vector < enum e_circuit_model_port_type > & port_types_to_check ) { size_t num_err = 0 ; for ( const auto & port_type : port_types_to_check ) { if ( 0 == circuit_lib . model_ports_by_type ( circuit_model , port_type ) . size ( ) ) { VTR_LOG_ERROR ( " \n " , CIRCUIT_MODEL_TYPE_STRING [ size_t ( circuit_lib . model_type ( circuit_model ) ) ] , circuit_lib . model_name ( circuit_model ) . c_str ( ) , CIRCUIT_MODEL_PORT_TYPE_STRING [ size_t ( port_type ) ] ) ; num_err ++ ; } } return num_err ; }
A generic function to check the port list of a circuit model in a given type
  If not found, we give an error
A generic function to check the port list of a circuit model in a given type If not found we give an error
/* Incremental the counter for errors */