PandA-2024.02
|
Class managing the module allocation. More...
#include <cdfc_module_binding.hpp>
Public Member Functions | |
cdfc_module_binding (const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, unsigned int funId, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization) | |
This is the constructor of the class. More... | |
~cdfc_module_binding () override | |
Destructor. More... | |
DesignFlowStep_Status | InternalExec () override |
Execute the step. More... | |
Public Member Functions inherited from fu_binding_creator | |
fu_binding_creator (const ParameterConstRef Param, const HLS_managerRef HLSMgr, unsigned int funId, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStep_Type hls_flow_step_type, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization=HLSFlowStepSpecializationConstRef()) | |
Constructor. More... | |
~fu_binding_creator () override | |
Destructor. More... | |
void | Initialize () override |
Initialize the step (i.e., like a constructor, but executed just before exec. More... | |
Public Member Functions inherited from HLSFunctionStep | |
HLSFunctionStep (const ParameterConstRef Param, const HLS_managerRef HLSMgr, unsigned int funId, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStep_Type hls_flow_step_type, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization=HLSFlowStepSpecializationConstRef()) | |
Constructor. More... | |
~HLSFunctionStep () override | |
Destructor. More... | |
bool | HasToBeExecuted () const override |
Check if this step has actually to be executed. More... | |
void | Initialize () override |
Initialize the step (i.e., like a constructor, but executed just before exec. More... | |
std::string | GetSignature () const final |
Return a unified identifier of this design step. More... | |
std::string | GetName () const final |
Return the name of this design step. More... | |
DesignFlowStep_Status | Exec () final |
Execute the step. More... | |
Public Member Functions inherited from HLS_step | |
HLS_step (const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStep_Type hls_flow_step_type, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization=HLSFlowStepSpecializationConstRef()) | |
Constructor. More... | |
~HLS_step () override | |
Destructor. More... | |
std::string | GetSignature () const override |
Return a unified identifier of this design step. More... | |
std::string | GetName () const override |
Return the name of this design step. More... | |
virtual std::string | GetKindText () const |
Return the name of the type of this frontend flow step. More... | |
DesignFlowStepFactoryConstRef | CGetDesignFlowStepFactory () const final |
Return the factory to create this type of steps. More... | |
void | ComputeRelationships (DesignFlowStepSet &design_flow_step_set, const DesignFlowStep::RelationshipType relationship_type) override |
Compute the relationships of a step with other steps. More... | |
Public Member Functions inherited from DesignFlowStep | |
DesignFlowStep (const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters) | |
Constructor. More... | |
virtual | ~DesignFlowStep () |
Destructor. More... | |
DesignFlowStep_Status | GetStatus () const |
Return the status of this design step. More... | |
virtual void | WriteDot (std::ostream &out) const |
Write the label for a dot graph. More... | |
bool | IsComposed () const |
Returns if this step is composed. More... | |
int | CGetDebugLevel () const |
Return the debug level of the step. More... | |
virtual void | PrintInitialIR () const |
Dump the initial intermediate representation. More... | |
virtual void | PrintFinalIR () const |
Dump the final intermediate representation. More... | |
Protected Member Functions | |
bool | false_loop_search (cdfc_vertex start, unsigned k, const cdfc_graphConstRef &cdfc, const cdfc_graphConstRef &cg, std::deque< cdfc_edge > &candidate_edges) |
bool | false_loop_search_cdfc_1 (cdfc_vertex src, unsigned int level, unsigned k, cdfc_vertex start, const cdfc_graphConstRef &cdfc, const cdfc_graphConstRef &cg, std::deque< cdfc_edge > &candidate_edges, std::vector< bool > &visited, std::vector< bool > &cg_visited, std::vector< bool > &cdfc_visited) |
bool | false_loop_search_cdfc_more (cdfc_vertex src, unsigned int level, unsigned k, cdfc_vertex start, const cdfc_graphConstRef &cdfc, const cdfc_graphConstRef &cg, std::deque< cdfc_edge > &candidate_edges, std::vector< bool > &visited, std::vector< bool > &cg_visited, std::vector< bool > &cdfc_visited) |
bool | can_be_clustered (vertex v, OpGraphConstRef fsdg, const fu_bindingConstRef fu, const CustomUnorderedMap< vertex, double > &slack_time, const double mux_time) |
int | weight_computation (bool cond1, bool cond2, vertex v1, vertex v2, const double mux_time, const OpGraphConstRef fdfg, const fu_bindingConstRef fu, const CustomUnorderedMap< vertex, double > &slack_time, CustomUnorderedMap< vertex, double > &starting_time, connection_relation &con_rel, double controller_delay, unsigned long long prec) |
void | update_slack_starting_time (const OpGraphConstRef fdfg, OpVertexSet &sorted_vertices, CustomUnorderedMap< vertex, double > &slack_time, CustomUnorderedMap< vertex, double > &starting_time, bool update_starting_time, bool only_backward, bool only_forward) |
void | initialize_connection_relation (connection_relation &con_rel, const OpVertexSet &all_candidate_vertices) |
Protected Member Functions inherited from fu_binding_creator | |
const CustomUnorderedSet< std::tuple< HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship > > | ComputeHLSRelationships (const DesignFlowStep::RelationshipType relationship_type) const override |
Compute the relationship of this step. More... | |
Protected Member Functions inherited from HLSFunctionStep | |
void | ComputeRelationships (DesignFlowStepSet &design_flow_step_set, const DesignFlowStep::RelationshipType relationship_type) override |
Compute the relationships of a step with other steps. More... | |
Protected Attributes | |
const double | small_normalized_resource_area |
Threshold used in sharing of functional units. More... | |
CustomUnorderedMap< vertex, bool > | can_be_clustered_table |
record if a vertex has to be clustered or not More... | |
CustomUnorderedMapUnstable< std::pair< vertex, unsigned int >, bool > | is_complex |
Protected Attributes inherited from HLSFunctionStep | |
std::map< unsigned int, unsigned int > | last_bb_ver |
last bb version of the called functions More... | |
std::map< unsigned int, unsigned int > | last_bitvalue_ver |
The version of bit value IR representation on which this step was applied. More... | |
const unsigned int | funId |
identifier of the function to be processed (0 means that it is a global step) More... | |
hlsRef | HLS |
HLS data structure of the function to be analyzed. More... | |
unsigned int | bb_version |
The version of bb intermediate representation on which this step was applied. More... | |
unsigned int | bitvalue_version |
The version of bitvalue on which this step was applied. More... | |
unsigned int | memory_version |
The version of memory representation on which this step was applied. More... | |
Protected Attributes inherited from HLS_step | |
const HLS_managerRef | HLSMgr |
information about all the HLS synthesis More... | |
const HLSFlowStep_Type | hls_flow_step_type |
The type of this step. More... | |
const HLSFlowStepSpecializationConstRef | hls_flow_step_specialization |
The information about specialization. More... | |
Protected Attributes inherited from DesignFlowStep | |
bool | composed |
True if this step represents a composition of design flow steps (e.g., a flow); must be set by specialized constructors. More... | |
const Wrefcount< const DesignFlowManager > | design_flow_manager |
The design flow manager. More... | |
const ParameterConstRef | parameters |
Set of input parameters. More... | |
int | debug_level |
The debug level. More... | |
const int | output_level |
The output level. More... | |
Static Protected Attributes | |
static const int | CD_EDGE = 1 |
static const int | COMPATIBILITY_EDGE = 2 |
Static Protected Attributes inherited from HLS_step | |
static CustomUnorderedMap< std::string, HLSFlowStep_Type > | command_line_name_to_enum |
Map hls step name to enum. More... | |
Additional Inherited Members | |
Public Types inherited from DesignFlowStep | |
enum | RelationshipType { DEPENDENCE_RELATIONSHIP, INVALIDATION_RELATIONSHIP, PRECEDENCE_RELATIONSHIP } |
The relationship type. More... | |
Static Public Member Functions inherited from HLSFunctionStep | |
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. More... | |
Static Public Member Functions inherited from HLS_step | |
static std::string | EnumToName (const HLSFlowStep_Type hls_flow_step_type) |
Given a HLS flow step type, return the name of the type. More... | |
static const std::string | ComputeSignature (const HLSFlowStep_Type hls_flow_step_type, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization) |
Compute the signature of a hls flow step. More... | |
Class managing the module allocation.
Definition at line 378 of file cdfc_module_binding.hpp.
cdfc_module_binding::cdfc_module_binding | ( | const ParameterConstRef | _parameters, |
const HLS_managerRef | HLSMgr, | ||
unsigned int | funId, | ||
const DesignFlowManagerConstRef | design_flow_manager, | ||
const HLSFlowStepSpecializationConstRef | hls_flow_step_specialization | ||
) |
This is the constructor of the class.
Definition at line 793 of file cdfc_module_binding.cpp.
References DesignFlowStep::debug_level, GET_CLASS, and ~cdfc_module_binding().
|
overridedefault |
|
protected |
Definition at line 2542 of file cdfc_module_binding.cpp.
References hls::allocation_information, can_be_clustered_table, OpGraph::CGetOpNodeInfo(), AllocationInformation::compute_normalized_area(), hls::functionId, AllocationInformation::get_correction_time(), GET_TYPE, AllocationInformation::get_worst_execution_time(), HLSFunctionStep::HLS, SCALAR, TYPE_ENTRY, TYPE_EXIT, TYPE_EXTERNAL, TYPE_GOTO, TYPE_IF, TYPE_LABEL, TYPE_MULTIIF, TYPE_PHI, TYPE_RET, TYPE_SWITCH, TYPE_VPHI, and USE.
Referenced by InternalExec(), and weight_computation().
|
protected |
Definition at line 2437 of file cdfc_module_binding.cpp.
References false_loop_search_cdfc_1(), and lenet_tvm::target.
Referenced by InternalExec().
|
protected |
Definition at line 2459 of file cdfc_module_binding.cpp.
References false_loop_search_cdfc_more(), and lenet_tvm::target.
Referenced by false_loop_search(), and false_loop_search_cdfc_more().
|
protected |
Definition at line 2494 of file cdfc_module_binding.cpp.
References COMPATIBILITY_EDGE, false_loop_search_cdfc_1(), and lenet_tvm::target.
Referenced by false_loop_search_cdfc_1().
|
protected |
Definition at line 220 of file cdfc_module_binding.cpp.
References FunctionBehavior::CGetOpGraph(), OpGraph::CGetOpNodeInfo(), tree_manager::CGetTreeNode(), DEBUG_LEVEL_VERY_PEDANTIC, FunctionBehavior::FDFG, GET_NAME, GET_TYPE, INDENT_DBG_MEX, tree_helper::is_parameter(), no_def, no_phi_chained, no_phi_no_chained, NULL_VERTEX, phi, STR, THROW_ASSERT, THROW_UNREACHABLE, and TYPE_PHI.
Referenced by InternalExec().
|
overridevirtual |
Execute the step.
compute non-shared resources
check easy binding and compute the list of vertices for which a sharing is possible
in case no vertices was left we have done
check for PHIs attached to the ouput. They may require one or more muxes.
rank property map definition
parent property map definition
merge easy bound vertices
add the vertices to the cdfc graph
add the control dependencies edges and the chained edges to the cdfc graph
only the chained operations are relevant
pipelined operations break false loops
add compatibility edge with computed weight on both the directions
compute levels
topologically sort vertex of CD_EDGE based graph
remove all cycles from the cdfc graph
remove the loop
remove both the compatibility edges
search another loop
partition vertices for clique covering or bind the easy functional units
check easy binding
solve the binding problem for all the partitions
build the clique covering solver
add vertex to the clique covering solver
add the edges
only one edge is needed to build the undirected compatibility graph
Specify the minimum number of resources in case we have to use all the memory ports. That is relevant for memories attached to the bus Private memories should use the minimum number of ports to minimize the total area.
performing clique covering
only one edge is needed to build the undirected compatibility graph
Specify the minimum number of resources in case we have to use all the memory ports. That is relevant for memories attached to the bus Private memories should use the minimum number of ports to minimize the total area.
retrieve the solution
compute maximum starting time
storing new binding results
Implements HLSFunctionStep.
Definition at line 932 of file cdfc_module_binding.cpp.
References abs, hls::allocation_information, liveness::are_in_conflict(), fu_binding::bind(), BIPARTITE_MATCHING, C, can_be_clustered(), CD_EDGE, FunctionBehavior::CGetBehavioralHelper(), OpGraph::CGetOperations(), FunctionBehavior::CGetOpGraph(), OpGraph::CGetOpNodeInfo(), hls::chaining_information, CLOCK_MARGIN, COMPATIBILITY_EDGE, compute_condition1(), compute_condition2(), AllocationInformation::compute_normalized_area(), fu_binding::create_fu_binding(), clique_covering< VertexType >::create_solver(), DesignFlowStep::debug_level, DEBUG_LEVEL_VERBOSE, DEBUG_LEVEL_VERY_PEDANTIC, delay(), DesignFlowStep::design_flow_manager, FunctionBehavior::DFG, DFG_SCA_SELECTOR, edges, AllocationInformation::estimate_mux_area(), AllocationInformation::estimate_mux_time(), AllocationInformation::EstimateControllerDelay(), false_loop_search(), FunctionBehavior::FDFG, from_strongtype_cast(), FunctionBehavior::FSDG, hls::functionId, HLSFunctionStep::funId, AllocationInformation::get_area(), fu_binding::get_assign(), Schedule::get_cstep(), Schedule::get_cstep_end(), AllocationInformation::get_cycles(), AllocationInformation::get_DSPs(), Schedule::get_fo_correction(), AllocationInformation::get_fu_name(), BehavioralHelper::get_function_name(), fu_binding::get_index(), AllocationInformation::get_initiation_time(), AllocationInformation::get_memory_var(), GET_NAME, AllocationInformation::get_number_channels(), AllocationInformation::get_number_fu(), AllocationInformation::get_prec(), AllocationInformation::get_proxy_memory_var(), ChainingInformation::get_representative_in(), AllocationInformation::get_setup_hold_time(), liveness::get_state_where_run(), AllocationInformation::get_string_name(), tree_manager::get_tree_node_const(), GET_TYPE, Schedule::GetEndingTime(), graph::GetSelector(), Schedule::GetStartingTime(), HLSFunctionStep::HLS, hls::HLS_C, hls::HLS_D, HLS_step::hls_flow_step_specialization, HLS_step::HLSMgr, INDENT_DBG_MEX, INDENT_OUT_MEX, index, INFINITE_UINT, initialize_connection_relation(), AllocationInformation::is_direct_access_memory_unit(), AllocationInformation::is_memory_unit(), AllocationInformation::is_one_cycle_direct_access_memory_unit(), AllocationInformation::is_proxy_unit(), AllocationInformation::is_readonly_memory_unit(), AllocationInformation::is_vertex_bounded(), k, Wrefcount< T >::lock(), max, ChainingInformation::may_be_chained_ops(), min, MODULE_BINDING_MUX_MARGIN, NULL_VERTEX, OP_THRESHOLD, DesignFlowStep::output_level, OUTPUT_LEVEL_MINIMUM, OUTPUT_LEVEL_PEDANTIC, OUTPUT_LEVEL_VERBOSE, OUTPUT_LEVEL_VERY_PEDANTIC, DesignFlowStep::parameters, print_cpu_time(), PRINT_DBG_MEX, PROXY_LIBRARY, test_panda::restart, hls::Rfu, hls::Rliv, hls::Rsch, FunctionBehavior::SDG, liveness::set_HLS(), small_normalized_resource_area, START_TIME, STOP_TIME, STR, SUCCESS, lenet_tvm::target, THROW_ASSERT, THROW_ERROR, topological_based_sorting(), graph::TopologicalSort(), tree_node::ToString(), TYPE_ENTRY, TYPE_EXIT, TYPE_GOTO, TYPE_LABEL, TYPE_PHI, TYPE_RET, TYPE_SWITCH, TYPE_VPHI, update_slack_starting_time(), weight_computation(), WEIGHTED_CLIQUE_REGISTER_BINDING, WEIGHTED_COLORING, and WORK_LIBRARY.
|
protected |
Definition at line 810 of file cdfc_module_binding.cpp.
References OpGraph::CGetInEdges(), OpGraph::CGetOutEdges(), hls::chaining_information, DesignFlowStep::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, DFG_SCA_SELECTOR, GET_NAME, ChainingInformation::get_representative_in(), graph::GetSelector(), HLSFunctionStep::HLS, HLS_step::HLSMgr, INDENT_DBG_MEX, INDENT_OUT_MEX, ChainingInformation::may_be_chained_ops(), NULL_VERTEX, STR, and lenet_tvm::target.
Referenced by InternalExec().
|
protected |
Definition at line 2632 of file cdfc_module_binding.cpp.
References can_be_clustered(), OpGraph::CGetOpNodeInfo(), DesignFlowStep::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_NAME, HLSFunctionStep::HLS, HLS_step::HLSMgr, INDENT_DBG_MEX, max, and STR.
Referenced by InternalExec().
|
protected |
record if a vertex has to be clustered or not
Definition at line 417 of file cdfc_module_binding.hpp.
Referenced by can_be_clustered().
|
staticprotected |
Definition at line 413 of file cdfc_module_binding.hpp.
Referenced by InternalExec().
|
staticprotected |
Definition at line 414 of file cdfc_module_binding.hpp.
Referenced by false_loop_search_cdfc_more(), and InternalExec().
|
protected |
Definition at line 418 of file cdfc_module_binding.hpp.
|
protected |
Threshold used in sharing of functional units.
Definition at line 382 of file cdfc_module_binding.hpp.
Referenced by compute_condition2(), and InternalExec().