54 #include <boost/algorithm/string.hpp> 60 const std::string& _default_output_dir)
61 :
SynthesisTool(_Param, _tool_exec, _device, _output_dir, _default_output_dir)
76 std::ostringstream script;
77 script <<
"##########################################################" << std::endl;
78 script <<
"# Automatically generated by the PandA framework #" << std::endl;
79 script <<
"##########################################################" << std::endl << std::endl;
83 std::string script_string = script.str();
89 if(std::filesystem::exists(file_name))
91 std::filesystem::remove_all(file_name);
94 std::ofstream file_stream(file_name.c_str());
95 file_stream << script_string << std::endl;
101 std::ostringstream s;
105 if(option->checkCondition(dp))
118 switch(node->nodeType)
170 switch(node->nodeType)
188 result += *(par->
name);
221 result += *(comm->
name);
229 result += *(comm->
value);
240 result +=
" >> " + *(comm->
output);
248 std::string
result =
"sh ";
251 result += *(sh->
name);
259 result += *(sh->
value);
270 result +=
" >> " + *(sh->
output);
280 for(
const auto& n : block)
282 if(n->checkCondition(dp))
~LatticeWrapper() override
Destructor.
void generate_synthesis_script(const DesignParametersRef &dp, const std::string &file_name) override
Creates the proper configuration script.
void remove_escaped(std::string &ioString)
Function converting all the escaped characters in the associated character.
LatticeWrapper(const ParameterConstRef &Param, const std::string &tool_exec, const generic_deviceRef &device, const std::string &output_dir, const std::string &default_output_dir)
Constructor.
std::vector< xml_parameter_tRef > parameters
std::vector< xml_script_node_tRef > elseNodes
#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.
If/Then/Else block, evaluated at compile-time.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
void assign(const std::string &name, const std::string &value, bool checkExisting)
Assigns a value to a saved parameter.
Wrapper to synthesis tools by Lattice.
This file contains the definition of the parameters for the synthesis tools.
utility function used to read files.
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
This struct specifies the block node.
std::vector< xml_parameter_tRef > parameters
Classes for handling configuration files.
std::string get_command_line(const DesignParametersRef &dp) const override
Returns the proper command line.
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.
std::string toString(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).
std::string getStringValue(const xml_script_node_tRef node, const DesignParametersRef &dp) const override
Returns the string-based representation of the XML element.