libopenfpga/libarchopenfpga/src/read_xml_simulation_setting.cpp
/********************************************************************
 * Parse XML codes of a <input> inside <stimulus> to an object of simulation setting
 *******************************************************************/
Parse XML codes of a  inside  to an object of simulation setting
Parse XML codes of a inside to an object of simulation setting
static 
void read_xml_stimulus_input(pugi::xml_node& xml_stimuli_input,
                             const pugiutil::loc_data& loc_data,
                             openfpga::SimulationSetting& sim_setting,
                             const e_sim_signal_type& signal_type) {
  const char* type_attr = get_attribute(xml_stimuli_input, "slew_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_stimuli_input),
                   "Invalid 'type' attribute '%s'\n",
                   type_attr);
  }
  sim_setting.set_stimuli_input_slew_type(signal_type, accuracy_type);
  sim_setting.set_stimuli_input_slew(signal_type, get_attribute(xml_stimuli_input, "slew_time", loc_data).as_float(0.));
  if (SIM_ACCURACY_FRAC == sim_setting.stimuli_input_slew_type(signal_type)) {
    if (false == sim_setting.valid_signal_threshold(sim_setting.stimuli_input_slew(signal_type))) {
      archfpga_throw(loc_data.filename_c_str(), loc_data.line(xml_stimuli_input),
                     "Invalid 'value' attribute '%f', which should be in the range of (0,1)\n",
                     sim_setting.stimuli_input_slew(signal_type));
    }
  }
}
static void read_xml_stimulus_input ( pugi :: xml_node & xml_stimuli_input , const pugiutil :: loc_data & loc_data , openfpga :: SimulationSetting & sim_setting , const e_sim_signal_type & signal_type ) { const char * type_attr = get_attribute ( xml_stimuli_input , " " , 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_stimuli_input ) , " \n " , type_attr ) ; } sim_setting . set_stimuli_input_slew_type ( signal_type , accuracy_type ) ; sim_setting . set_stimuli_input_slew ( signal_type , get_attribute ( xml_stimuli_input , " " , loc_data ) . as_float ( 0. ) ) ; if ( SIM_ACCURACY_FRAC == sim_setting . stimuli_input_slew_type ( signal_type ) ) { if ( false == sim_setting . valid_signal_threshold ( sim_setting . stimuli_input_slew ( signal_type ) ) ) { archfpga_throw ( loc_data . filename_c_str ( ) , loc_data . line ( xml_stimuli_input ) , " \n " , sim_setting . stimuli_input_slew ( signal_type ) ) ; } } }
Parse XML codes of a <input> inside <stimulus> to an object of simulation setting
Parse XML codes of a <input > inside <stimulus > to an object of simulation setting
/* Find the type of accuracy */ /* Translate the type of design technology to enumerate */ /* Validate the accuracy value */