libopenfpga/libarchopenfpga/src/read_xml_simulation_setting.cpp
/********************************************************************
 * Parse XML codes of a <clock> line to an object of simulation setting
 *******************************************************************/
Parse XML codes of a  line to an object of simulation setting
Parse XML codes of a line to an object of simulation setting
static 
void read_xml_operating_clock_override_setting(pugi::xml_node& xml_clock_override_setting,
                                               const pugiutil::loc_data& loc_data,
                                               openfpga::SimulationSetting& sim_setting) {
  std::string clock_name = get_attribute(xml_clock_override_setting, "name", loc_data).as_string();
  SimulationClockId clock_id = sim_setting.create_clock(clock_name);
  if (false == sim_setting.valid_clock_id(clock_id)) {
    archfpga_throw(loc_data.filename_c_str(), loc_data.line(xml_clock_override_setting),
                   "Fail to create simulation clock '%s', it may share the same name as other simulation clock definition!\n",
                   clock_name.c_str());
  }
  openfpga::PortParser clock_port_parser(get_attribute(xml_clock_override_setting, "port", loc_data).as_string());
  sim_setting.set_clock_port(clock_id, clock_port_parser.port());
  sim_setting.set_clock_frequency(clock_id, get_attribute(xml_clock_override_setting, "frequency", loc_data).as_float(0.));
}
static void read_xml_operating_clock_override_setting ( pugi :: xml_node & xml_clock_override_setting , const pugiutil :: loc_data & loc_data , openfpga :: SimulationSetting & sim_setting ) { std :: string clock_name = get_attribute ( xml_clock_override_setting , " " , loc_data ) . as_string ( ) ; SimulationClockId clock_id = sim_setting . create_clock ( clock_name ) ; if ( false == sim_setting . valid_clock_id ( clock_id ) ) { archfpga_throw ( loc_data . filename_c_str ( ) , loc_data . line ( xml_clock_override_setting ) , " \n " , clock_name . c_str ( ) ) ; } openfpga :: PortParser clock_port_parser ( get_attribute ( xml_clock_override_setting , " " , loc_data ) . as_string ( ) ) ; sim_setting . set_clock_port ( clock_id , clock_port_parser . port ( ) ) ; sim_setting . set_clock_frequency ( clock_id , get_attribute ( xml_clock_override_setting , " " , loc_data ) . as_float ( 0. ) ) ; }
Parse XML codes of a <clock> line to an object of simulation setting
Parse XML codes of a <clock > line to an object of simulation setting
/* Create a new clock override object in the sim_setting object with the given name */ /* Report if the clock creation failed, this is due to a conflicts in naming*/ /* Parse port information */ /* Parse frequency information */