libopenfpga/libarchopenfpga/src/check_circuit_library.cpp
/************************************************************************
 *  A generic function to search each default circuit model by types 
 *  that have been defined by users.
 *  If a type of circuit model is defined, we expect there is a default model 
 *  to be specified
 ***********************************************************************/
A generic function to search each default circuit model by types
that have been defined by users.
If a type of circuit model is defined, we expect there is a default model
to be specified
A generic function to search each default circuit model by types that have been defined by users . If a type of circuit model is defined we expect there is a default model to be specified
static 
size_t check_default_circuit_model_by_types(const CircuitLibrary& circuit_lib) {
  size_t num_err = 0;
  for (size_t itype = 0; itype < NUM_CIRCUIT_MODEL_TYPES; ++itype) {
    std::vector<CircuitModelId> curr_models = circuit_lib.models_by_type(e_circuit_model_type(itype));
    if (0 == curr_models.size()) {
       continue;
    }
    size_t found_default_counter = 0;
    for (const auto& curr_model : curr_models) {
      if (true == circuit_lib.model_is_default(curr_model)) {
        found_default_counter++;
      }
    }
    if (0 == found_default_counter) {
      VTR_LOG_ERROR("Miss a default circuit model for the type %s! Try to define it in your architecture file!\n",
                    CIRCUIT_MODEL_TYPE_STRING[itype]);
      num_err++;
    }
    if (1 < found_default_counter) {
      VTR_LOG_ERROR("Found >1 default circuit models for the type %s! Expect only one!\n",
                    CIRCUIT_MODEL_TYPE_STRING[itype]);
      num_err++;
    }
  }
  return num_err;
}
static size_t check_default_circuit_model_by_types ( const CircuitLibrary & circuit_lib ) { size_t num_err = 0 ; for ( size_t itype = 0 ; itype < NUM_CIRCUIT_MODEL_TYPES ; ++ itype ) { std :: vector < CircuitModelId > curr_models = circuit_lib . models_by_type ( e_circuit_model_type ( itype ) ) ; if ( 0 == curr_models . size ( ) ) { continue ; } size_t found_default_counter = 0 ; for ( const auto & curr_model : curr_models ) { if ( true == circuit_lib . model_is_default ( curr_model ) ) { found_default_counter ++ ; } } if ( 0 == found_default_counter ) { VTR_LOG_ERROR ( " \n " , CIRCUIT_MODEL_TYPE_STRING [ itype ] ) ; num_err ++ ; } if ( 1 < found_default_counter ) { VTR_LOG_ERROR ( " \n " , CIRCUIT_MODEL_TYPE_STRING [ itype ] ) ; num_err ++ ; } } return num_err ; }
A generic function to search each default circuit model by types
  that have been defined by users.
A generic function to search each default circuit model by types that have been defined by users .
/* Go through the models and try to find a default one */