libopenfpga/libarchopenfpga/src/read_xml_simulation_setting.cpp
/********************************************************************
 * Parse XML codes of a <simulator_option> to an object of simulation setting
 *******************************************************************/
Parse XML codes of a  to an object of simulation setting
Parse XML codes of a to an object of simulation setting
static 
void read_xml_simulator_option(pugi::xml_node& xml_sim_option,
                               const pugiutil::loc_data& loc_data,
                               openfpga::SimulationSetting& sim_setting) {
  pugi::xml_node xml_operating_condition = get_single_child(xml_sim_option, "operating_condition", loc_data);
  sim_setting.set_simulation_temperature(get_attribute(xml_operating_condition, "temperature", loc_data).as_float(0.));
  pugi::xml_node xml_output_log = get_single_child(xml_sim_option, "output_log", loc_data);
  sim_setting.set_verbose_output(get_attribute(xml_output_log, "verbose", loc_data).as_bool(false));
  sim_setting.set_capacitance_output(get_attribute(xml_output_log, "captab", loc_data).as_bool(false));
  pugi::xml_node xml_accuracy = get_single_child(xml_sim_option, "accuracy", loc_data);
  const char* type_attr = get_attribute(xml_accuracy, "type", loc_data).value();
  e_sim_accuracy_type accuracy_type = string_to_sim_accuracy_type(std::string(type_attr));
  if (NUM_SIM_ACCURACY_TYPES == accuracy_type) {
    archfpga_throw(loc_data.filename_c_str(), loc_data.line(xml_accuracy),
                   "Invalid 'type' attribute '%s'\n",
                   type_attr);
  }
  sim_setting.set_simulation_accuracy_type(accuracy_type);
  sim_setting.set_simulation_accuracy(get_attribute(xml_accuracy, "value", loc_data).as_float(0.));
  if (SIM_ACCURACY_FRAC == sim_setting.simulation_accuracy_type()) {
    if (false == sim_setting.valid_signal_threshold(sim_setting.simulation_accuracy())) {
      archfpga_throw(loc_data.filename_c_str(), loc_data.line(xml_accuracy),
                     "Invalid 'value' attribute '%f', which should be in the range of (0,1)\n",
                     sim_setting.simulation_accuracy());
    }
  }
  pugi::xml_node xml_runtime = get_single_child(xml_sim_option, "runtime", loc_data);
  sim_setting.set_fast_simulation(get_attribute(xml_runtime, "fast_simulation", loc_data).as_bool(false));
}
static void read_xml_simulator_option ( pugi :: xml_node & xml_sim_option , const pugiutil :: loc_data & loc_data , openfpga :: SimulationSetting & sim_setting ) { pugi :: xml_node xml_operating_condition = get_single_child ( xml_sim_option , " " , loc_data ) ; sim_setting . set_simulation_temperature ( get_attribute ( xml_operating_condition , " " , loc_data ) . as_float ( 0. ) ) ; pugi :: xml_node xml_output_log = get_single_child ( xml_sim_option , " " , loc_data ) ; sim_setting . set_verbose_output ( get_attribute ( xml_output_log , " " , loc_data ) . as_bool ( false ) ) ; sim_setting . set_capacitance_output ( get_attribute ( xml_output_log , " " , loc_data ) . as_bool ( false ) ) ; pugi :: xml_node xml_accuracy = get_single_child ( xml_sim_option , " " , loc_data ) ; const char * type_attr = get_attribute ( xml_accuracy , " " , loc_data ) . value ( ) ; e_sim_accuracy_type accuracy_type = string_to_sim_accuracy_type ( std :: string ( type_attr ) ) ; if ( NUM_SIM_ACCURACY_TYPES == accuracy_type ) { archfpga_throw ( loc_data . filename_c_str ( ) , loc_data . line ( xml_accuracy ) , " \n " , type_attr ) ; } sim_setting . set_simulation_accuracy_type ( accuracy_type ) ; sim_setting . set_simulation_accuracy ( get_attribute ( xml_accuracy , " " , loc_data ) . as_float ( 0. ) ) ; if ( SIM_ACCURACY_FRAC == sim_setting . simulation_accuracy_type ( ) ) { if ( false == sim_setting . valid_signal_threshold ( sim_setting . simulation_accuracy ( ) ) ) { archfpga_throw ( loc_data . filename_c_str ( ) , loc_data . line ( xml_accuracy ) , " \n " , sim_setting . simulation_accuracy ( ) ) ; } } pugi :: xml_node xml_runtime = get_single_child ( xml_sim_option , " " , loc_data ) ; sim_setting . set_fast_simulation ( get_attribute ( xml_runtime , " " , loc_data ) . as_bool ( false ) ) ; }
Parse XML codes of a <simulator_option> to an object of simulation setting
Parse XML codes of a <simulator_option > to an object of simulation setting
/* Find the type of accuracy */ /* Translate the type of design technology to enumerate */ /* Validate the accuracy value */