56 #define PARAM_bash_outdir "bash_outdir" 86 std::ostringstream script;
87 script <<
"##########################################################" << std::endl;
88 script <<
"# Automatically generated by the PandA framework #" << std::endl;
89 script <<
"##########################################################" << std::endl << std::endl;
93 std::string script_string = script.str();
99 if(std::filesystem::exists(file_name))
101 std::filesystem::remove_all(file_name);
104 std::ofstream file_stream(file_name.c_str());
105 file_stream << script_string << std::endl;
111 switch(node->nodeType)
157 switch(node->nodeType)
175 result += *(par->
name);
208 result += *(comm->
name);
216 result += *(comm->
value);
227 result +=
" >> " + *(comm->
output);
235 std::string
result =
"sh ";
238 result += *(sh->
name);
246 result += *(sh->
value);
257 result +=
" >> " + *(sh->
output);
267 for(
const auto& n : block)
269 if(n->checkCondition(dp))
292 std::ostringstream s;
296 if(option->checkCondition(dp))
File containing functions and utilities to support the printing of debug messagges.
#define PRINT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
void remove_escaped(std::string &ioString)
Function converting all the escaped characters in the associated character.
Wrapper to invoke a generic bash script.
#define DEBUG_LEVEL_PEDANTIC
very verbose debugging print is performed.
#define PARAM_bash_backend_timing_report
std::vector< xml_parameter_tRef > parameters
std::vector< xml_script_node_tRef > elseNodes
std::string toString(const xml_script_node_tRef node, const DesignParametersRef dp) const override
Returns the string-based representation of the XML element.
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
static bool evaluate_condition(const std::string *condition)
Evaluates a string condition.
#define BASH_FLOW_TOOL_ID
If/Then/Else block, evaluated at compile-time.
map_t parameter_values
Map between the name of the parameter and the corresponding string-based value.
~bash_flow_wrapper() override
Destructor.
Backend based on a simple bash script.
void generate_synthesis_script(const DesignParametersRef &dp, const std::string &file_name) override
Creates the proper configuration script.
void assign(const std::string &name, const std::string &value, bool checkExisting)
Assigns a value to a saved parameter.
#define PARAM_bash_backend_report
This file contains the definition of the parameters for the synthesis tools.
utility function used to read files.
std::string get_command_line(const DesignParametersRef &dp) const override
Returns the proper command line.
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
#define PARAM_bash_outdir
Header include.
void EvaluateVariables(const DesignParametersRef dp) override
Evaluates the design variables.
This struct specifies the block node.
std::vector< xml_parameter_tRef > parameters
Classes for handling configuration files.
#define BASH_FLOW_TOOL_EXEC
std::string component_name
Name of the component.
std::string * singleValue
std::string * singleValue
std::vector< xml_set_entry_tRef > multiValues
std::vector< xml_set_entry_tRef > multiValues
Variable assignment, either single value or multiple entries set.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Command line of the synthesis tool.
this class is used to manage the command-line or XML options.
Command line of the native shell.
bash_flow_wrapper(const ParameterConstRef &Param, const std::string &_output_dir, const generic_deviceRef &_device)
Constructor.
std::string getStringValue(const xml_script_node_tRef node, const DesignParametersRef &dp) const override
Returns the string-based representation of the XML element.
std::vector< xml_script_node_tRef > thenNodes
String entry of a multiple values variable (set).