PandA-2024.02
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
SynthesisTool Class Referenceabstract

#include <SynthesisTool.hpp>

Inheritance diagram for SynthesisTool:
Inheritance graph
[legend]
Collaboration diagram for SynthesisTool:
Collaboration graph
[legend]

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_tRefxml_tool_options
 
std::vector< xml_script_node_tRefxml_script_nodes
 
std::vector< xml_set_variable_tRefxml_reserved_vars
 

Detailed Description

Definition at line 87 of file SynthesisTool.hpp.

Member Typedef Documentation

◆ type_t

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.

Constructor & Destructor Documentation

◆ SynthesisTool()

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().

Here is the call graph for this function:

◆ ~SynthesisTool()

SynthesisTool::~SynthesisTool ( )
virtualdefault

Destructor.

Referenced by SynthesisTool().

Here is the caller graph for this function:

Member Function Documentation

◆ CheckExecution()

void SynthesisTool::CheckExecution ( )
virtual

Check if the tool can be really executed; i.e., it has been properly configured.

Definition at line 154 of file SynthesisTool.cpp.

◆ create_output_directory()

void SynthesisTool::create_output_directory ( const std::string &  sub_dir)
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().

Here is the caller graph for this function:

◆ create_synthesis_tool()

SynthesisToolRef SynthesisTool::create_synthesis_tool ( type_t  type,
const ParameterConstRef Param,
const std::string &  output_dir,
const generic_deviceRef device 
)
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().

Here is the caller graph for this function:

◆ EvaluateVariables()

void SynthesisTool::EvaluateVariables ( const DesignParametersRef  dp)
virtual

◆ generate_bare_script()

std::string SynthesisTool::generate_bare_script ( const std::vector< xml_script_node_tRef > &  nodes,
const DesignParametersRef dp 
)
Returns
The bare script without any special string replacement

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate_synthesis_script()

virtual void SynthesisTool::generate_synthesis_script ( const DesignParametersRef dp,
const std::string &  file_name 
)
pure virtual

Creates the proper configuration script.

Implemented in XilinxWrapper, AlteraWrapper, QuartusPowerWrapper, LatticeWrapper, NanoXploreWrapper, and bash_flow_wrapper.

◆ get_command_line()

virtual std::string SynthesisTool::get_command_line ( const DesignParametersRef dp) const
pure virtual

◆ get_output_directory()

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.

◆ get_reserved_parameter()

xml_set_variable_tRef SynthesisTool::get_reserved_parameter ( const std::string &  name)

Gets a reserved (tool) parameter by name.

Parameters
nameParameter name.
Returns
Reserved parameter reference.

Definition at line 287 of file SynthesisTool.cpp.

References THROW_ERROR, and xml_reserved_vars.

◆ get_tool_exec()

std::string SynthesisTool::get_tool_exec ( ) const
virtual

◆ getStringValue()

virtual std::string SynthesisTool::getStringValue ( const xml_script_node_tRef  node,
const DesignParametersRef dp 
) const
pure virtual

Returns the string-based representation of the XML element.

Implemented in XilinxWrapper, AlteraWrapper, LatticeWrapper, NanoXploreWrapper, and bash_flow_wrapper.

◆ has_scripts()

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.

◆ init_reserved_vars()

void SynthesisTool::init_reserved_vars ( )
protectedvirtual

◆ replace_parameters()

void SynthesisTool::replace_parameters ( const DesignParametersRef dp,
std::string &  script 
) const

◆ toString()

virtual std::string SynthesisTool::toString ( const xml_script_node_tRef  node,
const DesignParametersRef  dp 
) const
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().

Here is the caller graph for this function:

◆ xload()

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().

Here is the call graph for this function:

◆ 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xwrite()

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.

Here is the call graph for this function:

Field Documentation

◆ debug_level

int SynthesisTool::debug_level
protected

◆ device

const generic_deviceRef SynthesisTool::device
protected

class containing information about the target device

Definition at line 113 of file SynthesisTool.hpp.

◆ output_dir

std::string SynthesisTool::output_dir
protected

◆ output_level

unsigned int SynthesisTool::output_level
protected

verbosity level of the class

Definition at line 122 of file SynthesisTool.hpp.

Referenced by ngdbuild_wrapper::get_command_line().

◆ Param

const ParameterConstRef SynthesisTool::Param
protected

◆ script_map

std::map<unsigned int, std::string> SynthesisTool::script_map
protected

map between the identifier of the script and the corresponding stream

Definition at line 137 of file SynthesisTool.hpp.

Referenced by has_scripts().

◆ script_name

std::string SynthesisTool::script_name
protected

◆ tool

ToolManagerRef SynthesisTool::tool
protected

utility class to manage the executable

Definition at line 125 of file SynthesisTool.hpp.

◆ tool_exec

const std::string SynthesisTool::tool_exec
protected

name of the tool executable

Definition at line 128 of file SynthesisTool.hpp.

Referenced by get_tool_exec().

◆ xml_reserved_vars

std::vector<xml_set_variable_tRef> SynthesisTool::xml_reserved_vars
protected

◆ xml_script_nodes

std::vector<xml_script_node_tRef> SynthesisTool::xml_script_nodes
protected

◆ xml_tool_options

std::vector<xml_parameter_tRef> SynthesisTool::xml_tool_options
protected

The documentation for this class was generated from the following files:

Generated on Mon Feb 12 2024 13:04:05 for PandA-2024.02 by doxygen 1.8.13