libopenfpga/libarchopenfpga/src/read_xml_technology_library.cpp
/********************************************************************
 * Parse XML codes about <technology_library> to an object of technology library
 *******************************************************************/
Parse XML codes about  to an object of technology library
Parse XML codes about to an object of technology library
TechnologyLibrary read_xml_technology_library(pugi::xml_node& Node,
                                              const pugiutil::loc_data& loc_data) {
  TechnologyLibrary tech_lib;
  size_t num_device_lib = count_children(Node, "device_library", loc_data);
  if (1 != num_device_lib) {
    archfpga_throw(loc_data.filename_c_str(), loc_data.line(Node),
                   "Expect only 1 <device_library> defined under <technology_library>");
  }
  pugi::xml_node xml_device_lib = get_first_child(Node, "device_library", loc_data);
  read_xml_device_lib(xml_device_lib, loc_data, tech_lib);
  size_t num_variation_lib = count_children(Node, "variation_library", loc_data);
  if (1 != num_variation_lib) {
    archfpga_throw(loc_data.filename_c_str(), loc_data.line(Node),
                   "Expect only 1 <variation_library> defined under <technology_library>");
  }
  pugi::xml_node xml_variation_lib = get_first_child(Node, "variation_library", loc_data);
  read_xml_variation_lib(xml_variation_lib, loc_data, tech_lib);
  return tech_lib;
}
TechnologyLibrary read_xml_technology_library ( pugi :: xml_node & Node , const pugiutil :: loc_data & loc_data ) { TechnologyLibrary tech_lib ; size_t num_device_lib = count_children ( Node , " " , loc_data ) ; if ( 1 != num_device_lib ) { archfpga_throw ( loc_data . filename_c_str ( ) , loc_data . line ( Node ) , " " ) ; } pugi :: xml_node xml_device_lib = get_first_child ( Node , " " , loc_data ) ; read_xml_device_lib ( xml_device_lib , loc_data , tech_lib ) ; size_t num_variation_lib = count_children ( Node , " " , loc_data ) ; if ( 1 != num_variation_lib ) { archfpga_throw ( loc_data . filename_c_str ( ) , loc_data . line ( Node ) , " " ) ; } pugi :: xml_node xml_variation_lib = get_first_child ( Node , " " , loc_data ) ; read_xml_variation_lib ( xml_variation_lib , loc_data , tech_lib ) ; return tech_lib ; }
Parse XML codes about <technology_library> to an object of technology library
Parse XML codes about <technology_library > to an object of technology library
/* Iterate over the children under this node,
   * There should be only two child nodes
   * 1. device_library
   * 2. variation_library
   */