46 #if HAVE_TECHNOLOGY_BUILT 51 #if HAVE_TECHNOLOGY_BUILT 61 #if HAVE_TECHNOLOGY_BUILT 71 #define MAX_LENGTH 10000 73 #define INIT(x, y) x.push_back(std::string(y)) 75 int main(
int argc,
char* argv[])
82 switch(parameters->Exec())
87 throw "Bad Parameters format";
91 if(not(parameters->getOption<
bool>(OPT_no_clean)))
93 std::filesystem::remove_all(parameters->getOption<std::string>(OPT_output_temporary_directory));
104 if(not(parameters->getOption<
bool>(OPT_no_clean)))
106 std::filesystem::remove_all(parameters->getOption<std::string>(OPT_output_temporary_directory));
112 auto debug_level = parameters->getOption<
int>(OPT_debug_level);
120 switch(output_format)
126 std::map<std::string, CustomMap<std::string, std::string>> results;
128 data_xml_parser->Parse(input_files, results);
131 parameters->getOption<std::string>(OPT_output_file));
135 #if HAVE_FROM_AADL_ASN_BUILT 136 case(Parameters_FileFormat::FF_AADL):
137 case(Parameters_FileFormat::FF_ASN):
139 #if HAVE_FROM_C_BUILT 140 case(Parameters_FileFormat::FF_C):
141 case(Parameters_FileFormat::FF_OBJECTIVEC):
142 case(Parameters_FileFormat::FF_OBJECTIVECPP):
143 case(Parameters_FileFormat::FF_CPP):
144 case(Parameters_FileFormat::FF_FORTRAN):
145 case(Parameters_FileFormat::FF_LLVM):
146 case(Parameters_FileFormat::FF_LLVM_CPP):
149 #if HAVE_FROM_C_BUILT 150 case(Parameters_FileFormat::FF_RAW):
155 case(Parameters_FileFormat::FF_XML_BAMBU_RESULTS):
157 case(Parameters_FileFormat::FF_XML_CON):
162 #if HAVE_TECHNOLOGY_BUILT 163 case(Parameters_FileFormat::FF_XML_TARGET):
164 case(Parameters_FileFormat::FF_XML_TEC):
171 THROW_ERROR(
"Not support combination input file - output file types");
175 case(Parameters_FileFormat::FF_XML_BAMBU_RESULTS):
178 std::map<std::string, CustomMap<std::string, std::string>> results;
180 data_xml_parser->Parse(input_files, results);
182 switch(output_format)
187 tr->write_to_latex(results, input_format,
188 GetPath(parameters->getOption<std::string>(OPT_output_file)));
194 tr->write_to_csv(results,
GetPath(parameters->getOption<std::string>(OPT_output_file)));
197 #if HAVE_FROM_AADL_ASN_BUILT 198 case(Parameters_FileFormat::FF_AADL):
199 case(Parameters_FileFormat::FF_ASN):
201 #if HAVE_FROM_C_BUILT 202 case(Parameters_FileFormat::FF_C):
203 case(Parameters_FileFormat::FF_OBJECTIVEC):
204 case(Parameters_FileFormat::FF_OBJECTIVECPP):
205 case(Parameters_FileFormat::FF_CPP):
206 case(Parameters_FileFormat::FF_FORTRAN):
207 case(Parameters_FileFormat::FF_LLVM):
208 case(Parameters_FileFormat::FF_LLVM_CPP):
210 #if HAVE_FROM_C_BUILT 211 case(Parameters_FileFormat::FF_RAW):
217 case(Parameters_FileFormat::FF_XML_BAMBU_RESULTS):
219 case(Parameters_FileFormat::FF_XML_CON):
224 #if HAVE_TECHNOLOGY_BUILT 225 case(Parameters_FileFormat::FF_XML_TARGET):
226 case(Parameters_FileFormat::FF_XML_TEC):
234 THROW_ERROR(
"Not supported combination input file - output file types");
239 #if HAVE_TECHNOLOGY_BUILT 240 case(Parameters_FileFormat::FF_XML_TARGET):
242 auto output_level = parameters->getOption<
int>(OPT_output_level);
253 const DesignFlowStepFactoryConstRef technology_flow_step_factory(
255 design_flow_manager->RegisterFactory(technology_flow_step_factory);
257 const std::string load_technology_flow_signature =
259 const vertex load_technology_flow_step =
260 design_flow_manager->GetDesignFlowStep(load_technology_flow_signature);
262 load_technology_flow_step ?
263 design_flow_graph->CGetDesignFlowStepInfo(load_technology_flow_step)->design_flow_step :
264 GetPointer<const TechnologyFlowStepFactory>(technology_flow_step_factory)
266 design_flow_manager->AddStep(load_technology_design_flow_step);
268 const std::string fix_technology_flow_signature =
270 const vertex fix_technology_flow_step =
271 design_flow_manager->GetDesignFlowStep(fix_technology_flow_signature);
273 fix_technology_flow_step ?
274 design_flow_graph->CGetDesignFlowStepInfo(fix_technology_flow_step)->design_flow_step :
275 GetPointer<const TechnologyFlowStepFactory>(technology_flow_step_factory)
277 design_flow_manager->AddStep(fix_technology_design_flow_step);
279 const std::string technology_flow_signature =
281 const vertex technology_flow_step = design_flow_manager->GetDesignFlowStep(technology_flow_signature);
283 technology_flow_step ?
284 design_flow_graph->CGetDesignFlowStepInfo(technology_flow_step)->design_flow_step :
285 GetPointer<const TechnologyFlowStepFactory>(technology_flow_step_factory)
287 design_flow_manager->AddStep(technology_design_flow_step);
288 design_flow_manager->Exec();
292 case(Parameters_FileFormat::FF_XML_TEC):
294 #if HAVE_CIRCUIT_BUILT 304 const DesignFlowStepFactoryConstRef technology_flow_step_factory(
306 design_flow_manager->RegisterFactory(technology_flow_step_factory);
308 const DesignFlowStepFactoryConstRef to_data_file_step_factory(
310 design_flow_manager->RegisterFactory(to_data_file_step_factory);
312 const std::string to_data_file_step_signature =
314 const vertex to_data_file_vertex = design_flow_manager->GetDesignFlowStep(to_data_file_step_signature);
316 to_data_file_vertex ? design_flow_graph->CGetDesignFlowStepInfo(to_data_file_vertex)->design_flow_step :
317 GetPointer<const ToDataFileStepFactory>(to_data_file_step_factory)
318 ->CreateStep(to_data_file_step_signature);
319 design_flow_manager->AddStep(to_data_file_step);
320 design_flow_manager->Exec();
322 THROW_ERROR(
"Input technology file not supported.");
330 #if HAVE_FROM_AADL_ASN_BUILT 331 case(Parameters_FileFormat::FF_AADL):
332 case(Parameters_FileFormat::FF_ASN):
334 #if HAVE_FROM_C_BUILT 335 case(Parameters_FileFormat::FF_C):
336 case(Parameters_FileFormat::FF_OBJECTIVEC):
337 case(Parameters_FileFormat::FF_OBJECTIVECPP):
338 case(Parameters_FileFormat::FF_CPP):
339 case(Parameters_FileFormat::FF_FORTRAN):
340 case(Parameters_FileFormat::FF_LLVM):
341 case(Parameters_FileFormat::FF_LLVM_CPP):
343 #if HAVE_FROM_C_BUILT 344 case(Parameters_FileFormat::FF_RAW):
351 case(Parameters_FileFormat::FF_XML_CON):
360 THROW_ERROR(
"Not supported input file type " +
STR(static_cast<int>(input_format)));
363 catch(
const char*
str)
365 std::cerr << str << std::endl;
367 catch(
const std::string& str)
369 std::cerr << str << std::endl;
371 catch(std::exception& inException)
377 std::cerr <<
"Unknown error type" << std::endl;
379 if(!parameters->getOption<
bool>(OPT_no_clean))
381 std::filesystem::remove_all(parameters->getOption<std::string>(OPT_output_temporary_directory));
Input function used to read the technology data structures.
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
int main(int argc, char *argv[])
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
int exit_code
NOTE: this file must be included only by source code of the executable (i.e., the file with the main)...
Base class for data backend.
File containing functions and utilities to support the printing of debug messagges.
#define OUTPUT_LEVEL_NONE
no output print is performed.
(Input) XML benchhmarks to be execluded from training set
#define INDENT_OUT_MEX(outLevel, curOutLevel, mex)
(Output) XML weights of single operations computed
exceptions managed by PandA
Factory for to data file step.
Class specification of the manager of the technology library data structures.
#define OUTPUT_LEVEL_MINIMUM
minimum debugging print is performed.
static const std::string ComputeSignature(const ToDataFileStep_Type to_data_file_step_type)
Compute the signature of a to data file step.
redefinition of map to manage ordered/unordered structures
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
static generic_deviceRef factory(const ParameterConstRef &Param, const technology_managerRef &TM)
Factory method.
This class manages the technology library structures.
Classes to describe design flow graph.
#define PARAMETER_PARSED
An integer value to return if parameters have been right parsed.
static const std::string ComputeSignature(const TechnologyFlowStep_Type technology_flow_step_type)
Compute the signature of a technology flow step.
redefinition of set to manage ordered/unordered structures
Factory for technology flow step.
refcount< Parameter > ParameterRef
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
utility function used to read files.
(Input) XML storing symbolic symulation results
(Input) comma separated value
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
(Input) task graph for free
This class collects information about generic data.
Class to translate data from a format to another one.
std::string GetPath(std::filesystem::path path)
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Parameters_FileFormat
File formats.
(Input/Output) XML symbolic weights
refcount< technology_manager > technology_managerRef
(Input) XML storing experimental setup
(Input) XML storing format of latex table to be produced
Dump information read already read from profiling file to other files.
Parse xml file containing generic data.
Generic device description.
#define PRINT_OUT_MEX(profLevel, curprofLevel, mex)
Base class for technology flow steps.
#define PARAMETER_NOTPARSED