PandA-2024.02
|
#include <SynthesisTool.hpp>
Public Types | |
using | type_t = enum { UNKNOWN=0, XST, NGDBUILD, MAP, PAR, TRCE, VIVADO_FLOW, QUARTUS_13_FLOW, QUARTUS_13_SETUP, QUARTUS_13_STA, QUARTUS_SETUP, QUARTUS_FLOW, QUARTUS_POW, QUARTUS_STA, LATTICE_FLOW, NXPYTHON_FLOW, BASH_FLOW } |
supported synthesis tools More... | |
Public Member Functions | |
SynthesisTool (const ParameterConstRef &Param, std::string tool_exec, const generic_deviceRef &device, const std::string &_flow_name, std::string default_output_dir) | |
Constructor. More... | |
virtual | ~SynthesisTool () |
Destructor. More... | |
virtual void | CheckExecution () |
Check if the tool can be really executed; i.e., it has been properly configured. More... | |
virtual void | EvaluateVariables (const DesignParametersRef dp) |
Evaluates the design variables. More... | |
virtual void | generate_synthesis_script (const DesignParametersRef &dp, const std::string &file_name)=0 |
Creates the proper configuration script. More... | |
virtual std::string | get_command_line (const DesignParametersRef &dp) const =0 |
virtual std::string | toString (const xml_script_node_tRef node, const DesignParametersRef dp) const =0 |
Returns the string-based representation of the XML element. More... | |
virtual std::string | getStringValue (const xml_script_node_tRef node, const DesignParametersRef &dp) const =0 |
Returns the string-based representation of the XML element. More... | |
std::string | get_output_directory () const |
Returns the path of the output directory. More... | |
std::string | generate_bare_script (const std::vector< xml_script_node_tRef > &nodes, const DesignParametersRef &dp) |
xml_set_variable_tRef | get_reserved_parameter (const std::string &name) |
Gets a reserved (tool) parameter by name. More... | |
void | replace_parameters (const DesignParametersRef &dp, std::string &script) const |
Replaces occurrences of parameters inside a script. More... | |
void | xload_scripts (const xml_element *child) |
Actual parsing of parameters and script nodes. More... | |
void | xload (const xml_element *node, const std::string &tool_config) |
Method parsing the configuration file directly from an XML node. More... | |
xml_nodeRef | xwrite () const |
Method writing the configuration file. More... | |
bool | has_scripts () const |
Checks if there is a configuration script loaded. More... | |
virtual std::string | get_tool_exec () const |
Returns the name of the tool executable. More... | |
Static Public Member Functions | |
static SynthesisToolRef | create_synthesis_tool (type_t type, const ParameterConstRef &Param, const std::string &output_dir, const generic_deviceRef &device) |
Factory method. More... | |
Protected Member Functions | |
void | create_output_directory (const std::string &sub_dir) |
Creates the directory to store the output files. More... | |
virtual void | init_reserved_vars () |
Initializes the reserved variables. More... | |
Protected Attributes | |
const generic_deviceRef | device |
class containing information about the target device More... | |
const ParameterConstRef | Param |
class containing all the parameters More... | |
int | debug_level |
debug level of the class More... | |
unsigned int | output_level |
verbosity level of the class More... | |
ToolManagerRef | tool |
utility class to manage the executable More... | |
const std::string | tool_exec |
name of the tool executable More... | |
std::string | output_dir |
the output directory More... | |
std::string | script_name |
name of the script More... | |
std::map< unsigned int, std::string > | script_map |
map between the identifier of the script and the corresponding stream More... | |
std::vector< xml_parameter_tRef > | xml_tool_options |
std::vector< xml_script_node_tRef > | xml_script_nodes |
std::vector< xml_set_variable_tRef > | xml_reserved_vars |
Definition at line 87 of file SynthesisTool.hpp.
using SynthesisTool::type_t = enum { UNKNOWN = 0, XST, NGDBUILD, MAP, PAR, TRCE, VIVADO_FLOW, QUARTUS_13_FLOW, QUARTUS_13_SETUP, QUARTUS_13_STA, QUARTUS_SETUP, QUARTUS_FLOW, QUARTUS_POW, QUARTUS_STA, LATTICE_FLOW, NXPYTHON_FLOW, BASH_FLOW } |
supported synthesis tools
Definition at line 109 of file SynthesisTool.hpp.
SynthesisTool::SynthesisTool | ( | const ParameterConstRef & | Param, |
std::string | tool_exec, | ||
const generic_deviceRef & | device, | ||
const std::string & | _flow_name, | ||
std::string | default_output_dir | ||
) |
Constructor.
creating the output directory
Definition at line 70 of file SynthesisTool.cpp.
References create_output_directory(), init_reserved_vars(), and ~SynthesisTool().
|
virtualdefault |
|
virtual |
Check if the tool can be really executed; i.e., it has been properly configured.
Definition at line 154 of file SynthesisTool.cpp.
|
protected |
Creates the directory to store the output files.
Definition at line 167 of file SynthesisTool.cpp.
References output_dir, and Param.
Referenced by SynthesisTool().
|
static |
Factory method.
this point should never be reached
Definition at line 92 of file SynthesisTool.cpp.
References THROW_ERROR, and UNKNOWN.
Referenced by BackendFlow::xload().
|
virtual |
Evaluates the design variables.
Reimplemented in xst_wrapper, trce_wrapper, map_wrapper, ngdbuild_wrapper, par_wrapper, vivado_flow_wrapper, QuartusReportWrapper, lattice_flow_wrapper, Quartus13ReportWrapper, nxpython_flow_wrapper, bash_flow_wrapper, and QuartusPowerWrapper.
Definition at line 312 of file SynthesisTool.cpp.
std::string SynthesisTool::generate_bare_script | ( | const std::vector< xml_script_node_tRef > & | nodes, |
const DesignParametersRef & | dp | ||
) |
Definition at line 272 of file SynthesisTool.cpp.
References toString().
Referenced by bash_flow_wrapper::generate_synthesis_script(), NanoXploreWrapper::generate_synthesis_script(), QuartusPowerWrapper::generate_synthesis_script(), LatticeWrapper::generate_synthesis_script(), AlteraWrapper::generate_synthesis_script(), and XilinxWrapper::generate_synthesis_script().
|
pure virtual |
Creates the proper configuration script.
Implemented in XilinxWrapper, AlteraWrapper, QuartusPowerWrapper, LatticeWrapper, NanoXploreWrapper, and bash_flow_wrapper.
|
pure virtual |
Implemented in AlteraWrapper, LatticeWrapper, xst_wrapper, NanoXploreWrapper, QuartusReportWrapper, Quartus13ReportWrapper, bash_flow_wrapper, trce_wrapper, map_wrapper, ngdbuild_wrapper, par_wrapper, QuartusPowerWrapper, QuartusWrapper, Quartus13Wrapper, vivado_flow_wrapper, and nxpython_flow_wrapper.
std::string SynthesisTool::get_output_directory | ( | ) | const |
Returns the path of the output directory.
Definition at line 162 of file SynthesisTool.cpp.
References output_dir.
xml_set_variable_tRef SynthesisTool::get_reserved_parameter | ( | const std::string & | name | ) |
Gets a reserved (tool) parameter by name.
name | Parameter name. |
Definition at line 287 of file SynthesisTool.cpp.
References THROW_ERROR, and xml_reserved_vars.
|
virtual |
Returns the name of the tool executable.
Definition at line 316 of file SynthesisTool.cpp.
References tool_exec.
Referenced by nxpython_flow_wrapper::get_command_line(), Quartus13Wrapper::get_command_line(), vivado_flow_wrapper::get_command_line(), QuartusWrapper::get_command_line(), QuartusPowerWrapper::get_command_line(), par_wrapper::get_command_line(), ngdbuild_wrapper::get_command_line(), map_wrapper::get_command_line(), trce_wrapper::get_command_line(), bash_flow_wrapper::get_command_line(), Quartus13ReportWrapper::get_command_line(), QuartusReportWrapper::get_command_line(), LatticeWrapper::get_command_line(), xst_wrapper::get_command_line(), xload(), and xwrite().
|
pure virtual |
Returns the string-based representation of the XML element.
Implemented in XilinxWrapper, AlteraWrapper, LatticeWrapper, NanoXploreWrapper, and bash_flow_wrapper.
bool SynthesisTool::has_scripts | ( | ) | const |
Checks if there is a configuration script loaded.
Definition at line 87 of file SynthesisTool.cpp.
References script_map, and xml_script_nodes.
|
protectedvirtual |
Initializes the reserved variables.
Reimplemented in xst_wrapper, trce_wrapper, map_wrapper, ngdbuild_wrapper, and par_wrapper.
Definition at line 158 of file SynthesisTool.cpp.
Referenced by ngdbuild_wrapper::init_reserved_vars(), par_wrapper::init_reserved_vars(), map_wrapper::init_reserved_vars(), trce_wrapper::init_reserved_vars(), xst_wrapper::init_reserved_vars(), and SynthesisTool().
void SynthesisTool::replace_parameters | ( | const DesignParametersRef & | dp, |
std::string & | script | ||
) | const |
Replaces occurrences of parameters inside a script.
dp | Design parameters. |
script | Script whose parameters have to be replaced. |
Definition at line 300 of file SynthesisTool.cpp.
References map, DesignParameters::parameter_values, and symmetry::value.
Referenced by bash_flow_wrapper::generate_synthesis_script(), NanoXploreWrapper::generate_synthesis_script(), AlteraWrapper::generate_synthesis_script(), QuartusPowerWrapper::generate_synthesis_script(), LatticeWrapper::generate_synthesis_script(), XilinxWrapper::generate_synthesis_script(), nxpython_flow_wrapper::get_command_line(), vivado_flow_wrapper::get_command_line(), Quartus13Wrapper::get_command_line(), QuartusWrapper::get_command_line(), QuartusPowerWrapper::get_command_line(), par_wrapper::get_command_line(), ngdbuild_wrapper::get_command_line(), map_wrapper::get_command_line(), trce_wrapper::get_command_line(), bash_flow_wrapper::get_command_line(), Quartus13ReportWrapper::get_command_line(), QuartusReportWrapper::get_command_line(), LatticeWrapper::get_command_line(), and xst_wrapper::get_command_line().
|
pure virtual |
Returns the string-based representation of the XML element.
Implemented in XilinxWrapper, AlteraWrapper, LatticeWrapper, NanoXploreWrapper, and bash_flow_wrapper.
Referenced by generate_bare_script().
void SynthesisTool::xload | ( | const xml_element * | node, |
const std::string & | tool_config | ||
) |
Method parsing the configuration file directly from an XML node.
Definition at line 223 of file SynthesisTool.cpp.
References CE_XVM, xml_child::get_children(), xml_node::get_name(), get_tool_exec(), LOAD_XVM, THROW_ERROR, and xload_scripts().
void SynthesisTool::xload_scripts | ( | const xml_element * | child | ) |
Actual parsing of parameters and script nodes.
Definition at line 191 of file SynthesisTool.cpp.
References xml_script_node_t::create(), xml_script_node_t::find_type(), xml_child::get_children(), line(), test_panda::lines, THROW_ERROR, xml_script_nodes, and xml_tool_options.
Referenced by xload().
xml_nodeRef SynthesisTool::xwrite | ( | ) | const |
Method writing the configuration file.
Definition at line 258 of file SynthesisTool.cpp.
References get_tool_exec(), xml_script_nodes, and xml_tool_options.
|
protected |
debug level of the class
Definition at line 119 of file SynthesisTool.hpp.
Referenced by bash_flow_wrapper::bash_flow_wrapper(), xst_wrapper::GenerateProjectFile(), lattice_flow_wrapper::lattice_flow_wrapper(), map_wrapper::map_wrapper(), ngdbuild_wrapper::ngdbuild_wrapper(), nxpython_flow_wrapper::nxpython_flow_wrapper(), par_wrapper::par_wrapper(), Quartus13ReportWrapper::Quartus13ReportWrapper(), QuartusPowerWrapper::QuartusPowerWrapper(), QuartusReportWrapper::QuartusReportWrapper(), trce_wrapper::trce_wrapper(), vivado_flow_wrapper::vivado_flow_wrapper(), and xst_wrapper::xst_wrapper().
|
protected |
class containing information about the target device
Definition at line 113 of file SynthesisTool.hpp.
|
protected |
the output directory
Definition at line 131 of file SynthesisTool.hpp.
Referenced by create_output_directory(), vivado_flow_wrapper::create_sdc(), QuartusPowerWrapper::EvaluateVariables(), bash_flow_wrapper::EvaluateVariables(), nxpython_flow_wrapper::EvaluateVariables(), Quartus13ReportWrapper::EvaluateVariables(), lattice_flow_wrapper::EvaluateVariables(), QuartusReportWrapper::EvaluateVariables(), vivado_flow_wrapper::EvaluateVariables(), ngdbuild_wrapper::EvaluateVariables(), par_wrapper::EvaluateVariables(), map_wrapper::EvaluateVariables(), trce_wrapper::EvaluateVariables(), xst_wrapper::EvaluateVariables(), and get_output_directory().
|
protected |
verbosity level of the class
Definition at line 122 of file SynthesisTool.hpp.
Referenced by ngdbuild_wrapper::get_command_line().
|
protected |
class containing all the parameters
Definition at line 116 of file SynthesisTool.hpp.
Referenced by create_output_directory(), vivado_flow_wrapper::create_sdc(), Quartus13Wrapper::get_command_line(), and Quartus13ReportWrapper::get_command_line().
|
protected |
map between the identifier of the script and the corresponding stream
Definition at line 137 of file SynthesisTool.hpp.
Referenced by has_scripts().
|
protected |
name of the script
Definition at line 134 of file SynthesisTool.hpp.
Referenced by bash_flow_wrapper::generate_synthesis_script(), NanoXploreWrapper::generate_synthesis_script(), AlteraWrapper::generate_synthesis_script(), QuartusPowerWrapper::generate_synthesis_script(), LatticeWrapper::generate_synthesis_script(), XilinxWrapper::generate_synthesis_script(), nxpython_flow_wrapper::get_command_line(), Quartus13Wrapper::get_command_line(), vivado_flow_wrapper::get_command_line(), QuartusWrapper::get_command_line(), QuartusPowerWrapper::get_command_line(), bash_flow_wrapper::get_command_line(), Quartus13ReportWrapper::get_command_line(), QuartusReportWrapper::get_command_line(), and LatticeWrapper::get_command_line().
|
protected |
utility class to manage the executable
Definition at line 125 of file SynthesisTool.hpp.
|
protected |
name of the tool executable
Definition at line 128 of file SynthesisTool.hpp.
Referenced by get_tool_exec().
|
protected |
Definition at line 147 of file SynthesisTool.hpp.
Referenced by bash_flow_wrapper::generate_synthesis_script(), NanoXploreWrapper::generate_synthesis_script(), LatticeWrapper::generate_synthesis_script(), QuartusPowerWrapper::generate_synthesis_script(), AlteraWrapper::generate_synthesis_script(), XilinxWrapper::generate_synthesis_script(), and get_reserved_parameter().
|
protected |
Definition at line 146 of file SynthesisTool.hpp.
Referenced by bash_flow_wrapper::generate_synthesis_script(), NanoXploreWrapper::generate_synthesis_script(), LatticeWrapper::generate_synthesis_script(), QuartusPowerWrapper::generate_synthesis_script(), AlteraWrapper::generate_synthesis_script(), XilinxWrapper::generate_synthesis_script(), has_scripts(), xload_scripts(), and xwrite().
|
protected |
Definition at line 145 of file SynthesisTool.hpp.
Referenced by nxpython_flow_wrapper::get_command_line(), Quartus13Wrapper::get_command_line(), vivado_flow_wrapper::get_command_line(), QuartusWrapper::get_command_line(), QuartusPowerWrapper::get_command_line(), par_wrapper::get_command_line(), ngdbuild_wrapper::get_command_line(), map_wrapper::get_command_line(), trce_wrapper::get_command_line(), bash_flow_wrapper::get_command_line(), Quartus13ReportWrapper::get_command_line(), QuartusReportWrapper::get_command_line(), LatticeWrapper::get_command_line(), xst_wrapper::get_command_line(), xload_scripts(), and xwrite().