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

#include <BackendFlow.hpp>

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

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_elementroot
 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< BackendStepRefsteps
 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...
 

Detailed Description

Definition at line 90 of file BackendFlow.hpp.

Member Typedef Documentation

◆ type_t

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.

Constructor & Destructor Documentation

◆ BackendFlow()

BackendFlow::BackendFlow ( const ParameterConstRef  Param,
std::string  flow_name,
const generic_deviceRef  _device 
)

Constructor.

Parameters
Paramis the reference to the class containing all the parameters
flow_nameis a string representing the name of the flow
targetis 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().

Here is the call graph for this function:

◆ ~BackendFlow()

BackendFlow::~BackendFlow ( )
virtualdefault

Destructor.

Referenced by BackendFlow().

Here is the caller graph for this function:

Member Function Documentation

◆ add_backend_step()

void BackendFlow::add_backend_step ( const BackendStepRef step)

Adds a backend step to the list of the ones to be performed.

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

Here is the caller graph for this function:

◆ CheckSynthesisResults()

virtual void BackendFlow::CheckSynthesisResults ( )
protectedpure virtual

Checks the synthesis results and fills the corresponding data structures.

Implemented in XilinxBackendFlow, NanoXploreBackendFlow, BashBackendFlow, AlteraBackendFlow, and LatticeBackendFlow.

Referenced by ExecuteSynthesis().

Here is the caller graph for this function:

◆ create_xml_scripts()

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

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

◆ CreateFlow()

BackendFlowRef BackendFlow::CreateFlow ( const ParameterConstRef  Param,
const std::string &  flow_name,
const generic_deviceRef  _device 
)
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().

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

◆ CreateScripts()

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

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

◆ DetermineBackendFlowType()

BackendFlow::type_t BackendFlow::DetermineBackendFlowType ( const generic_deviceRef  device,
const ParameterConstRef  parameters 
)
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().

Here is the caller graph for this function:

◆ Execute()

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.

◆ ExecuteSynthesis()

void BackendFlow::ExecuteSynthesis ( )
virtual

◆ GenerateSynthesisScripts()

std::string BackendFlow::GenerateSynthesisScripts ( const std::string &  fu_name,
const structural_managerRef  SM,
const std::list< std::string > &  hdl_files,
const std::list< std::string > &  aux_files 
)
virtual

◆ get_flow_name()

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

Here is the caller graph for this function:

◆ get_timing_results()

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

Here is the caller graph for this function:

◆ get_used_resources()

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

Here is the caller graph for this function:

◆ InitDesignParameters()

void BackendFlow::InitDesignParameters ( )
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().

Here is the caller graph for this function:

◆ parse_flow()

void BackendFlow::parse_flow ( const XMLDomParserRef  parser)

Creates the synthesis flow based on the user's requirements.

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

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

◆ ParseBackendFlow()

void BackendFlow::ParseBackendFlow ( const std::string &  flow_name)
protected

Parses the description of the backend flow given its identifier.

Parameters
flow_nameis the string that represents the identifier of the flow

◆ set_initial_parameters()

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.

◆ set_parameters()

void BackendFlow::set_parameters ( const DesignParametersRef _flow_parameters)

Sets actual parameters.

◆ WriteFlowConfiguration()

virtual void BackendFlow::WriteFlowConfiguration ( std::ostream &  script)
protectedpure virtual

Writes the proper flow configuration in the output script.

Implemented in XilinxBackendFlow, NanoXploreBackendFlow, BashBackendFlow, AlteraBackendFlow, and LatticeBackendFlow.

Referenced by CreateScripts().

Here is the caller graph for this function:

◆ xload()

void BackendFlow::xload ( const xml_element node)
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().

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

Field Documentation

◆ actual_parameters

DesignParametersRef BackendFlow::actual_parameters
protected

◆ area_m

area_infoRef BackendFlow::area_m
protected

◆ debug_level

int BackendFlow::debug_level
protected

◆ default_data

std::map<std::string, std::string> BackendFlow::default_data
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().

◆ default_flow_parameters

DesignParametersRef BackendFlow::default_flow_parameters
protected

set of design parameters to be set

Definition at line 141 of file BackendFlow.hpp.

Referenced by CreateScripts(), set_initial_parameters(), and xload().

◆ device

const generic_deviceRef BackendFlow::device
protected

◆ flow_name

std::string BackendFlow::flow_name
protected

◆ generated_synthesis_script

std::string BackendFlow::generated_synthesis_script
protected

name of the synthesis script

Definition at line 150 of file BackendFlow.hpp.

Referenced by CreateScripts(), and ExecuteSynthesis().

◆ out_dir

std::string BackendFlow::out_dir
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().

◆ output_level

unsigned int BackendFlow::output_level
protected

◆ Param

const ParameterConstRef BackendFlow::Param
protected

◆ root

xml_element* BackendFlow::root
protected

root node of the configuration device

Definition at line 129 of file BackendFlow.hpp.

Referenced by parse_flow(), and xload().

◆ steps

std::vector<BackendStepRef> BackendFlow::steps
protected

◆ time_m

time_infoRef BackendFlow::time_m
protected

◆ undefined_parameters

CustomOrderedSet<std::string> BackendFlow::undefined_parameters
protected

list of undefined parameters

Definition at line 144 of file BackendFlow.hpp.

Referenced by CreateScripts(), and set_initial_parameters().


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

Generated on Mon Feb 12 2024 13:03:44 for PandA-2024.02 by doxygen 1.8.13