62 const DesignFlowManagerConstRef _design_flow_manager,
const ParameterConstRef _parameters)
64 restart_ifmwi_opt(
false)
75 switch(relationship_type)
79 relationships.insert(std::make_pair(DEAD_CODE_ELIMINATION_IPA,
WHOLE_APPLICATION));
88 relationships.insert(std::make_pair(SHORT_CIRCUIT_TAF,
SAME_FUNCTION));
90 relationships.insert(std::make_pair(MULTI_WAY_IF,
SAME_FUNCTION));
91 relationships.insert(std::make_pair(UPDATE_SCHEDULE,
SAME_FUNCTION));
98 relationships.insert(std::make_pair(SHORT_CIRCUIT_TAF,
SAME_FUNCTION));
100 relationships.insert(std::make_pair(MULTI_WAY_IF,
SAME_FUNCTION));
101 relationships.insert(std::make_pair(UPDATE_SCHEDULE,
SAME_FUNCTION));
109 return relationships;
119 GetPointer<const HLS_manager>(
AppM) and GetPointer<const HLS_manager>(
AppM)->get_HLS(
function_id) and
131 auto*
sl = GetPointer<statement_list>(
GET_NODE(fd->body));
132 std::map<unsigned int, blocRef>& list_of_bloc = sl->list_of_bloc;
137 THROW_ASSERT(sdc_scheduling_step,
"SDC scheduling hls step not found");
138 const auto sdc_scheduling = GetPointer<const SDCScheduling>(
139 design_flow_graph->CGetDesignFlowStepInfo(sdc_scheduling_step)->design_flow_step);
140 const auto& movements_list = sdc_scheduling->movements_list;
141 if(movements_list.empty())
145 for(
const auto& movement : movements_list)
147 const auto statement_index = movement[0];
148 const auto old_basic_block = movement[1];
149 const auto new_basic_block = movement[2];
150 THROW_ASSERT(list_of_bloc.find(old_basic_block) != list_of_bloc.end() &&
151 list_of_bloc.find(new_basic_block) != list_of_bloc.end(),
152 "unexpected condition: BB are missing");
155 " to BB" +
STR(new_basic_block));
156 if(not
AppM->ApplyNewTransformation())
159 "<--Skipped because reached limit of cfg transformations");
162 list_of_bloc.at(old_basic_block)->RemoveStmt(TM->
GetTreeReindex(statement_index),
AppM);
163 if(list_of_bloc.at(old_basic_block)->CGetStmtList().empty() &&
164 list_of_bloc.at(old_basic_block)->CGetPhiList().empty())
168 list_of_bloc.at(new_basic_block)->PushBack(TM->
GetTreeReindex(statement_index),
AppM);
#define GET_NODE(t)
Macro used to hide implementation details when accessing a tree_node from another tree_node...
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
Data structure representing the entire HLS information.
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
DesignFlowStep_Status InternalExec() override
Performs the loops analysis.
File containing functions and utilities to support the printing of debug messagges.
Step successfully executed.
const CustomUnorderedSet< std::pair< FrontendFlowStepType, FunctionRelationship > > ComputeFrontendRelationships(const DesignFlowStep::RelationshipType relationship_type) const override
Return the set of analyses in relationship with this design step.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
std::string GetName() const override
Return the name of this design step.
RelationshipType
The relationship type.
Source must be executed to satisfy target.
~SDCCodeMotion() override
Destructor.
Data structure describing a basic block at tree level.
static std::string ComputeSignature(const HLSFlowStep_Type hls_flow_step_type, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization, const unsigned int function_id)
Compute the signature of a hls flow step.
unsigned int bb_version
The version of the basic block intermediate representation on which this step has been applied...
const tree_nodeConstRef CGetTreeNode(const unsigned int i) const
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
const tree_nodeRef get_tree_node_const(unsigned int i) const
Return the reference to the i-th tree_node Constant version of get_tree_node.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
SDCCodeMotion(const application_managerRef AppM, unsigned int function_id, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
Constructor.
Factory for hls flow step.
Classes to describe design flow graph.
Target must be reexecuted.
tree_nodeRef GetTreeReindex(const unsigned int i)
Return a tree_reindex wrapping the i-th tree_node.
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
Class definition of the sdc scheduling.
DesignFlowStep_Status GetStatus() const
Return the status of this design step.
Classes specification of the tree_node data structures.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
#define DEBUG_LEVEL_NONE
no debugging print is performed.
This file collects some utility functions.
refcount< T > lock() const
const unsigned int function_id
The index of the function to be analyzed.
Analysis step that performs some simple code motions over the IR.
Analysis step performing code motion speculation on the basis of sdc results.
const application_managerRef AppM
The application manager.
Class specification of the tree_reindex support class.
Class specification of the basic_block structure.
This class contains the methods to create a frontend flow step.
Data structures used in operations graph.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
this class is used to manage the command-line or XML options.
int debug_level
The debug level.
refcount< const HLSFlowStepSpecialization > HLSFlowStepSpecializationConstRef
const refcount definition of the class
Data structure definition for high-level synthesis flow.
Class specification of the manager of the tree structures extracted from the raw file.
A brief description of the C++ Header File.
const FunctionBehaviorRef function_behavior
The function behavior of the function to be analyzed.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...