PandA-2024.02
Public Member Functions | Static Public Member Functions | Data Fields
xml_script_node_t Class Referenceabstract

This is the abstract class which describes a generic synthesis script node, and some static helper methods. More...

#include <xml_script_command.hpp>

Inheritance diagram for xml_script_node_t:
Inheritance graph
[legend]

Public Member Functions

virtual std::string get_xml_name () const =0
 Gets the XML element name of this node type. More...
 
virtual xml_nodeRef create_xml_node () const =0
 Creates an XML node for polixml data structures. More...
 
virtual void clean ()=0
 Cleans object attributes. More...
 
virtual bool checkCondition (const DesignParametersRef &dp) const
 If the node has a compile-time condition, this method evaluates it. More...
 
 xml_script_node_t (xml_script_node_enum_t _type)
 
virtual ~xml_script_node_t ()
 

Static Public Member Functions

static xml_script_node_enum_t find_type (const xml_element *element)
 Finds the type of an XML element. More...
 
static xml_script_node_tcreate (const xml_element *element)
 Creates a script node by parsing the XML element. More...
 
static bool evaluate_condition (const std::string *condition)
 Evaluates a string condition. More...
 
static bool evaluate_condition (const std::string *condition, const DesignParametersRef &dp)
 Evaluates a string condition. More...
 

Data Fields

xml_script_node_enum_t nodeType
 

Detailed Description

This is the abstract class which describes a generic synthesis script node, and some static helper methods.

Definition at line 89 of file xml_script_command.hpp.

Constructor & Destructor Documentation

◆ xml_script_node_t()

xml_script_node_t::xml_script_node_t ( xml_script_node_enum_t  _type)
inlineexplicit

Definition at line 140 of file xml_script_command.hpp.

References ~xml_script_node_t().

Here is the call graph for this function:

◆ ~xml_script_node_t()

xml_script_node_t::~xml_script_node_t ( )
virtualdefault

Referenced by xml_script_node_t().

Here is the caller graph for this function:

Member Function Documentation

◆ checkCondition()

bool xml_script_node_t::checkCondition ( const DesignParametersRef dp) const
virtual

If the node has a compile-time condition, this method evaluates it.

Parameters
dpDesign parameters, used to check conditions at compile time.
Returns
The condition evaluation if any, otherwise is true by default.

Reimplemented in xml_ite_block_t, xml_shell_t, xml_command_t, xml_parameter_t, xml_set_variable_t, and xml_set_entry_t.

Definition at line 57 of file xml_script_command.cpp.

◆ clean()

virtual void xml_script_node_t::clean ( )
pure virtual

◆ create()

xml_script_node_t * xml_script_node_t::create ( const xml_element element)
static

Creates a script node by parsing the XML element.

Parameters
elementXML element to be parsed.
Returns
Script node.

Definition at line 99 of file xml_script_command.cpp.

References xml_node::get_name(), TAG_COMMAND, TAG_ENTRY, TAG_FOREACH, TAG_ITE_BLOCK, TAG_PARAMETER, TAG_SHELL, TAG_VARIABLE, and THROW_ERROR.

Referenced by SynthesisTool::xload_scripts(), xml_foreach_t::xml_foreach_t(), and xml_ite_block_t::xml_ite_block_t().

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

◆ create_xml_node()

virtual xml_nodeRef xml_script_node_t::create_xml_node ( ) const
pure virtual

Creates an XML node for polixml data structures.

Implemented in xml_foreach_t, xml_ite_block_t, xml_shell_t, xml_command_t, xml_parameter_t, xml_set_variable_t, and xml_set_entry_t.

◆ evaluate_condition() [1/2]

bool xml_script_node_t::evaluate_condition ( const std::string *  condition)
static

Evaluates a string condition.

Parameters
conditionCondition to be evaluated.
Returns
false <=> condition != NULL && ( trim(*condition) == "" || (float)*condition == "0.0" || tolowercase(trim(*condition)) == "false" )

represent a variable that has not been substituted/defined

Definition at line 138 of file xml_script_command.cpp.

References starts_with().

Referenced by xml_set_entry_t::checkCondition(), xml_set_variable_t::checkCondition(), xml_parameter_t::checkCondition(), xml_command_t::checkCondition(), xml_shell_t::checkCondition(), xml_ite_block_t::checkCondition(), evaluate_condition(), bash_flow_wrapper::toString(), NanoXploreWrapper::toString(), LatticeWrapper::toString(), AlteraWrapper::toString(), XilinxWrapper::toString(), and xml_parameter_t::xml_parameter_t().

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

◆ evaluate_condition() [2/2]

bool xml_script_node_t::evaluate_condition ( const std::string *  condition,
const DesignParametersRef dp 
)
static

Evaluates a string condition.

If the condition is a design parameter, its string value is evaluated.

Parameters
conditionCondition to be evaluated.
dpDesign parameters.
Returns
(trim(<em>condition) matches /${__.__}/) ? evaluate_condition(value of dp[variable of *condition]) : evaluate_condition(condition) )

Definition at line 189 of file xml_script_command.cpp.

References evaluate_condition(), map, DesignParameters::parameter_values, THROW_ERROR, and symmetry::value.

Here is the call graph for this function:

◆ find_type()

xml_script_node_enum_t xml_script_node_t::find_type ( const xml_element element)
static

Finds the type of an XML element.

Parameters
elementXML element to be parsed.
Returns
Node type (see xml_script_node_enum_t).

Definition at line 62 of file xml_script_command.cpp.

References xml_node::get_name(), TAG_COMMAND, TAG_ENTRY, TAG_FOREACH, TAG_ITE_BLOCK, TAG_PARAMETER, TAG_SHELL, and TAG_VARIABLE.

Referenced by SynthesisTool::xload_scripts().

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

◆ get_xml_name()

virtual std::string xml_script_node_t::get_xml_name ( ) const
pure virtual

Gets the XML element name of this node type.

Implemented in xml_foreach_t, xml_ite_block_t, xml_shell_t, xml_command_t, xml_parameter_t, xml_set_variable_t, and xml_set_entry_t.

Field Documentation

◆ nodeType

xml_script_node_enum_t xml_script_node_t::nodeType

Definition at line 92 of file xml_script_command.hpp.


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

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