54 #include "config_HAVE_FROM_C_BUILT.hpp" 55 #include "config_HAVE_I386_CLANG10_COMPILER.hpp" 56 #include "config_HAVE_I386_CLANG11_COMPILER.hpp" 57 #include "config_HAVE_I386_CLANG12_COMPILER.hpp" 58 #include "config_HAVE_I386_CLANG13_COMPILER.hpp" 59 #include "config_HAVE_I386_CLANG16_COMPILER.hpp" 60 #include "config_HAVE_I386_CLANG4_COMPILER.hpp" 61 #include "config_HAVE_I386_CLANG5_COMPILER.hpp" 62 #include "config_HAVE_I386_CLANG6_COMPILER.hpp" 63 #include "config_HAVE_I386_CLANG7_COMPILER.hpp" 64 #include "config_HAVE_I386_CLANG8_COMPILER.hpp" 65 #include "config_HAVE_I386_CLANG9_COMPILER.hpp" 66 #include "config_HAVE_I386_CLANGVVD_COMPILER.hpp" 67 #include "config_HAVE_I386_GCC49_COMPILER.hpp" 68 #include "config_HAVE_I386_GCC5_COMPILER.hpp" 69 #include "config_HAVE_I386_GCC6_COMPILER.hpp" 70 #include "config_HAVE_I386_GCC7_COMPILER.hpp" 71 #include "config_HAVE_I386_GCC8_COMPILER.hpp" 72 #include "config_HAVE_TO_DATAFILE_BUILT.hpp" 73 #include "config_PACKAGE_BUGREPORT.hpp" 74 #include "config_PACKAGE_STRING.hpp" 80 #if HAVE_TO_DATAFILE_BUILT 84 #if HAVE_TECHNOLOGY_BUILT 98 #include "branch_name.hpp" 102 #include "revision_hash.hpp" 105 #define OPTION_NAME(r, data, elem) option_name[BOOST_PP_CAT(OPT_, elem)] = #elem; 108 : argc(_argc), argv(_argv), debug_level(_debug_level)
110 setOption(OPT_program_name, _program_name);
119 std::map<enum enum_option, std::string>::iterator it, it_end =
option_name.end();
122 it->second =
"OPT_" + it->second.substr(19);
123 it->second = it->second.substr(0, it->second.find(
')'));
141 const auto temporary_directory = getOption<std::string>(OPT_output_temporary_directory);
142 if(std::filesystem::exists(temporary_directory))
144 std::filesystem::remove_all(temporary_directory);
146 std::filesystem::create_directory(temporary_directory);
148 const auto output_directory = getOption<std::string>(OPT_output_directory);
149 if(!std::filesystem::exists(output_directory))
151 std::filesystem::create_directory(output_directory);
153 if(!std::filesystem::exists(output_directory))
155 THROW_ERROR(
"not able to create directory " + output_directory);
157 if(getOption<bool>(OPT_print_dot))
159 const auto dot_directory = getOption<std::string>(OPT_dot_directory);
160 if(std::filesystem::exists(dot_directory))
162 std::filesystem::remove_all(dot_directory);
164 std::filesystem::create_directory(dot_directory);
165 if(!std::filesystem::exists(dot_directory))
167 THROW_ERROR(
"not able to create directory " + dot_directory);
171 #if HAVE_FROM_C_BUILT 174 const auto mopt = getOption<std::string>(OPT_gcc_m32_mx32);
175 const auto default_compiler = getOption<CompilerWrapper_CompilerTarget>(OPT_default_compiler);
178 setOption(OPT_gcc_m32_mx32,
"-m32 -mno-sse2");
197 for(
const auto& iter : list)
199 const auto* EnodeC = GetPointer<const xml_element>(iter);
209 if(EnodeC->get_children().size())
229 for(
const auto& iter : list)
231 const auto* EnodeC = GetPointer<const xml_element>(iter);
241 if(EnodeC->get_children().size())
248 catch(
const char* msg)
250 std::cerr << msg << std::endl;
252 catch(
const std::string& msg)
254 std::cerr << msg << std::endl;
256 catch(
const std::exception& ex)
258 std::cout <<
"Exception caught: " << ex.what() << std::endl;
262 std::cerr <<
"unknown exception" << std::endl;
287 setOption(OPT_dot_directory, current_dir +
"/dot/");
288 setOption(OPT_output_temporary_directory, temporary_directory +
"/");
296 setOption(OPT_revision,
"unknown-trunk");
305 setOption(OPT_find_max_transformations,
false);
310 os <<
"List of parameters: " << std::endl;
311 for(
const auto& Option :
Options)
313 os << Option.first <<
": " << Option.second << std::endl;
315 std::map<enum enum_option, std::string>::const_iterator option, option_end =
enum_options.end();
316 for(option =
enum_options.begin(); option != option_end; ++option)
318 os <<
option_name.find(option->first)->second <<
": " << option->second << std::endl;
320 os <<
" === " << std::endl;
325 auto temp = class_name;
326 temp.erase(std::remove(temp.begin(), temp.end(),
'_'), temp.end());
332 else if(_debug_level < 0)
334 return getOption<int>(OPT_debug_level);
344 auto canonic_class_name = class_name;
345 canonic_class_name.erase(std::remove(canonic_class_name.begin(), canonic_class_name.end(),
'_'),
346 canonic_class_name.end());
347 auto canonic_function_name = function_name;
348 canonic_function_name.erase(std::remove(canonic_function_name.begin(), canonic_function_name.end(),
'_'),
349 canonic_function_name.end());
350 const auto canonic_full_function_name = canonic_class_name + std::string(
"::") + canonic_function_name;
363 auto temp = class_name;
364 temp.erase(std::remove(temp.begin(), temp.end(),
'_'), temp.end());
371 os <<
" Politecnico di Milano - DEIB" << std::endl;
372 os <<
" System Architectures Group" << std::endl;
373 os <<
"********************************************************************************" << std::endl;
374 os <<
" Copyright (C) 2004-2024 Politecnico di Milano" << std::endl;
376 if(version.size() < 80)
378 os << std::string(40 - (version.size() / 2),
' ') << version << std::endl;
382 os << version << std::endl;
389 return std::string(
"Version: ") + PACKAGE_STRING +
" - Revision " + getOption<std::string>(OPT_revision);
400 exit_success =
false;
417 setOption(OPT_read_parameter_xml, optarg_param);
423 setOption(OPT_write_parameter_xml, optarg_param);
429 setOption(OPT_output_level, optarg_param);
434 setOption(OPT_benchmark_name, optarg_param);
444 setOption(OPT_max_transformations, optarg_param);
449 setOption(OPT_find_max_transformations,
true);
454 setOption(OPT_configuration_name, optarg_param);
459 #if HAVE_FROM_C_BUILT 460 if(std::string(optarg_param) ==
"umpversion")
462 const auto preferred_compiler = getOption<CompilerWrapper_CompilerTarget>(OPT_default_compiler);
469 if(std::string(optarg_param) ==
"N")
471 std::string gcc_extra_options =
"-dN";
474 gcc_extra_options = getOption<std::string>(OPT_gcc_extra_options) +
" " + gcc_extra_options;
476 setOption(OPT_gcc_extra_options, gcc_extra_options);
483 setOption(OPT_debug_level, optarg_param);
492 std::vector<std::string> Splitted =
SplitString(optarg_param,
",");
493 for(
const auto& i : Splitted)
521 std::filesystem::create_directories(path);
522 setOption(OPT_output_temporary_directory, path.string() +
"/");
527 std::string param_pair(optarg_param);
528 std::vector<std::string> splitted =
SplitString(param_pair,
"=");
529 if(splitted.size() != 2)
531 THROW_ERROR(
"panda-parameter should be in the form <parameter>=<value>: " + param_pair);
545 #if HAVE_FROM_C_BUILT 546 bool Parameter::ManageGccOptions(
int next_option,
char* optarg_param)
562 defines += std::string(optarg_param);
568 if(std::string(optarg_param).find(
"openmp-simd") != std::string::npos)
570 if(std::string(optarg_param).find(
'=') != std::string::npos)
573 std::string(optarg_param).substr(std::string(optarg_param).find(
'=') + 1));
581 else if(std::string(optarg_param).find(
"openmp") != std::string::npos)
588 std::string optimizations;
593 THROW_ASSERT(optarg_param !=
nullptr && optarg_param[0] != 0,
"-f alone not allowed");
594 setOption(OPT_gcc_optimizations, optimizations + optarg_param);
607 const std::string
opt_level = std::string(optarg_param);
608 if(opt_level ==
"32")
612 else if(opt_level ==
"x32")
616 else if(opt_level ==
"64")
625 std::string gcc_warnings;
630 setOption(OPT_gcc_warnings, gcc_warnings + optarg_param);
640 std::string includes =
"-I " +
GetPath(std::string(optarg));
643 includes = getOption<std::string>(OPT_gcc_includes) +
" " + includes;
650 std::string libraries;
655 setOption(OPT_gcc_libraries, libraries + optarg_param);
660 std::string library_directories;
661 if(
isOption(OPT_gcc_library_directories))
665 setOption(OPT_gcc_library_directories, library_directories +
GetPath(optarg_param));
672 const std::string
opt_level = std::string(optarg_param);
677 else if(opt_level ==
"1")
681 else if(opt_level ==
"2")
685 else if(opt_level ==
"3")
689 else if(opt_level ==
"4")
693 else if(opt_level ==
"5")
697 else if(opt_level ==
"g")
701 else if(opt_level ==
"s")
705 else if(opt_level ==
"fast")
709 else if(opt_level ==
"z")
715 THROW_ERROR(
"Unknown optimization level: " + opt_level);
726 std::string undefines;
731 if(std::string(optarg_param).find(
'=') != std::string::npos)
733 bool has_parenthesis = std::string(optarg_param).find(
'(') != std::string::npos &&
734 std::string(optarg_param).find(
')') != std::string::npos;
735 std::string temp_var = std::string(optarg_param);
736 boost::replace_first(temp_var,
"=",
"=\'");
739 undefines +=
"\'" + temp_var +
"\'" +
"\'";
743 undefines += temp_var +
"\'";
748 setOption(OPT_gcc_undefines, undefines + optarg_param);
754 setOption(OPT_gcc_extra_options, optarg);
766 #if HAVE_I386_GCC49_COMPILER 767 if(std::string(optarg_param) ==
"I386_GCC49")
773 #if HAVE_I386_GCC5_COMPILER 774 if(std::string(optarg_param) ==
"I386_GCC5")
780 #if HAVE_I386_GCC6_COMPILER 781 if(std::string(optarg_param) ==
"I386_GCC6")
787 #if HAVE_I386_GCC7_COMPILER 788 if(std::string(optarg_param) ==
"I386_GCC7")
794 #if HAVE_I386_GCC8_COMPILER 795 if(std::string(optarg_param) ==
"I386_GCC8")
801 #if HAVE_I386_CLANG4_COMPILER 802 if(std::string(optarg_param) ==
"I386_CLANG4")
808 #if HAVE_I386_CLANG5_COMPILER 809 if(std::string(optarg_param) ==
"I386_CLANG5")
815 #if HAVE_I386_CLANG6_COMPILER 816 if(std::string(optarg_param) ==
"I386_CLANG6")
822 #if HAVE_I386_CLANG7_COMPILER 823 if(std::string(optarg_param) ==
"I386_CLANG7")
829 #if HAVE_I386_CLANG8_COMPILER 830 if(std::string(optarg_param) ==
"I386_CLANG8")
836 #if HAVE_I386_CLANG9_COMPILER 837 if(std::string(optarg_param) ==
"I386_CLANG9")
843 #if HAVE_I386_CLANG10_COMPILER 844 if(std::string(optarg_param) ==
"I386_CLANG10")
850 #if HAVE_I386_CLANG11_COMPILER 851 if(std::string(optarg_param) ==
"I386_CLANG11")
857 #if HAVE_I386_CLANG12_COMPILER 858 if(std::string(optarg_param) ==
"I386_CLANG12")
864 #if HAVE_I386_CLANG13_COMPILER 865 if(std::string(optarg_param) ==
"I386_CLANG13")
871 #if HAVE_I386_CLANG16_COMPILER 872 if(std::string(optarg_param) ==
"I386_CLANG16")
878 #if HAVE_I386_CLANGVVD_COMPILER 879 if(std::string(optarg_param) ==
"I386_CLANGVVD")
885 THROW_ERROR(
"Unknown compiler " + std::string(optarg_param));
905 setOption(OPT_gcc_parameters, parameters + optarg_param);
915 setOption(OPT_gcc_standard, optarg_param);
920 setOption(OPT_input_format, static_cast<int>(Parameters_FileFormat::FF_RAW));
939 const bool check_xml_root_node)
const 942 const auto extension = file_name.extension().string();
944 #if HAVE_FROM_AADL_ASN_BUILT 945 if(extension ==
".aadl" or extension ==
".AADL")
948 return Parameters_FileFormat::FF_AADL;
950 if(extension ==
".asn" or extension ==
".ASN")
953 return Parameters_FileFormat::FF_ASN;
956 #if HAVE_FROM_C_BUILT 957 if(extension ==
".c" or extension ==
".i")
960 return Parameters_FileFormat::FF_C;
962 if(extension ==
".m" or extension ==
".mi")
965 return Parameters_FileFormat::FF_OBJECTIVEC;
967 if(extension ==
".mm" or extension ==
".M" or extension ==
".mii")
970 return Parameters_FileFormat::FF_OBJECTIVECPP;
972 if(extension ==
".ii" or extension ==
".cc" or extension ==
".cp" or extension ==
".cxx" or extension ==
".cpp" or
973 extension ==
".CPP" or extension ==
".c++" or extension ==
".C")
976 return Parameters_FileFormat::FF_CPP;
978 if(extension ==
".f" or extension ==
".for" or extension ==
".ftn" or extension ==
".F" or extension ==
".FOR" or
979 extension ==
".fpp" or extension ==
".FPP" or extension ==
".FTN" or extension ==
".f90" or extension ==
".f95" or
980 extension ==
".f03" or extension ==
".f08" or extension ==
".F90" or extension ==
".F95" or extension ==
".F03" or
984 return Parameters_FileFormat::FF_FORTRAN;
986 if(extension ==
".ll")
989 const auto sub_extension = std::filesystem::path(file_name).replace_extension().extension().string();
990 if(sub_extension ==
".cpp")
992 return Parameters_FileFormat::FF_LLVM_CPP;
996 return Parameters_FileFormat::FF_LLVM;
999 if(extension ==
".LL")
1003 return Parameters_FileFormat::FF_LLVM_CPP;
1006 if(extension ==
".csv")
1008 const auto sub_extension = std::filesystem::path(file_name).replace_extension().extension().string();
1012 if(extension ==
".tex")
1017 if(extension ==
".v")
1022 if(extension ==
".vhd" or extension ==
".vhdl")
1027 if(extension ==
".xml")
1029 if(check_xml_root_node)
1035 #if HAVE_TO_DATAFILE_BUILT 1038 #if HAVE_BAMBU_RESULTS_XML 1039 if(root->get_name() ==
"bambu_results")
1042 return Parameters_FileFormat::FF_XML_BAMBU_RESULTS;
1049 return Parameters_FileFormat::FF_XML_CON;
1057 #if HAVE_TECHNOLOGY_BUILT 1061 return Parameters_FileFormat::FF_XML_TARGET;
1066 return Parameters_FileFormat::FF_XML_TEC;
1069 #if HAVE_TO_DATAFILE_BUILT 1081 #if HAVE_FROM_C_BUILT 1082 if(std::filesystem::exists(file_name))
1086 if(!opened_file->eof())
1088 getline(*opened_file, line);
1092 return Parameters_FileFormat::FF_RAW;
1102 os <<
"Please report bugs to <" << PACKAGE_BUGREPORT <<
">\n" << std::endl;
1107 os <<
" General options:\n\n" 1109 <<
" Display this usage information.\n\n" 1110 <<
" --version, -V\n" 1111 <<
" Display the version of the program.\n\n" 1112 <<
" --seed=<number>\n" 1113 <<
" Set the seed of the random number generator (default=0).\n\n" 1115 <<
" --read-parameters-XML=<xml_file_name>\n" 1116 <<
" Read command line options from a XML file.\n\n" 1117 <<
" --write-parameters-XML=<xml_file_name>\n" 1118 <<
" Dump the parsed command line options into a XML file.\n\n" 1125 os <<
" Output options:\n\n" 1126 <<
" --verbosity, -v <level>\n" 1127 <<
" Set the output verbosity level\n" 1128 <<
" Possible values for <level>:\n" 1132 <<
" 3 - PEDANTIC\n" 1133 <<
" 4 - VERY PEDANTIC\n" 1134 <<
" (default = 1)\n" 1137 <<
" --debug, -d <level>\n" 1138 <<
" Set the verbosity level of debugging information\n" 1139 <<
" Possible values for <level>:\n" 1143 <<
" 3 - PEDANTIC\n" 1144 <<
" 4 - VERY PEDANTIC\n" 1145 <<
" (default = 1).\n\n" 1146 <<
" --debug-classes=<classes_list>\n" 1147 <<
" Set maximum debug level for classes in <classes_list>\n\n" 1148 <<
" --max-transformations=<number>\n" 1149 <<
" Set a maximum number of transformations.\n\n" 1150 <<
" To reduce the disk usage two PandA parameter could be used:\n" 1151 <<
" --panda-parameter=print-tree-manager=0\n" 1152 <<
" --panda-parameter=print-dot-FF=0\n\n" 1153 <<
" --find-max-transformations\n" 1154 <<
" Find the maximum number of transformations raising an exception.\n\n" 1157 <<
" Do not remove temporary files.\n\n" 1158 <<
" --benchmark-name=<name>\n" 1159 <<
" Set the name of the current benchmark for data collection.\n" 1160 <<
" Mainly useful for data collection from extensive regression tests.\n\n" 1161 <<
" --configuration-name=<name>\n" 1162 <<
" Set the name of the current tool configuration for data collection.\n" 1163 <<
" Mainly useful for data collection from extensive regression tests.\n\n" 1164 <<
" --benchmark-fake-parameters\n" 1165 <<
" Set the parameters string for data collection. The parameters in the\n" 1166 <<
" string are not actually used, but they are used for data collection in\n" 1167 <<
" extensive regression tests.\n\n" 1168 <<
" --output-temporary-directory=<path>\n" 1169 <<
" Set the directory where temporary files are saved.\n" 1172 <<
" Dump to file several different graphs used in the IR of the tool.\n" 1173 <<
" The graphs are saved in .dot files, in graphviz format\n\n" 1175 <<
" --error-on-warning\n" 1176 <<
" Convert all runtime warnings to errors.\n\n" 1181 #if HAVE_FROM_C_BUILT 1182 void Parameter::PrintGccOptionsUsage(std::ostream& os)
const 1184 os <<
" GCC/CLANG front-end compiler options:\n\n" 1185 <<
" --compiler=<compiler_version>\n" 1186 <<
" Specify which compiler is used.\n" 1187 <<
" Possible values for <compiler_version> are:\n" 1188 #if HAVE_I386_GCC49_COMPILER 1191 #if HAVE_I386_GCC5_COMPILER 1194 #if HAVE_I386_GCC6_COMPILER 1197 #if HAVE_I386_GCC7_COMPILER 1200 #if HAVE_I386_GCC8_COMPILER 1203 #if HAVE_I386_CLANG4_COMPILER 1206 #if HAVE_I386_CLANG5_COMPILER 1209 #if HAVE_I386_CLANG6_COMPILER 1212 #if HAVE_I386_CLANG7_COMPILER 1215 #if HAVE_I386_CLANG8_COMPILER 1218 #if HAVE_I386_CLANG9_COMPILER 1221 #if HAVE_I386_CLANG10_COMPILER 1222 <<
" I386_CLANG10\n" 1224 #if HAVE_I386_CLANG11_COMPILER 1225 <<
" I386_CLANG11\n" 1227 #if HAVE_I386_CLANG12_COMPILER 1228 <<
" I386_CLANG12\n" 1230 #if HAVE_I386_CLANG13_COMPILER 1231 <<
" I386_CLANG13\n" 1233 #if HAVE_I386_CLANG16_COMPILER 1234 <<
" I386_CLANG16\n" 1236 #if HAVE_I386_CLANGVVD_COMPILER 1237 <<
" I386_CLANGVVD\n" 1241 <<
" Enable a specific optimization level. Possible values are the usual\n" 1242 <<
" optimization flags accepted by compilers, plus some others:\n" 1243 <<
" -O0,-O1,-O2,-O3,-Os,-O4,-O5.\n\n" 1245 <<
" Enable or disable a GCC/CLANG optimization option. All the -f or -fno options\n" 1246 <<
" are supported. In particular, -ftree-vectorize option triggers the\n" 1247 <<
" high-level synthesis of vectorized operations.\n\n" 1249 <<
" Specify a path where headers are searched for.\n\n" 1251 <<
" Specify a warning option passed to GCC/CLANG. All the -W options available in\n" 1252 <<
" GCC/CLANG are supported.\n\n" 1254 <<
" Enable preprocessing mode of GCC/CLANG.\n\n" 1255 <<
" --std=<standard>\n" 1256 <<
" Assume that the input sources are for <standard>. All\n" 1257 <<
" the --std options available in GCC/CLANG are supported.\n" 1258 <<
" The default value is gnu90/gnu11 for C and gnu++98/gnu++14 for C++ \n" 1259 <<
" depending on the selected frontend compiler support.\n\n" 1261 <<
" Predefine name as a macro, with definition 1.\n\n" 1262 <<
" -D<name=definition>\n" 1263 <<
" Tokenize <definition> and process as if it appeared as a #define directive.\n\n" 1265 <<
" Remove existing definition for macro <name>.\n\n" 1266 <<
" --param <name>=<value>\n" 1267 <<
" Set the amount <value> for the GCC/CLANG parameter <name> that could be used for\n" 1268 <<
" some optimizations.\n\n" 1270 <<
" Search the library named <library> when linking.\n\n" 1272 <<
" Add directory <dir> to the list of directories to be searched for -l.\n\n" 1274 <<
" Specify that input file is already a raw file and not a source file.\n\n" 1275 <<
" -m<machine-option>\n" 1276 <<
" Specify machine dependend options (currently not used).\n\n" 1278 <<
" --read-GCC-XML=<xml_file_name>\n" 1279 <<
" Read GCC options from a XML file.\n\n" 1280 <<
" --write-GCC-XML=<xml_file_name>\n" 1281 <<
" Dump the parsed GCC/CLANG compiler options into a XML file.\n\n" 1283 <<
" --Include-sysdir\n" 1284 <<
" Return the system include directory used by the wrapped GCC/CLANG compiler.\n\n" 1285 <<
" --gcc-config\n" 1286 <<
" Return the GCC/CLANG configuration.\n\n" 1288 <<
" --compute-sizeof\n" 1289 <<
" Replace sizeof with the computed valued for the considered target\n" 1290 <<
" architecture.\n\n" 1292 <<
" --extra-gcc-options\n" 1293 <<
" Specify custom extra options to the compiler.\n\n" 1318 std::vector<std::string> ret;
1321 ret.push_back(std::string(
argv[
arg]));
1326 #if HAVE_HOST_PROFILING_BUILT 1334 #if HAVE_FROM_C_BUILT 1348 #if HAVE_FROM_C_BUILT 1357 enum_options[name] = std::to_string(static_cast<int>(value));
1378 enum_options[name] = std::to_string(static_cast<int>(hls_flow_step_type));
1390 enum_options[name] = std::to_string(static_cast<int>(memory_allocation_policy));
1403 enum_options[name] = std::to_string(static_cast<int>(memory_allocation_channels_type));
1415 enum_options[name] = std::to_string(static_cast<int>(clique_covering_algorithm));
1427 enum_options[name] = std::to_string(static_cast<int>(evaluation_mode));
1439 enum_options[name] = std::to_string(static_cast<int>(parametric_list_based_metric));
1445 return static_cast<SDCScheduling_Algorithm
>(getOption<int>(name));
1451 enum_options[name] = std::to_string(static_cast<int>(sdc_scheduling_algorithm));
void write_xml_configuration_file(const std::string &filename)
Write an XML configuration file with the parameters actually stored.
std::map< enum enum_option, std::string > enum_options
Map between an enum option and the related string-form value.
xml nodes used in file specifying latex table format
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
void load_xml_configuration_file_rec(const xml_element *node)
Loads an XML configuration file (recursive method)
#define INPUT_OPT_ERROR_ON_WARNING
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
#define TREE_PANDA_COMPILER_OPTIONS
#define INPUT_OPT_NO_CLEAN
void setOption(const std::string &name, const G value)
Sets the value of an option.
File containing functions and utilities to support the printing of debug messagges.
xml nodes used in technology libraries files
#define STOK(token)
Macro used to convert a token symbol into the corresponding string.
#define OUTPUT_LEVEL_NONE
no output print is performed.
#define OPT_READ_PARAMETERS_XML
#define STR_CST_string_separator
The character used to separate concatenated string.
char **const argv
The input parameters;.
const std::vector< std::string > SplitString(const std::string &input, const std::string &separators)
Function which splits a string into tokens.
#define OPT_WRITE_PARAMETERS_XML
int GetFunctionDebugLevel(const std::string &class_name, const std::string &function_name) const
Return the debug_level of a function.
void PrintBugReport(std::ostream &os) const
Print the bug report request.
#define STR_XML_technology_root
The root node of technology libraries file.
virtual ~Parameter()
Destructor.
MemoryAllocation_ChannelsType
The number of channels.
static bool hasCompilerM64(CompilerWrapper_CompilerTarget ct)
#define STR_XML_constraints_root
The root node of constraints file.
bool error_on_warning
Transform warning into errors.
void print(std::ostream &os) const
A simple interface to token object of the raw files.
#define INPUT_OPT_COMPILER
#define CE_XVM(variable, node)
Check existence XML Value Macro. Check if an XML attribute is present in the XML tree.
#define DEBUG_LEVEL_INFINITE
everything is printed.
#define INPUT_OPT_CONFIGURATION_NAME
CliqueCovering_Algorithm
Defines all clique covering algorithm.
#define INPUT_OPT_GCC_CONFIG
#define STR_CST_temporary_directory
The temporary directory pattern.
#define OPTION_NAME(r, data, elem)
void SetCommonDefaults()
Sets the default values common to all tools.
#define OPT_BENCHMARK_NAME
CompilerWrapper_OptimizationSet
Possible optimization sets.
void PrintUsage(std::ostream &os) const
Print the usage of this tool = PrintHeader() + PrintHelp()
void line(int x1, int y1, int x2, int y2, unsigned int color)
Auxiliary methods for manipulating string.
std::string PrintVersion() const
This function prints the version of the tool.
#define INPUT_OPT_READ_GCC_XML
Parameters_FileFormat GetFileFormat(const std::filesystem::path &file, bool check_cml_root_node=false) const
Return the file format given the file name or the extension.
#define INPUT_OPT_PRINT_DOT
std::filesystem::path unique_path(const std::filesystem::path &model)
#define FRAMEWORK_OPTIONS
Parameter(const std::string &program_name, int argc, char **const argv, int debug_level=0)
Constructor.
#define STR_XML_experimental_setup_root
The root node.
#define OPT_BENCHMARK_FAKE_PARAMETERS
const std::string revision_hash
#define EUCALIPTUS_OPTIONS
#define INPUT_OPT_MAX_TRANSFORMATIONS
HostProfiling_Method
Different profiling method.
enum_option
Possible options.
#define GET_NODE_NAME(node)
#define OPT_DEBUG_CLASSES
bool IsParameter(const std::string &name) const
Return if a parameter has been set.
void write_to_file_formatted(const std::filesystem::path &filename)
Write the document to a file.
virtual void CheckParameters()=0
Checks the compatibility among the different parameters and determines the implications.
virtual void PrintFullHeader(std::ostream &os) const
This function prints the header of the tool = PrintProgramName() + PrintVersion() ...
#define STR_XML_technology_target_root
The root node of target file.
xml_element * create_root_node(const std::string &_name)
Creates the root node.
#define INPUT_OPT_COMPUTE_SIZEOF
utility function used to read files.
CompilerWrapper_CompilerTarget
target of the compiler
This file collects some utility functions and macros.
void Exec()
Parse an XML document from a file.
fileIO_istreamRef fileIO_istream_open(const std::string &name)
this function returns an istream compressed or not.
(Input) comma separated value
std::list< xml_nodeRef > node_list
type for list of xml nodes
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
const std::vector< std::string > CGetArgv() const
Return argv.
static bool hasCompilerGCCM32(CompilerWrapper_CompilerTarget ct)
static bool hasCompilerMX32(CompilerWrapper_CompilerTarget ct)
OptionMap Options
Map between the name of the option and the related string-form value.
#define INPUT_OPT_CUSTOM_OPTIONS
Template definition of refcount.
#define WRITE_XNVM2(name, value, node)
WRITE XML Name Value Macro second version. Insert a value in an XML tree given the name of the attrib...
static bool hasCompilerCLANGM32(CompilerWrapper_CompilerTarget ct)
int get_class_debug_level(const std::string &class_name, int debug_level=-1) const
Return the debug level for a specific class.
ActorGraphBackend_Type
C thread backend to be used.
int debug_level
debug level
#define INPUT_OPT_INCLUDE_SYSDIR
#define STR_XML_latex_table_root
The root node.
#define INPUT_OPT_PANDA_PARAMETER
std::string GetPath(std::filesystem::path path)
ParametricListBased_Metric
#define INPUT_OPT_FIND_MAX_TRANSFORMATIONS
static std::string getCompilerVersion(int ct)
#define STR_OPT_benchmark_fake_parameters
Parameter of the current benchmark for table results (this value is not used for profiling) ...
CustomUnorderedSet< std::string > debug_classes
Classes to be debugged.
#define SYNTHESIS_OPTIONS
xml nodes used in file specifying experimental setup
xml_documentRef get_document()
Obtain the parsed document.
Parameters_FileFormat
File formats.
(Input) XML storing experimental setup
(Input) XML storing format of latex table to be produced
#define GET_STRING_VALUE(node)
LOAD XML Value Macro.
this class is used to manage the command-line or XML options.
void getOption(const std::string &name, G &variable) const
Returns the value of an option.
Some macro used to interface with the XML library.
node_list const & get_children()
Obtain the list of child nodes.
std::string GetCurrentPath()
const std::string branch_name
void PrintGeneralOptionsUsage(std::ostream &os) const
Print the usage of the general common options.
#define INPUT_OPT_USE_RAW
bool isOption(const std::string &name) const
Tests if an option has been stored.
void PrintOutputOptionsUsage(std::ostream &os) const
Print the usage of the output common options.
#define PRINT_OUT_MEX(profLevel, curprofLevel, mex)
int argc
The number of input paramters.
void add_debug_class(const std::string &class_name)
Add a class to be debugged.
#define OPT_OUTPUT_TEMPORARY_DIRECTORY
bool ManageDefaultOptions(int next_option, char *optarg_param, bool &exit_success)
Manage default options (common to all tools)
#define INPUT_OPT_WRITE_GCC_XML
virtual void PrintProgramName(std::ostream &os) const =0
Print the name of the program to be included in the header.
xml_element * add_child_element(const std::string &name)
Add a child element to this node.
void load_xml_configuration_file(const std::string &filename)
Loads an XML configuration file.
MemoryAllocation_Policy
The allocation memory polycy.
xml nodes used in HLS constraints file
#define STR_CST_debug_all
Parameters.
static std::string getCompilerSuffix(CompilerWrapper_CompilerTarget pc)
virtual void PrintHelp(std::ostream &os) const =0
Print the help.
CustomMap< std::string, std::string > panda_parameters
Map between the name of a parameter and the related string-form value.
std::map< enum enum_option, std::string > option_name
Name of the enum options.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...
Implementation of the wrapper to Gcc for C sources.