73 : clique_covering_algorithm(_clique_covering_algorithm)
89 const DesignFlowManagerConstRef _design_flow_manager,
93 _hls_flow_step_specialization ?
94 _hls_flow_step_specialization :
110 const auto FB =
HLSMgr->CGetFunctionBehavior(
funId);
116 const auto clique_covering_algorithm =
118 ->clique_covering_algorithm;
123 size_t vertex_index = 0;
124 unsigned int num_registers = 0;
125 for(
const auto v :
verts)
127 register_clique->add_vertex(v,
STR(vertex_index++));
134 unsigned current_partition = 0;
135 for(
auto vState : support)
141 register_clique->add_subpartitions(current_partition, verts[sv]);
147 BOOST_FOREACH(compatibility_graph::edge_descriptor e,
boost::edges(*
CG))
149 const auto src = boost::source(e, *
CG);
151 register_clique->add_edge(src, tgt, (*
CG)[e].weight);
153 if(
parameters->getOption<
bool>(OPT_print_dot))
155 const auto functionName = FB->CGetBehavioralHelper()->get_function_name();
156 const auto output_directory =
parameters->getOption<std::string>(OPT_dot_directory) +
"/" + functionName +
"/";
157 if(!std::filesystem::exists(output_directory))
159 std::filesystem::create_directories(output_directory);
161 const auto file_name = output_directory +
"HLS_RegisterBinding.dot";
162 register_clique->writeDot(file_name);
170 num_registers =
static_cast<unsigned int>(register_clique->num_vertices());
171 for(
unsigned int i = 0; i < num_registers; ++i)
173 for(
const auto v : register_clique->get_clique(i))
185 HLS->
Rreg->
bind(storage_value_index, v2c[verts[storage_value_index]]);
205 "-->Register binding information for function " + FB->CGetBehavioralHelper()->get_function_name() +
208 std::string(
"---Register allocation algorithm obtains ") +
210 " result: " +
STR(num_registers) +
" registers" +
219 "Time to perform register binding: " +
print_cpu_time(step_time) +
" seconds");
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
Class specification to contain liveness information.
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Data structure representing the entire HLS information.
Module binding based on the analysis of the control data flow chained graph.
This header file includes four different algorithms heuristically solving the clique covering problem...
const CliqueCovering_Algorithm clique_covering_algorithm
The algorithm to be used.
Weighted clique covering register allocation procedure.
const int output_level
The output level.
compatibility_graph * CG
compatibility graph
#define INDENT_OUT_MEX(outLevel, curOutLevel, mex)
void set_used_regs(unsigned int regs)
sets number of used register
const unsigned int funId
identifier of the function to be processed (0 means that it is a global step)
void bind(unsigned int sv, unsigned int index)
CliqueCovering_Algorithm
Defines all clique covering algorithm.
std::vector< CG_vertex_descriptor > verts
ordered vector containing the vertices of the compatibility graph
#define OUTPUT_LEVEL_MINIMUM
minimum debugging print is performed.
Include a set of utilities used to manage CPU time measures.
#define STR(s)
Macro which performs a lexical_cast to a string.
static reg_bindingRef create_reg_binding(const hlsRef &HLS, const HLS_managerRef HLSMgr_)
DesignFlowStep_Status RegisterBinding() final
const std::list< vertex > & get_support() const
return the support set of the live in/out
#define START_TIME(time_var)
Macro used to store the start time into time_var.
Data structure used to store the register binding of variables.
StorageValueInformationRef storage_value_information
data-structure for storage values
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
static const uint32_t k[]
static refcount< clique_covering< VertexType > > create_solver(CliqueCovering_Algorithm solver, unsigned int nvert)
Creates a reference to desired solver.
#define STOP_TIME(time_var)
Macro used to store the elapsed time into time_var.
weighted_clique_register(const ParameterConstRef _Param, const HLS_managerRef _HLSMgr, unsigned int _funId, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization)
Constructor of the class.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
reg_bindingRef Rreg
Store the refcounted register binding of the variables.
unsigned int register_lower_bound
lower bound
livenessRef Rliv
data-structure containing the variable liveness
std::string print_cpu_time(long int t)
massage a long which represents a time interval in milliseconds, into a string suitable for output ...
virtual void print() const
Function that prints the class variable2obj.
const std::string CliqueCovering_AlgorithmToString(const CliqueCovering_Algorithm clique_covering_algorithm)
Header include.
#define OUTPUT_LEVEL_PEDANTIC
verbose debugging print is performed.
#define OUTPUT_LEVEL_VERY_PEDANTIC
verbose debugging print is performed.
hlsRef HLS
HLS data structure of the function to be analyzed.
WeightedCliqueRegisterBindingSpecialization(const CliqueCovering_Algorithm clique_covering_algorithm)
Constructor.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
std::string GetKindText() const override
Return the string representation of this.
this class is used to manage the command-line or XML options.
std::string GetSignature() const override
Return the contribution to the signature of a step given by the specialization.
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
void create_compatibility_graph()
Creates the compatibility graph.
Data structure definition for high-level synthesis flow.
const HLSFlowStepSpecializationConstRef hls_flow_step_specialization
The information about specialization.
~weighted_clique_register() override
const CustomOrderedSet< unsigned int > & get_live_in(const vertex &v) const
Get the set of variables live at the input of a vertex.