PandA-2024.02
|
#include <BackendFlow.hpp>
Public Types | |
using | type_t = enum { UNKNOWN, XILINX_FPGA, ALTERA_FPGA, LATTICE_FPGA, NANOXPLORE_FPGA, GENERIC, } |
implemented flow More... | |
Public Member Functions | |
BackendFlow (const ParameterConstRef Param, std::string flow_name, const generic_deviceRef _device) | |
Constructor. More... | |
virtual | ~BackendFlow () |
Destructor. More... | |
virtual std::string | GenerateSynthesisScripts (const std::string &fu_name, const structural_managerRef SM, const std::list< std::string > &hdl_files, const std::list< std::string > &aux_files) |
Generates the synthesis scripts for the specified design. More... | |
virtual void | ExecuteSynthesis () |
Executes the synthesis with the implemented flow. More... | |
void | Execute (const std::string &top_id, const std::string &top_normalized, const std::string &filestring, const std::string &filename_bench, const std::string &clock, double clk_period, bool syntax_check) |
Executes the synthesis with the implemented flow. More... | |
std::string | CreateScripts (const DesignParametersRef dp) |
Creates the scripts for the specified tools in the right order, along with the overall configuration. More... | |
virtual void | InitDesignParameters () |
Initializes the parameters. More... | |
void | parse_flow (const XMLDomParserRef parser) |
Creates the synthesis flow based on the user's requirements. More... | |
void | create_xml_scripts (const std::string &xml_file) |
Creates the XML script containing all the steps. More... | |
void | add_backend_step (const BackendStepRef &step) |
Adds a backend step to the list of the ones to be performed. More... | |
std::string | get_flow_name () const |
Returns the name of the flow. More... | |
void | set_initial_parameters (const DesignParametersRef &flow_parameters, const CustomOrderedSet< std::string > &undefined_parameters) |
Sets parameters. More... | |
void | set_parameters (const DesignParametersRef &_flow_parameters) |
Sets actual parameters. More... | |
area_infoRef | get_used_resources () const |
Returns the list of used resources. More... | |
time_infoRef | get_timing_results () const |
Returns the timing information. More... | |
Static Public Member Functions | |
static BackendFlowRef | CreateFlow (const ParameterConstRef Param, const std::string &flow_name, const generic_deviceRef _device) |
Creates the flow specification based on the given parameters. More... | |
static type_t | DetermineBackendFlowType (const generic_deviceRef device, const ParameterConstRef parameters) |
Determines the type of the backend flow based on the target device. More... | |
Protected Member Functions | |
void | ParseBackendFlow (const std::string &flow_name) |
Parses the description of the backend flow given its identifier. More... | |
void | xload (const xml_element *node) |
Loads the backend flow from an XML node. More... | |
virtual void | WriteFlowConfiguration (std::ostream &script)=0 |
Writes the proper flow configuration in the output script. More... | |
virtual void | CheckSynthesisResults ()=0 |
Checks the synthesis results and fills the corresponding data structures. More... | |
Protected Attributes | |
const ParameterConstRef | Param |
class containing all the parameters More... | |
int | debug_level |
debugging level of the class More... | |
unsigned int | output_level |
verbosity level of the class More... | |
std::string | flow_name |
string-based identifier of the flow More... | |
std::string | out_dir |
name of the output directory More... | |
std::map< std::string, std::string > | default_data |
map between the identifiers of the synthesis flows and the corresponding implementations More... | |
const generic_deviceRef | device |
information about the target device More... | |
xml_element * | root |
root node of the configuration device More... | |
area_infoRef | area_m |
pointer to the data structure containing information about the resources More... | |
time_infoRef | time_m |
pointer to the data structure containing timing information More... | |
std::vector< BackendStepRef > | steps |
ordered list of synthesis steps More... | |
DesignParametersRef | default_flow_parameters |
set of design parameters to be set More... | |
CustomOrderedSet< std::string > | undefined_parameters |
list of undefined parameters More... | |
DesignParametersRef | actual_parameters |
set of design parameters with the actual values More... | |
std::string | generated_synthesis_script |
name of the synthesis script More... | |
Definition at line 90 of file BackendFlow.hpp.
using BackendFlow::type_t = enum { UNKNOWN, XILINX_FPGA, ALTERA_FPGA, LATTICE_FPGA, NANOXPLORE_FPGA, GENERIC, } |
implemented flow
Definition at line 104 of file BackendFlow.hpp.
BackendFlow::BackendFlow | ( | const ParameterConstRef | Param, |
std::string | flow_name, | ||
const generic_deviceRef | _device | ||
) |
Constructor.
Param | is the reference to the class containing all the parameters |
flow_name | is a string representing the name of the flow |
target | is the data structure containing all the information about the target of the synthesis |
Definition at line 89 of file BackendFlow.cpp.
References debug_level, GET_CLASS, out_dir, Param, and ~BackendFlow().
|
virtualdefault |
void BackendFlow::add_backend_step | ( | const BackendStepRef & | step | ) |
Adds a backend step to the list of the ones to be performed.
step | is the reference to the data-structure containing information about the step |
add the step after all the previous ones
Definition at line 556 of file BackendFlow.cpp.
References steps.
Referenced by xload().
|
protectedpure virtual |
Checks the synthesis results and fills the corresponding data structures.
Implemented in XilinxBackendFlow, NanoXploreBackendFlow, BashBackendFlow, AlteraBackendFlow, and LatticeBackendFlow.
Referenced by ExecuteSynthesis().
void BackendFlow::create_xml_scripts | ( | const std::string & | xml_file | ) |
Creates the XML script containing all the steps.
Definition at line 669 of file BackendFlow.cpp.
References xml_child::add_child_element(), xml_document::set_encoding(), xml_node::set_name(), steps, THROW_ASSERT, and xml_document::write_to_file_formatted().
Referenced by CreateScripts().
|
static |
Creates the flow specification based on the given parameters.
Definition at line 157 of file BackendFlow.cpp.
References DetermineBackendFlowType(), THROW_UNREACHABLE, test_panda::type, and UNKNOWN.
Referenced by RTLCharacterization::AnalyzeCell(), and HLS_manager::get_backend_flow().
std::string BackendFlow::CreateScripts | ( | const DesignParametersRef | dp | ) |
Creates the scripts for the specified tools in the right order, along with the overall configuration.
output directory
script file
Definition at line 562 of file BackendFlow.cpp.
References add(), DesignParameters::chain_name, DesignParameters::clone(), DesignParameters::component_name, create_xml_scripts(), debug_level, DEBUG_LEVEL_PEDANTIC, DEBUG_LEVEL_VERBOSE, default_flow_parameters, generated_synthesis_script, GetCurrentPath(), GetPath(), INDENT_DBG_MEX, DesignParameters::parameter_values, PRINT_MSG, steps, STR, THROW_ASSERT, THROW_ERROR, undefined_parameters, and WriteFlowConfiguration().
Referenced by XilinxTasteBackendFlow::GenerateSynthesisScripts(), and GenerateSynthesisScripts().
|
static |
Determines the type of the backend flow based on the target device.
Definition at line 108 of file BackendFlow.cpp.
References test_panda::parameters, THROW_ERROR, and UNKNOWN.
Referenced by CreateFlow(), and GenerateSimulationScripts::Exec().
void BackendFlow::Execute | ( | const std::string & | top_id, |
const std::string & | top_normalized, | ||
const std::string & | filestring, | ||
const std::string & | filename_bench, | ||
const std::string & | clock, | ||
double | clk_period, | ||
bool | syntax_check | ||
) |
Executes the synthesis with the implemented flow.
|
virtual |
Executes the synthesis with the implemented flow.
Reimplemented in XilinxBackendFlow, AlteraBackendFlow, LatticeBackendFlow, and NanoXploreBackendFlow.
Definition at line 326 of file BackendFlow.cpp.
References CheckSynthesisResults(), ToolManager::configure(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, ToolManager::execute(), generated_synthesis_script, INDENT_DBG_MEX, Param, test_panda::parameters, and steps.
Referenced by RTLCharacterization::AnalyzeCell(), AlteraBackendFlow::ExecuteSynthesis(), NanoXploreBackendFlow::ExecuteSynthesis(), LatticeBackendFlow::ExecuteSynthesis(), and XilinxBackendFlow::ExecuteSynthesis().
|
virtual |
Generates the synthesis scripts for the specified design.
Reimplemented in XilinxTasteBackendFlow.
Definition at line 184 of file BackendFlow.cpp.
References actual_parameters, DesignParameters::chain_name, CLOCK_PORT_NAME, DesignParameters::component_name, CreateScripts(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, device, flow_name, structural_manager::get_circ(), technology_manager::get_fu(), structural_object::get_id(), technology_manager::get_library(), INDENT_DBG_MEX, InitDesignParameters(), Param, PARAM_backend_script_extensions, PARAM_clk_freq, PARAM_clk_name, PARAM_clk_period, PARAM_clk_period_default, PARAM_clk_period_ps, PARAM_connect_iob, PARAM_fu, PARAM_has_script_extensions, PARAM_has_VHDL_library, PARAM_HDL_files, PARAM_is_combinational, PARAM_parallel_backend, PARAM_time_constrained, PARAM_top_id, PARAM_VHDL_library, DesignParameters::parameter_values, and STR.
Referenced by RTLCharacterization::AnalyzeCell().
std::string BackendFlow::get_flow_name | ( | ) | const |
Returns the name of the flow.
Definition at line 551 of file BackendFlow.cpp.
References flow_name.
Referenced by AlteraBackendFlow::create_sdc().
time_infoRef BackendFlow::get_timing_results | ( | ) | const |
Returns the timing information.
Definition at line 350 of file BackendFlow.cpp.
References time_m.
Referenced by RTLCharacterization::AnalyzeCell().
area_infoRef BackendFlow::get_used_resources | ( | ) | const |
Returns the list of used resources.
Definition at line 345 of file BackendFlow.cpp.
References area_m.
Referenced by RTLCharacterization::AnalyzeCell().
|
virtual |
Initializes the parameters.
nothing to do
Reimplemented in XilinxBackendFlow, AlteraBackendFlow, LatticeBackendFlow, NanoXploreBackendFlow, and BashBackendFlow.
Definition at line 685 of file BackendFlow.cpp.
Referenced by GenerateSynthesisScripts().
void BackendFlow::parse_flow | ( | const XMLDomParserRef | parser | ) |
Creates the synthesis flow based on the user's requirements.
xml_file | is the XML-based configuration file of the entire flow |
Definition at line 355 of file BackendFlow.cpp.
References flow_name, xml_child::get_children(), xml_node::get_name(), LOAD_XVM, root, and xload().
Referenced by AlteraBackendFlow::AlteraBackendFlow(), BashBackendFlow::BashBackendFlow(), LatticeBackendFlow::LatticeBackendFlow(), NanoXploreBackendFlow::NanoXploreBackendFlow(), and XilinxBackendFlow::XilinxBackendFlow().
|
protected |
Parses the description of the backend flow given its identifier.
flow_name | is the string that represents the identifier of the flow |
void BackendFlow::set_initial_parameters | ( | const DesignParametersRef & | flow_parameters, |
const CustomOrderedSet< std::string > & | undefined_parameters | ||
) |
Sets parameters.
Definition at line 662 of file BackendFlow.cpp.
References default_flow_parameters, and undefined_parameters.
void BackendFlow::set_parameters | ( | const DesignParametersRef & | _flow_parameters | ) |
Sets actual parameters.
|
protectedpure virtual |
Writes the proper flow configuration in the output script.
Implemented in XilinxBackendFlow, NanoXploreBackendFlow, BashBackendFlow, AlteraBackendFlow, and LatticeBackendFlow.
Referenced by CreateScripts().
|
protected |
Loads the backend flow from an XML node.
list of supported synthesis steps
update with the actual name of the output directory
parse the proper script configuration for the tool in the device configuration XML
Definition at line 378 of file BackendFlow.cpp.
References add_backend_step(), BASH_FLOW_TOOL_ID, CE_XVM, DesignParameters::chain_name, SynthesisTool::create_synthesis_tool(), default_flow_parameters, device, flow_name, xml_child::get_children(), xml_node::get_name(), LATTICE_FLOW_TOOL_ID, LOAD_XVFM, LOAD_XVM, MAP_TOOL_ID, NGDBUILD_TOOL_ID, NXPYTHON_FLOW_TOOL_ID, out_dir, PAR_TOOL_ID, Param, QUARTUS_13_FLOW_TOOL_ID, QUARTUS_13_REPORT_TOOL_ID, QUARTUS_13_SETUP_TOOL_ID, QUARTUS_FLOW_TOOL_ID, QUARTUS_POWER_TOOL_ID, QUARTUS_REPORT_TOOL_ID, QUARTUS_SETUP_TOOL_ID, root, THROW_ASSERT, THROW_ERROR, TRCE_TOOL_ID, test_panda::type, VIVADO_FLOW_TOOL_ID, and XST_TOOL_ID.
Referenced by parse_flow().
|
protected |
set of design parameters with the actual values
Definition at line 147 of file BackendFlow.hpp.
Referenced by AlteraBackendFlow::CheckSynthesisResults(), LatticeBackendFlow::CheckSynthesisResults(), BashBackendFlow::CheckSynthesisResults(), NanoXploreBackendFlow::CheckSynthesisResults(), XilinxBackendFlow::CheckSynthesisResults(), XilinxTasteBackendFlow::GenerateSynthesisScripts(), GenerateSynthesisScripts(), BashBackendFlow::InitDesignParameters(), AlteraBackendFlow::InitDesignParameters(), NanoXploreBackendFlow::InitDesignParameters(), LatticeBackendFlow::InitDesignParameters(), XilinxBackendFlow::InitDesignParameters(), and XilinxBackendFlow::parse_timing().
|
protected |
pointer to the data structure containing information about the resources
Definition at line 132 of file BackendFlow.hpp.
Referenced by AlteraBackendFlow::CheckSynthesisResults(), LatticeBackendFlow::CheckSynthesisResults(), BashBackendFlow::CheckSynthesisResults(), NanoXploreBackendFlow::CheckSynthesisResults(), XilinxBackendFlow::CheckSynthesisResults(), get_used_resources(), XilinxBackendFlow::parse_DSPs(), XilinxBackendFlow::xparse_map_utilization(), and XilinxBackendFlow::xparse_xst_utilization().
|
protected |
debugging level of the class
Definition at line 111 of file BackendFlow.hpp.
Referenced by AlteraBackendFlow::AlteraBackendFlow(), BackendFlow(), BashBackendFlow::BashBackendFlow(), CreateScripts(), ExecuteSynthesis(), XilinxTasteBackendFlow::GenerateSynthesisScripts(), GenerateSynthesisScripts(), NanoXploreBackendFlow::InitDesignParameters(), XilinxBackendFlow::InitDesignParameters(), LatticeBackendFlow::LatticeBackendFlow(), NanoXploreBackendFlow::NanoXploreBackendFlow(), AlteraBackendFlow::WriteFlowConfiguration(), NanoXploreBackendFlow::WriteFlowConfiguration(), XilinxBackendFlow::XilinxBackendFlow(), and XilinxTasteBackendFlow::XilinxTasteBackendFlow().
|
protected |
map between the identifiers of the synthesis flows and the corresponding implementations
Definition at line 123 of file BackendFlow.hpp.
Referenced by AlteraBackendFlow::AlteraBackendFlow(), BashBackendFlow::BashBackendFlow(), LatticeBackendFlow::LatticeBackendFlow(), NanoXploreBackendFlow::NanoXploreBackendFlow(), and XilinxBackendFlow::XilinxBackendFlow().
|
protected |
set of design parameters to be set
Definition at line 141 of file BackendFlow.hpp.
Referenced by CreateScripts(), set_initial_parameters(), and xload().
|
protected |
information about the target device
Definition at line 126 of file BackendFlow.hpp.
Referenced by AlteraBackendFlow::AlteraBackendFlow(), BashBackendFlow::BashBackendFlow(), BashBackendFlow::CheckSynthesisResults(), XilinxBackendFlow::CheckSynthesisResults(), XilinxTasteBackendFlow::GenerateSynthesisScripts(), GenerateSynthesisScripts(), BashBackendFlow::InitDesignParameters(), AlteraBackendFlow::InitDesignParameters(), LatticeBackendFlow::InitDesignParameters(), NanoXploreBackendFlow::InitDesignParameters(), XilinxBackendFlow::InitDesignParameters(), LatticeBackendFlow::LatticeBackendFlow(), NanoXploreBackendFlow::NanoXploreBackendFlow(), BashBackendFlow::WriteFlowConfiguration(), XilinxBackendFlow::WriteFlowConfiguration(), XilinxBackendFlow::XilinxBackendFlow(), and xload().
|
protected |
string-based identifier of the flow
Definition at line 117 of file BackendFlow.hpp.
Referenced by AlteraBackendFlow::CheckSynthesisResults(), XilinxBackendFlow::CheckSynthesisResults(), XilinxTasteBackendFlow::GenerateSynthesisScripts(), GenerateSynthesisScripts(), get_flow_name(), parse_flow(), XilinxBackendFlow::parse_timing(), xload(), and XilinxBackendFlow::xparse_timing().
|
protected |
name of the synthesis script
Definition at line 150 of file BackendFlow.hpp.
Referenced by CreateScripts(), and ExecuteSynthesis().
|
protected |
name of the output directory
Definition at line 120 of file BackendFlow.hpp.
Referenced by BackendFlow(), LatticeBackendFlow::create_sdc(), AlteraBackendFlow::create_sdc(), BashBackendFlow::create_sdc(), and xload().
|
protected |
verbosity level of the class
Definition at line 114 of file BackendFlow.hpp.
Referenced by AlteraBackendFlow::AlteraBackendFlow(), BashBackendFlow::BashBackendFlow(), AlteraBackendFlow::CheckSynthesisResults(), LatticeBackendFlow::CheckSynthesisResults(), BashBackendFlow::CheckSynthesisResults(), NanoXploreBackendFlow::CheckSynthesisResults(), XilinxBackendFlow::CheckSynthesisResults(), XilinxBackendFlow::InitDesignParameters(), LatticeBackendFlow::LatticeBackendFlow(), NanoXploreBackendFlow::NanoXploreBackendFlow(), XilinxBackendFlow::parse_timing(), and XilinxBackendFlow::XilinxBackendFlow().
|
protected |
class containing all the parameters
Definition at line 108 of file BackendFlow.hpp.
Referenced by AlteraBackendFlow::AlteraBackendFlow(), BackendFlow(), BashBackendFlow::BashBackendFlow(), AlteraBackendFlow::CheckSynthesisResults(), LatticeBackendFlow::CheckSynthesisResults(), BashBackendFlow::CheckSynthesisResults(), NanoXploreBackendFlow::CheckSynthesisResults(), XilinxBackendFlow::CheckSynthesisResults(), XilinxBackendFlow::create_cf(), AlteraBackendFlow::create_sdc(), LatticeBackendFlow::create_sdc(), BashBackendFlow::create_sdc(), ExecuteSynthesis(), XilinxTasteBackendFlow::GenerateSynthesisScripts(), GenerateSynthesisScripts(), BashBackendFlow::InitDesignParameters(), LatticeBackendFlow::InitDesignParameters(), AlteraBackendFlow::InitDesignParameters(), NanoXploreBackendFlow::InitDesignParameters(), XilinxBackendFlow::InitDesignParameters(), LatticeBackendFlow::LatticeBackendFlow(), NanoXploreBackendFlow::NanoXploreBackendFlow(), XilinxBackendFlow::parse_timing(), LatticeBackendFlow::WriteFlowConfiguration(), AlteraBackendFlow::WriteFlowConfiguration(), NanoXploreBackendFlow::WriteFlowConfiguration(), XilinxBackendFlow::WriteFlowConfiguration(), XilinxBackendFlow::XilinxBackendFlow(), xload(), XilinxBackendFlow::xparse_map_utilization(), XilinxBackendFlow::xparse_timing(), and XilinxBackendFlow::xparse_xst_utilization().
|
protected |
root node of the configuration device
Definition at line 129 of file BackendFlow.hpp.
Referenced by parse_flow(), and xload().
|
protected |
ordered list of synthesis steps
Definition at line 138 of file BackendFlow.hpp.
Referenced by add_backend_step(), create_xml_scripts(), CreateScripts(), ExecuteSynthesis(), BashBackendFlow::InitDesignParameters(), NanoXploreBackendFlow::InitDesignParameters(), AlteraBackendFlow::InitDesignParameters(), LatticeBackendFlow::InitDesignParameters(), and XilinxBackendFlow::InitDesignParameters().
|
protected |
pointer to the data structure containing timing information
Definition at line 135 of file BackendFlow.hpp.
Referenced by AlteraBackendFlow::CheckSynthesisResults(), LatticeBackendFlow::CheckSynthesisResults(), BashBackendFlow::CheckSynthesisResults(), NanoXploreBackendFlow::CheckSynthesisResults(), XilinxBackendFlow::CheckSynthesisResults(), get_timing_results(), XilinxBackendFlow::parse_timing(), and XilinxBackendFlow::xparse_timing().
|
protected |
list of undefined parameters
Definition at line 144 of file BackendFlow.hpp.
Referenced by CreateScripts(), and set_initial_parameters().