PandA-2024.02
unique_binding_register.cpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2004-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
43 
44 #include "hls.hpp"
45 #include "hls_manager.hpp"
46 
47 #include "liveness.hpp"
48 #include "reg_binding.hpp"
49 
50 #include "Parameter.hpp"
51 #include "dbgPrintHelper.hpp"
52 
55 
57 #include "behavioral_helper.hpp"
58 
60 #include "cpu_time.hpp"
61 
63  unsigned int _funId,
64  const DesignFlowManagerConstRef _design_flow_manager)
65  : reg_binding_creator(_Param, _HLSMgr, _funId, _design_flow_manager, HLSFlowStep_Type::UNIQUE_REGISTER_BINDING)
66 {
67 }
68 
70 
72 {
73  long step_time = 0;
75  {
76  START_TIME(step_time);
77  }
78  THROW_ASSERT(HLS->Rliv, "Liveness analysis not yet computed");
80  for(unsigned int sv = 0; sv < HLS->storage_value_information->get_number_of_storage_values(); sv++)
81  {
82  HLS->Rreg->bind(sv, sv);
83  }
86  {
87  STOP_TIME(step_time);
88  }
90  {
92  }
94  "-->Register binding information for function " +
95  HLSMgr->CGetFunctionBehavior(funId)->CGetBehavioralHelper()->get_function_name() + ":");
97  {
98  HLS->Rreg->print();
99  }
101  {
103  "Time to perform register binding: " + print_cpu_time(step_time) + " seconds");
104  }
107  {
109  }
111 }
Class specification to contain liveness information.
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Definition: hls_step.hpp:205
Data structure representing the entire HLS information.
File containing functions and utilities to support the printing of debug messagges.
refcount< reg_binding > reg_bindingRef
RefCount type definition of the reg_binding class structure.
const int output_level
The output level.
Class managing the register binding.
Definition: reg_binding.hpp:70
#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)
#define OUTPUT_LEVEL_MINIMUM
minimum debugging print is performed.
Include a set of utilities used to manage CPU time measures.
unique_binding_register(const ParameterConstRef Param, const HLS_managerRef HLSMgr, unsigned int funId, const DesignFlowManagerConstRef design_flow_manager)
Constructor of the class.
#define START_TIME(time_var)
Macro used to store the start time into time_var.
Definition: cpu_time.hpp:133
Data structure used to store the register binding of variables.
StorageValueInformationRef storage_value_information
data-structure for storage values
Definition: hls.hpp:130
HLSFlowStep_Type
Definition: hls_step.hpp:95
#define STOP_TIME(time_var)
Macro used to store the elapsed time into time_var.
Definition: cpu_time.hpp:136
Generic class managing the different register allocation algorithms.
DesignFlowStep_Status
The status of a step.
reg_bindingRef Rreg
Store the refcounted register binding of the variables.
Definition: hls.hpp:133
This package is used to define the storage value scheme adopted by the register allocation algorithms...
livenessRef Rliv
data-structure containing the variable liveness
Definition: hls.hpp:127
std::string print_cpu_time(long int t)
massage a long which represents a time interval in milliseconds, into a string suitable for output ...
Definition: cpu_time.hpp:110
virtual void print() const
Function that prints the class variable2obj.
Definition: Variable.hpp:82
#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.
Class specification of unique binding register allocation algorithm.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
this class is used to manage the command-line or XML options.
unsigned int get_number_of_storage_values() const
Returns the number of storage values inserted.
Data structure definition for high-level synthesis flow.
DesignFlowStep_Status RegisterBinding() final
~unique_binding_register() override
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...
Definition: exceptions.hpp:289

Generated on Mon Feb 12 2024 13:02:53 for PandA-2024.02 by doxygen 1.8.13