libopenfpga/libarchopenfpga/src/openfpga_arch_linker.cpp
/********************************************************************
 * Link the circuit model of circuit library
 * to these device model defined in technology library
 *******************************************************************/
Link the circuit model of circuit library
to these device model defined in technology library
Link the circuit model of circuit library to these device model defined in technology library
void bind_circuit_model_to_technology_model(openfpga::Arch& openfpga_arch) {
  openfpga_arch.circuit_tech_binding.clear();
  for (const CircuitModelId& circuit_model : openfpga_arch.circuit_lib.models()) {
    const std::string device_model_name = openfpga_arch.circuit_lib.device_model_name(circuit_model);
    if (true == device_model_name.empty()) {
      continue;
    }
    TechnologyModelId tech_model = openfpga_arch.tech_lib.model(device_model_name);
    if (false == openfpga_arch.tech_lib.valid_model_id(tech_model)) {
      VTR_LOG("Invalid device model name '%s' defined in circuit model '%s'!",
              device_model_name.c_str(),
              openfpga_arch.circuit_lib.model_name(circuit_model).c_str());
      exit(1);
    }
    openfpga_arch.circuit_tech_binding[circuit_model] = tech_model;
  }
}
void bind_circuit_model_to_technology_model ( openfpga :: Arch & openfpga_arch ) { openfpga_arch . circuit_tech_binding . clear ( ) ; for ( const CircuitModelId & circuit_model : openfpga_arch . circuit_lib . models ( ) ) { const std :: string device_model_name = openfpga_arch . circuit_lib . device_model_name ( circuit_model ) ; if ( true == device_model_name . empty ( ) ) { continue ; } TechnologyModelId tech_model = openfpga_arch . tech_lib . model ( device_model_name ) ; if ( false == openfpga_arch . tech_lib . valid_model_id ( tech_model ) ) { VTR_LOG ( " " , device_model_name . c_str ( ) , openfpga_arch . circuit_lib . model_name ( circuit_model ) . c_str ( ) ) ; exit ( 1 ) ; } openfpga_arch . circuit_tech_binding [ circuit_model ] = tech_model ; } }
Link the circuit model of circuit library
 to these device model defined in technology library
Link the circuit model of circuit library to these device model defined in technology library
/* Ensure a clean start */ /* Try to find the device model name in technology library */ /* Create binding */