libopenfpga/libarchopenfpga/src/write_xml_simulation_setting.cpp
/********************************************************************
 * A writer to output a clock setting in a simulation setting to XML format
 *******************************************************************/
A writer to output a clock setting in a simulation setting to XML format
A writer to output a clock setting in a simulation setting to XML format
static 
void write_xml_clock_setting(std::fstream& fp,
                             const char* fname,
                             const openfpga::SimulationSetting& sim_setting) {
  openfpga::check_file_stream(fname, fp);
  fp << "\t" << "<clock_setting>" << "\n";
  fp << "\t\t" << "<operating";
  write_xml_attribute(fp, "frequency", sim_setting.default_operating_clock_frequency());
  if (true == sim_setting.auto_select_num_clock_cycles()) {
    write_xml_attribute(fp, "num_cycles", "auto");
  } else {
    VTR_ASSERT_SAFE(false == sim_setting.auto_select_num_clock_cycles());
    write_xml_attribute(fp, "num_cycles", std::to_string(sim_setting.num_clock_cycles()).c_str());
  }
  write_xml_attribute(fp, "slack", std::to_string(sim_setting.operating_clock_frequency_slack()).c_str());
  fp << ">" << "\n";
  for (const SimulationClockId& clock_id : sim_setting.clocks()) {
    fp << "\t\t\t" << "<clock";
    write_xml_attribute(fp, "name", sim_setting.clock_name(clock_id).c_str());
    write_xml_attribute(fp, "port", generate_xml_port_name(sim_setting.clock_port(clock_id)).c_str());
    write_xml_attribute(fp, "frequency", std::to_string(sim_setting.clock_frequency(clock_id)).c_str());
    fp << ">" << "\n";
  }
  fp << "\t\t" << "</operating";
  fp << ">" << "\n";
  fp << "\t\t" << "<operating";
  write_xml_attribute(fp, "frequency", sim_setting.programming_clock_frequency());
  fp << "/>" << "\n";
  fp << "\t" << "</clock_setting>" << "\n";
}
static void write_xml_clock_setting ( std :: fstream & fp , const char * fname , const openfpga :: SimulationSetting & sim_setting ) { openfpga :: check_file_stream ( fname , fp ) ; fp << " \t " << " " << " \n " ; fp << " \t \t " << " " ; write_xml_attribute ( fp , " " , sim_setting . default_operating_clock_frequency ( ) ) ; if ( true == sim_setting . auto_select_num_clock_cycles ( ) ) { write_xml_attribute ( fp , " " , " " ) ; } else { VTR_ASSERT_SAFE ( false == sim_setting . auto_select_num_clock_cycles ( ) ) ; write_xml_attribute ( fp , " " , std :: to_string ( sim_setting . num_clock_cycles ( ) ) . c_str ( ) ) ; } write_xml_attribute ( fp , " " , std :: to_string ( sim_setting . operating_clock_frequency_slack ( ) ) . c_str ( ) ) ; fp << " " << " \n " ; for ( const SimulationClockId & clock_id : sim_setting . clocks ( ) ) { fp << " \t \t \t " << " " ; write_xml_attribute ( fp , " " , sim_setting . clock_name ( clock_id ) . c_str ( ) ) ; write_xml_attribute ( fp , " " , generate_xml_port_name ( sim_setting . clock_port ( clock_id ) ) . c_str ( ) ) ; write_xml_attribute ( fp , " " , std :: to_string ( sim_setting . clock_frequency ( clock_id ) ) . c_str ( ) ) ; fp << " " << " \n " ; } fp << " \t \t " << " " ; fp << " " << " \n " ; fp << " \t \t " << " " ; write_xml_attribute ( fp , " " , sim_setting . programming_clock_frequency ( ) ) ; fp << " " << " \n " ; fp << " \t " << " " << " \n " ; }
A writer to output a clock setting in a simulation setting to XML format
A writer to output a clock setting in a simulation setting to XML format
/* Validate the file stream */ /* Output clock information one by one */