openfpga/src/utils/circuit_library_utils.cpp
/********************************************************************
 * Get the model id of a SRAM model that is used to configure 
 * a circuit model
 *******************************************************************/
Get the model id of a SRAM model that is used to configure
a circuit model
Get the model id of a SRAM model that is used to configure a circuit model
std::vector<CircuitModelId> find_circuit_sram_models(const CircuitLibrary& circuit_lib,
                                                     const CircuitModelId& circuit_model) {
  std::vector<CircuitPortId> sram_ports = circuit_lib.model_ports_by_type(circuit_model, CIRCUIT_MODEL_PORT_SRAM);
  std::vector<CircuitModelId> sram_models;
  for (const auto& sram_port : sram_ports) {
    CircuitModelId sram_model = circuit_lib.port_tri_state_model(sram_port);
    VTR_ASSERT( true == circuit_lib.valid_model_id(sram_model) );
    if (sram_models.end() != std::find(sram_models.begin(), sram_models.end(), sram_model)) {
      continue;  
    }
    sram_models.push_back(sram_model);
  }
  return sram_models;
}
std :: vector < CircuitModelId > find_circuit_sram_models ( const CircuitLibrary & circuit_lib , const CircuitModelId & circuit_model ) { std :: vector < CircuitPortId > sram_ports = circuit_lib . model_ports_by_type ( circuit_model , CIRCUIT_MODEL_PORT_SRAM ) ; std :: vector < CircuitModelId > sram_models ; for ( const auto & sram_port : sram_ports ) { CircuitModelId sram_model = circuit_lib . port_tri_state_model ( sram_port ) ; VTR_ASSERT ( true == circuit_lib . valid_model_id ( sram_model ) ) ; if ( sram_models . end ( ) != std :: find ( sram_models . begin ( ) , sram_models . end ( ) , sram_model ) ) { continue ; } sram_models . push_back ( sram_model ) ; } return sram_models ; }
Get the model id of a SRAM model that is used to configure
 a circuit model
Get the model id of a SRAM model that is used to configure a circuit model
/* SRAM model id is stored in the sram ports of a circuit model */ /* Create a list of sram models, but avoid duplicated model ids */ /* Already in the list, skip the addition */ /* Not in the list, add it */