libopenfpga/libarchopenfpga/src/read_xml_config_protocol.cpp
/********************************************************************
 * Parse XML codes of a <organization> to an object of configuration protocol
 *******************************************************************/
Parse XML codes of a  to an object of configuration protocol
Parse XML codes of a to an object of configuration protocol
static 
void read_xml_config_organization(pugi::xml_node& xml_config_orgz,
                                  const pugiutil::loc_data& loc_data,
                                  ConfigProtocol& config_protocol) {
  const char* type_attr = get_attribute(xml_config_orgz, "type", loc_data).value();
  e_config_protocol_type config_orgz_type = string_to_config_protocol_type(std::string(type_attr));
  if (NUM_CONFIG_PROTOCOL_TYPES == config_orgz_type) {
    archfpga_throw(loc_data.filename_c_str(), loc_data.line(xml_config_orgz),
                   "Invalid 'type' attribute '%s'\n",
                   type_attr);
  }
  config_protocol.set_type(config_orgz_type);
  config_protocol.set_memory_model_name(get_attribute(xml_config_orgz, "circuit_model_name", loc_data).as_string());
  config_protocol.set_num_regions(get_attribute(xml_config_orgz, "num_regions", loc_data, pugiutil::ReqOpt::OPTIONAL).as_int(1));
  if (1 > config_protocol.num_regions()) {
    archfpga_throw(loc_data.filename_c_str(), loc_data.line(xml_config_orgz),
                   "Invalid 'num_region=%d' definition. At least 1 region should be defined!\n",
                   config_protocol.num_regions());
  }
}
static void read_xml_config_organization ( pugi :: xml_node & xml_config_orgz , const pugiutil :: loc_data & loc_data , ConfigProtocol & config_protocol ) { const char * type_attr = get_attribute ( xml_config_orgz , " " , loc_data ) . value ( ) ; e_config_protocol_type config_orgz_type = string_to_config_protocol_type ( std :: string ( type_attr ) ) ; if ( NUM_CONFIG_PROTOCOL_TYPES == config_orgz_type ) { archfpga_throw ( loc_data . filename_c_str ( ) , loc_data . line ( xml_config_orgz ) , " \n " , type_attr ) ; } config_protocol . set_type ( config_orgz_type ) ; config_protocol . set_memory_model_name ( get_attribute ( xml_config_orgz , " " , loc_data ) . as_string ( ) ) ; config_protocol . set_num_regions ( get_attribute ( xml_config_orgz , " " , loc_data , pugiutil :: ReqOpt :: OPTIONAL ) . as_int ( 1 ) ) ; if ( 1 > config_protocol . num_regions ( ) ) { archfpga_throw ( loc_data . filename_c_str ( ) , loc_data . line ( xml_config_orgz ) , " \n " , config_protocol . num_regions ( ) ) ; } }
Parse XML codes of a <organization> to an object of configuration protocol
Parse XML codes of a <organization > to an object of configuration protocol
/* Find the type of configuration protocol */ /* Translate the type of design technology to enumerate */ /* Find the circuit model used by the configuration protocol */ /* Parse the number of configurable regions
   * At least 1 region should be defined, otherwise error out 
   */