PandA-2024.02
allocation_information.hpp
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  */
41 #ifndef ALLOCATION_SOLUTION_HPP
42 #define ALLOCATION_SOLUTION_HPP
43 
45 #include "hls_function_ir.hpp"
46 
47 #include "graph.hpp" // for vertex
48 #include "hash_helper.hpp"
49 #include "hls_manager.hpp" // for HLS_manager, HLS_manager::io_binding_type
50 #include "op_graph.hpp" // for OpGraphConstRef
51 #include "refcount.hpp" // for CONSTREF_FORWARD_DECL, REF_FORWARD_DECL
52 #include "schedule.hpp"
53 #include "strong_typedef.hpp" // for UINT_STRONG_TYPEDEF_FORWARD_DECL
54 
55 #include <cstddef> // for size_t
56 #include <iosfwd> // for ostream
57 #include <string> // for string
58 #include <utility> // for pair
59 
68 enum class Allocation_MinMax;
75 struct operation;
76 
78 #define GIMPLE_RETURN_STD "gimple_return_FU"
79 #define GIMPLE_PHI_STD "gimple_phi_FU"
80 #define GIMPLE_ASM_STD "gimple_asm_FU"
81 #define GIMPLE_LABEL_STD "gimple_label_FU"
82 #define GIMPLE_GOTO_STD "gimple_goto_FU"
83 #define GIMPLE_NOP_STD "gimple_nop_FU"
84 #define GIMPLE_PRAGMA_STD "gimple_pragma_FU"
85 #define READ_COND_STD "read_cond_FU"
86 #define MULTI_READ_COND_STD "multi_read_cond_FU"
87 #define SWITCH_COND_STD "switch_cond_FU"
88 #define ENTRY_STD "entry_FU"
89 #define EXIT_STD "exit_FU"
90 #define NOP_STD "nop_FU"
91 
92 #define ALLOCATION_MUX_MARGIN 1.0
93 
95 {
96  private:
97  friend class allocation;
99 
102 
105 
108 
111 
113 
116 
118 
121 
124 
127 
129  size_t max_fanout_size{0};
130 
132  double DSPs_margin;
133 
136 
139 
142 
144  HLS_constraintsConstRef HLS_C;
145 
147  HLS_deviceConstRef HLS_D;
148 
151 
153  memoryConstRef Rmem;
154 
155  const unsigned int& address_bitsize;
156 
159 
161  double minimumSlack;
162 
164  unsigned int n_complex_operations{0};
165 
168 
171 
173  std::vector<technology_nodeRef> list_of_FU;
174 
176  std::map<unsigned int, unsigned int> memory_units;
177 
179  std::map<unsigned int, unsigned int> nports_map;
180 
182  std::map<unsigned int, unsigned long long> precision_map;
183 
185  std::map<unsigned int, std::string> proxy_function_units;
186 
188  std::map<unsigned int, unsigned int> proxy_memory_units;
189 
191  std::map<unsigned int, std::string> proxy_wrapped_units;
192 
194  std::vector<unsigned int> tech_constraints;
195 
198 
201 
207 
209  std::map<unsigned int, unsigned long long> memory_units_sizes;
210 
212  std::map<unsigned int, unsigned int> vars_to_memory_units;
213 
215  std::map<std::string, std::string> precomputed_pipeline_unit;
216 
219 
222 
225 
228 
231 
234 
237 
240 
243 
246 
248  std::vector<unsigned int> DSP_x_db;
249 
251  std::vector<unsigned int> DSP_y_db;
252 
254  std::map<unsigned int, std::string> sync_ram_var_latency;
255 
256  std::string get_latency_string(const std::string& lat) const;
257 
259  double time_m_execution_time(operation* op) const;
260 
262  double time_m_stage_period(operation* op) const;
263 
264  double get_execution_time_dsp_modified(const unsigned int fu_name, const technology_nodeRef& node_op) const;
265 
266  double get_stage_period_dsp_modified(const unsigned int fu_name, const technology_nodeRef& node_op) const;
267 
273  double get_worst_stage_period(const unsigned int fu_name) const;
274 
280  void set_number_channels(unsigned int fu_name, unsigned int n_ports);
281 
289  void GetNodeTypePrec(const vertex node, const OpGraphConstRef g, node_kind_prec_infoRef info,
290  HLS_manager::io_binding_type& constant_id, bool is_constrained) const;
291 
296  static technology_nodeRef get_fu(const std::string& fu_name, const HLS_managerConstRef hls_manager);
297 
303  double GetPhiConnectionLatency(const unsigned int statement_index) const;
304 
311  bool CanBeMerged(const unsigned int first_operation, const unsigned int second_operation) const;
312 
319  CustomSet<unsigned int> ComputeRoots(const unsigned int ssa, const AbsControlStep cs) const;
320 
326  CustomSet<unsigned int> ComputeDrivenCondExpr(const unsigned int ssa) const;
327 
333  static const std::pair<const CustomMap<unsigned long long, CustomUnorderedMapStable<unsigned int, double>>&,
335  InitializeMuxDB(const AllocationInformationConstRef allocation_information);
336 
341  static const std::tuple<const std::vector<unsigned int>&, const std::vector<unsigned int>&>
342  InitializeDSPDB(const AllocationInformationConstRef allocation_information);
343 
349  double GetToDspRegisterDelay(const unsigned int statement_index) const;
350 
356  CustomSet<unsigned int> GetZeroDistanceOperations(const unsigned int statement_index) const;
357 
358  public:
367  AllocationInformation(const HLS_managerRef _hls_manager, const unsigned int _function_index,
369 
373  void Initialize() override;
374 
378  void Clear() override;
379 
381  {
385  };
387 
391  ~AllocationInformation() override;
392 
399  const CustomOrderedSet<unsigned int>& can_implement_set(const unsigned int v) const;
400 
405  bool CanImplementSetNotEmpty(const unsigned int v) const;
406 
411  std::pair<std::string, std::string> get_fu_name(unsigned int id) const;
412 
418  unsigned int get_number_fu(unsigned int fu_name) const;
419 
424  unsigned int get_number_fu_types() const;
425 
433  double get_execution_time(const unsigned int fu_name, const vertex v, const OpGraphConstRef g) const;
434  double get_execution_time(const unsigned int fu_name, const unsigned int v) const;
435 
442  ControlStep op_et_to_cycles(double et, double clock_period) const;
443 
451  unsigned int max_number_of_resources(const vertex v) const;
452 
458  unsigned int max_number_of_operations(unsigned int fu) const;
459 
479  double get_attribute_of_fu_per_op(const vertex v, const OpGraphConstRef g,
480  const Allocation_MinMax allocation_min_max, op_target target,
481  unsigned int& fu_name, bool& flag,
482  const updatecopy_HLS_constraints_functor* CF = nullptr) const;
483 
498  double get_attribute_of_fu_per_op(const vertex v, const OpGraphConstRef g,
499  const Allocation_MinMax allocation_min_max, op_target target) const;
500 
508  unsigned int min_number_of_resources(const vertex v) const;
509 
513  double get_setup_hold_time() const;
514 
520  bool is_indirect_access_memory_unit(unsigned int fu) const;
521 
527  double get_worst_execution_time(const unsigned int fu_name) const;
528 
534  double get_area(const unsigned int fu_name) const;
535 
541  double GetStatementArea(const unsigned int statement_index) const;
542 
548  unsigned long long get_prec(const unsigned int fu_name) const;
549 
554  double get_DSPs(const unsigned int fu_name) const;
555 
562  ControlStep get_initiation_time(const unsigned int fu_name, const vertex v) const;
563 
570  ControlStep get_initiation_time(const unsigned int fu_name, const unsigned int statement_index) const;
571 
579  bool is_operation_bounded(const OpGraphConstRef g, const vertex& op, unsigned int fu_type) const;
580 
587  bool is_operation_bounded(const unsigned int index, unsigned int fu_type) const;
588 
594  bool is_operation_bounded(const unsigned int index) const;
595 
603  bool is_operation_PI_registered(const OpGraphConstRef g, const vertex& op, unsigned int fu_type) const;
604 
611  bool is_operation_PI_registered(const unsigned int index, unsigned int fu_type) const;
612 
618  bool is_operation_PI_registered(const unsigned int index) const;
619 
625  bool is_direct_access_memory_unit(unsigned int fu_type) const;
626 
632  bool is_dual_port_memory(unsigned int fu_type) const;
633 
639  bool is_direct_proxy_memory_unit(unsigned int fu_type) const;
640 
646  bool is_read_cond(const unsigned int fu_name) const;
647 
653  bool is_assign(const unsigned int fu_name) const;
654 
660  bool is_return(const unsigned int fu_name) const;
661 
667  bool is_memory_unit(const unsigned int fu_name) const;
668 
674  bool is_proxy_unit(const unsigned int fu_name) const;
675 
681  bool is_proxy_function_unit(const unsigned int fu_name) const;
682 
688  bool is_proxy_wrapped_unit(const unsigned int fu_name) const;
689 
695  unsigned int get_memory_var(const unsigned int fu_name) const;
696 
701  const std::map<unsigned int, unsigned int>& get_proxy_memory_units() const;
702 
708  unsigned int get_proxy_memory_var(const unsigned int fu_name) const;
709 
714  const std::map<unsigned int, std::string>& get_proxy_function_units() const;
715 
720  const std::map<unsigned int, std::string>& get_proxy_wrapped_units() const;
721 
729  double get_stage_period(const unsigned int fu_name, const vertex v, const OpGraphConstRef g) const;
730  double get_stage_period(const unsigned int fu_name, const unsigned int v) const;
731 
738  double get_correction_time(unsigned int fu, const std::string& operation_name, unsigned int n_ins) const;
739 
745  double estimate_mux_time(unsigned int fu_name) const;
746 
752  double estimate_muxNto1_delay(unsigned long long fu_prec, unsigned int mux_ins) const;
753 
759  double estimate_muxNto1_area(unsigned long long fu_prec, unsigned int mux_ins) const;
760 
761  double mux_time_unit(unsigned long long fu_prec) const;
762  double mux_time_unit_raw(unsigned long long fu_prec) const;
763 
771  unsigned int get_cycles(const unsigned int fu_name, const unsigned int v) const;
772  unsigned int get_cycles(const unsigned int fu_name, const vertex v, const OpGraphConstRef g) const;
773 
779  bool is_vertex_bounded_with(const unsigned int v, unsigned int& fu_name) const;
780  bool is_vertex_bounded_with(const vertex v, unsigned int& fu_name) const;
781 
787  bool is_vertex_bounded(const unsigned int fu_name) const;
788 
794  technology_nodeRef get_fu(unsigned int fu_name) const;
795 
801  unsigned int get_number_channels(unsigned int fu_name) const;
802 
807  double EstimateControllerDelay() const;
808 
813  double estimate_controller_delay_fb() const;
814 
820  std::string get_string_name(unsigned int fu_name) const;
821 
827  double compute_normalized_area(unsigned int fu_s1) const;
828 
832  std::map<unsigned int, unsigned int> get_memory_units() const;
833 
839  bool has_to_be_synthetized(const unsigned int fu_name) const;
840 
845  double estimate_call_delay() const;
846 
852  bool has_to_be_shared(const unsigned int fu_name) const;
853 
857  void check_library();
859 
865  bool is_one_cycle_direct_access_memory_unit(unsigned int fu_type) const;
866 
867 #ifndef NDEBUG
868 
871  void print_allocated_resources() const;
873 #endif
874 
875  static std::string extract_bambu_provided_name(unsigned long long prec_in, unsigned long long prec_out,
877  technology_nodeRef& current_fu);
878 
879  void print(std::ostream& os) const;
880 
886  bool is_artificial_fu(const unsigned int fu_name) const;
887 
895  bool can_implement(const unsigned int fu_id, const vertex v) const;
896 
904  std::pair<double, double> GetTimeLatency(const unsigned int operation, const unsigned int functional_unit,
905  const unsigned int stage = 0) const;
906  std::pair<double, double> GetTimeLatency(const vertex operation, const unsigned int functional_unit,
907  const unsigned int stage = 0) const;
908 
916  double GetConnectionTime(const unsigned int first_operation, const unsigned int second_operation,
917  const AbsControlStep cs) const;
918  double GetConnectionTime(const vertex first_operation, const vertex second_operation, const AbsControlStep cs) const;
919 
925  bool IsVariableExecutionTime(const unsigned int operation_index) const;
926 
930  double getMinimumSlack() const
931  {
932  return minimumSlack;
933  }
934 
939  void setMinimumSlack(const double slack)
940  {
941  minimumSlack = slack;
942  }
943 
949  double GetCondExprTimeLatency(const unsigned int operation_index) const;
950 
956  unsigned int GetCycleLatency(const unsigned int operationID) const;
957  unsigned int GetCycleLatency(const vertex operationID) const;
958 
964  unsigned int GetFuType(const unsigned int operation) const;
965  unsigned int GetFuType(const vertex operation) const;
966 
967  unsigned int get_n_complex_operations() const;
968 
973  double get_connection_time(unsigned fu_type, bool add_delay1, bool add_delay2, size_t n_complex_ops,
974  size_t n_mem_ops) const;
975 
976  double mux_area_unit_raw(unsigned long long fu_prec) const;
977 
983  double estimate_mux_area(unsigned int fu_name) const;
984 
985  unsigned int get_worst_number_of_cycles(const unsigned int fu_name) const;
986 
992  bool has_constant_in(unsigned int fu_name) const;
993 
999  bool is_proxy_memory_unit(const unsigned int fu_name) const;
1000 
1006  bool is_readonly_memory_unit(const unsigned int fu_name) const;
1007 
1011  double GetClockPeriodMargin() const;
1012 
1018  bool is_single_bool_test_cond_expr_units(const unsigned int fu_name) const;
1019 
1025  bool is_simple_pointer_plus_expr(const unsigned int fu_name) const;
1026 
1027  bool can_be_asynchronous_ram(tree_managerConstRef TM, unsigned int var, unsigned int threshold,
1028  bool is_read_only_variable, unsigned int channel_number);
1029 
1036  bool CanBeChained(const unsigned int first_statement_index, const unsigned int second_statement_index) const;
1037 
1044  bool CanBeChained(const vertex first_statement, const vertex second_statement) const;
1045 
1050  double getConnectionOffset() const
1051  {
1052  return std::max(connection_offset, get_setup_hold_time());
1053  }
1054 };
1057 
1063 {
1069  unsigned int operator()(const unsigned int name) const;
1070 
1076  void update(const unsigned int name, int delta);
1077 
1082  explicit updatecopy_HLS_constraints_functor(const AllocationInformationRef allocation_information);
1083 
1088 
1089  private:
1091  std::vector<unsigned int> tech;
1092 };
1093 
1102 {
1104  std::string node_kind;
1106  std::vector<unsigned long long> input_prec;
1109  std::vector<unsigned long long> base128_input_nelem;
1110 
1112  std::vector<unsigned long long> real_input_nelem;
1113 
1115  unsigned long long output_prec;
1116 
1119  unsigned long long base128_output_nelem;
1120 
1122  unsigned long long real_output_nelem;
1123 
1126 
1129 
1131  : output_prec(0),
1132  base128_output_nelem(0),
1133  real_output_nelem(0),
1134  is_single_bool_test_cond_expr(false),
1135  is_simple_pointer_plus_expr(false)
1136  {
1137  }
1138  void print(std::ostream& os) const;
1139 };
1140 #endif
double get_worst_execution_time(const unsigned int fu_name) const
Returns the worst execution time for all the operations associated with the functional unit...
void print_allocated_resources() const
Prints the actual allocation.
std::vector< unsigned long long > base128_input_nelem
vector storing the number of elements in case the input is a vector, 0 otherwise (used for mapping wi...
double GetCondExprTimeLatency(const unsigned int operation_index) const
Return the execution time of a cond expr corresponding to the gimple_phi.
double get_area(const unsigned int fu_name) const
Returns the area for a given functional unit.
std::vector< unsigned int > DSP_x_db
store DSP x sizes
HLS_constraintsConstRef HLS_C
HLS constraints.
bool is_vertex_bounded(const unsigned int fu_name) const
Checks if the functional unit is uniquely bounded to a vertex.
CustomMap< unsigned int, unsigned int > cond_expr_bb_versions
The bb_version on which the cond exprs driven by a ssan have been computed.
Data structure representing the entire HLS information.
unsigned int GetCycleLatency(const unsigned int operationID) const
Return the latency of an operation in cycle.
double get_correction_time(unsigned int fu, const std::string &operation_name, unsigned int n_ins) const
return a time to be subtracted to the execution time/stage period
double getConnectionOffset() const
getConnectionOffset
unsigned long long get_prec(const unsigned int fu_name) const
return the precision of the given functional unit
void setMinimumSlack(const double slack)
set the minimum slack of the component estimated by scheduling
REF_FORWARD_DECL(node_kind_prec_info)
int flag
Definition: SPARC-GCC.h:58
double output_carry_connection_time
Connection delay at the exit of carry.
This structure collect the information of input and output precision of nodes and the node kind...
bool is_direct_access_memory_unit(unsigned int fu_type) const
return true in case fu type is a memory unit with direct access channels
double get_execution_time_dsp_modified(const unsigned int fu_name, const technology_nodeRef &node_op) const
CustomMap< unsigned long long, CustomUnorderedMapStable< unsigned int, double > > mux_timing_db
store mux timing for the current technology
string target
Definition: lenet_tvm.py:16
ControlStep op_et_to_cycles(double et, double clock_period) const
Calculates the control steps required for a specific operation.
CustomMap< unsigned int, CustomSet< unsigned int > > ssa_roots
The roots used to compute a ssa.
double GetPhiConnectionLatency(const unsigned int statement_index) const
Return the connection delay due to phi.
CustomMap< unsigned long long, CustomUnorderedMapStable< unsigned int, double > > mux_area_db
store mux timing for the current technology
Class managing the schedule of the operations.
Definition: schedule.hpp:118
std::map< std::string, std::string > precomputed_pipeline_unit
store the pre-computed pipeline unit: given a functional unit it return the pipeline id compliant ...
CustomUnorderedMap< unsigned int, std::pair< std::string, std::string > > id_to_fu_names
map between the functional unit identifier and the pair (library, fu) of names for the unit ...
CustomMap< unsigned int, unsigned int > zero_distance_ops_bb_version
The bb_version on which the reachable delay zero operations.
double GetToDspRegisterDelay(const unsigned int statement_index) const
Add the delay to reach a DSP register if necessary.
This class manages the tree structures extracted from the raw file.
bool is_vertex_bounded_with(const unsigned int v, unsigned int &fu_name) const
In case the vertex is bounded to a particular functional unit, it returns true and the functional uni...
double minimumSlack
minimum slack
Class specification of the graph structures.
std::pair< std::string, std::string > get_fu_name(unsigned int id) const
Returns the name of the functional unit, associated with the name of the library, given the correspon...
bool CanImplementSetNotEmpty(const unsigned int v) const
Return if any functional unit has been allocated for an operation.
CustomOrderedMap< T, U > CustomMap
Definition: custom_map.hpp:167
bool has_constant_in(unsigned int fu_name) const
return true in case the functional unit has an input connected to a constant value ...
double DSP_allocation_coefficient
coefficient used to modify pipelining DSPs allocation
UINT_STRONG_TYPEDEF_FORWARD_DECL(ControlStep)
double get_stage_period_dsp_modified(const unsigned int fu_name, const technology_nodeRef &node_op) const
double estimate_muxNto1_area(unsigned long long fu_prec, unsigned int mux_ins) const
Return the area due to mux with n-inputs.
double get_DSPs(const unsigned int fu_name) const
return an estimation of the number of DSPs used by the unit
bool is_proxy_unit(const unsigned int fu_name) const
check if a functional unit is a proxy
double mux_time_unit_raw(unsigned long long fu_prec) const
void print(std::ostream &os) const
HLS_deviceConstRef HLS_D
reference to the information representing the target for the synthesis
const std::map< unsigned int, unsigned int > & get_proxy_memory_units() const
return the set of proxy memory units
double get_connection_time(unsigned fu_type, bool add_delay1, bool add_delay2, size_t n_complex_ops, size_t n_mem_ops) const
return an estimation of the interconnection time
double get_stage_period(const unsigned int fu_name, const vertex v, const OpGraphConstRef g) const
Return the stage period for a given vertex and a given pipelined functional unit. ...
unsigned int get_n_complex_operations() const
double compute_normalized_area(unsigned int fu_s1) const
compute a number representing the "weight" of the functional unit
CustomUnorderedMap< unsigned int, CustomOrderedSet< unsigned int > > fus_to_node_id
reverse map putting into relation functional units with the operations that can be mapped on ...
double GetClockPeriodMargin() const
Return the margin to be considered when performing scheduling.
bool is_proxy_function_unit(const unsigned int fu_name) const
check if a functional unit is a proxy function unit
static std::string extract_bambu_provided_name(unsigned long long prec_in, unsigned long long prec_out, const HLS_managerConstRef hls_manager, technology_nodeRef &current_fu)
Allocation_MinMax
Definition: allocation.hpp:89
This class specifies the characteristic of a particular functional unit.
double get_worst_stage_period(const unsigned int fu_name) const
Returns the worst stage period for all the operations associated with the functional unit...
std::map< unsigned int, std::string > sync_ram_var_latency
put into relation variable and their latency when they are mapped on a private synchronous ram ...
static technology_nodeRef get_fu(const std::string &fu_name, const HLS_managerConstRef hls_manager)
Returns the technology_node associated with the given operation.
const ParameterConstRef parameters
The set of input parameters.
double time_multiplier
coefficient used to modify execution time and stage time
double controller_delay_multiplier
coefficient used to estimate the controller delay
std::pair< double, double > GetTimeLatency(const unsigned int operation, const unsigned int functional_unit, const unsigned int stage=0) const
Return the execution time of (a stage of) an operation.
tree_managerConstRef TreeM
The tree manager.
std::tuple< unsigned int, unsigned int > io_binding_type
tuple set used to represent the required values or the constant default value associated with the inp...
Absolute Control step First field is the basic block Second field is the relative control step...
Definition: schedule.hpp:89
unsigned int get_worst_number_of_cycles(const unsigned int fu_name) const
double GetStatementArea(const unsigned int statement_index) const
Returns the area for a given statement.
CustomUnorderedMap< std::pair< unsigned int, std::string >, CustomOrderedSet< unsigned int > > node_id_to_fus
for each operation (node-id, operation) return the set of functional unit that can be used ...
#define max
Definition: backprop.h:17
unsigned int max_number_of_operations(unsigned int fu) const
return the maximum number of operations that insists on the same type of functional unit ...
CustomUnorderedSet< unsigned int > simple_pointer_plus_expr
in case of pointer plus expr between constants: no wire delay
std::vector< unsigned int > DSP_y_db
store DSP y sizes
double estimate_mux_time(unsigned int fu_name) const
estimate the delay of a mux that can be uses to mux the input of the given functional unit ...
const std::map< unsigned int, std::string > & get_proxy_wrapped_units() const
return the set of proxy wrapped units
unsigned int get_cycles(const unsigned int fu_name, const unsigned int v) const
Return the number of cycles for given vertex and a given functional unit.
std::map< unsigned int, std::string > proxy_wrapped_units
put into relation proxy wrapped units with shared functions
friend struct updatecopy_HLS_constraints_functor
std::vector< unsigned int > tech
copy of the technology constraints
std::string node_kind
Node kind.
static const std::pair< const CustomMap< unsigned long long, CustomUnorderedMapStable< unsigned int, double > > &, const CustomMap< unsigned long long, CustomUnorderedMapStable< unsigned int, double > > & > InitializeMuxDB(const AllocationInformationConstRef allocation_information)
Compute the values for the initialization of the multiplexer characteristics database.
double get_attribute_of_fu_per_op(const vertex v, const OpGraphConstRef g, const Allocation_MinMax allocation_min_max, op_target target, unsigned int &fu_name, bool &flag, const updatecopy_HLS_constraints_functor *CF=nullptr) const
This method returns the min or the max value of the execution time/power consumption/initiation time ...
CustomSet< unsigned int > ComputeDrivenCondExpr(const unsigned int ssa) const
Compute the cond_expr indirectly driven by a ssa.
CustomUnorderedMap< unsigned int, std::pair< std::string, unsigned int > > binding
Puts into relation operation with type and functional units.
unsigned int get_proxy_memory_var(const unsigned int fu_name) const
return the var associated with the proxy unit
double estimate_muxNto1_delay(unsigned long long fu_prec, unsigned int mux_ins) const
Return the delay due to mux with n-inputs.
std::vector< unsigned long long > real_input_nelem
vector storing the number of elements in case the input is a vector, 0 otherwise (real value) ...
bool IsVariableExecutionTime(const unsigned int operation_index) const
Return true if the variable execution time depends on the scheduling.
double mux_area_unit_raw(unsigned long long fu_prec) const
std::string get_latency_string(const std::string &lat) const
void Clear() override
Clear all the data structure.
void Initialize() override
Initialize all the data structure.
This class specifies the characteristic of a particular operation working on a given functional unit...
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
Definition: custom_map.hpp:148
unsigned long long base128_output_nelem
number of output elements in case the output is a a vector, 0 otherwise (used for mapping with librar...
bool is_operation_PI_registered(const OpGraphConstRef g, const vertex &op, unsigned int fu_type) const
Checks if the given operation has its primary input registered or not.
Data structure used to store the schedule of the operations.
bool CanBeMerged(const unsigned int first_operation, const unsigned int second_operation) const
Return true if the two operations can be mapped on the same LUT.
bool is_read_cond(const unsigned int fu_name) const
Checks if the functional unit implements a READ_COND operation.
std::vector< technology_nodeRef > list_of_FU
Stores the list of the functional units.
void set_number_channels(unsigned int fu_name, unsigned int n_ports)
set the number of ports associated with the functional unit
bool is_direct_proxy_memory_unit(unsigned int fu_type) const
return true in case4 fu type is a memory unit accessed through a proxy module
~AllocationInformation() override
Destructor.
unsigned long long real_output_nelem
number of output elements in case the output is a a vector, 0 otherwise (real_value) ...
OpGraphConstRef op_graph
The operation graph.
bool can_implement(const unsigned int fu_id, const vertex v) const
Checks if the operation associated with a vertex can be implemented by a given functional unit...
AllocationInformation(const HLS_managerRef _hls_manager, const unsigned int _function_index, const ParameterConstRef parameters)
Constructor.
bool is_single_bool_test_cond_expr
true when the functional unit is a cond_expr and has the first operand of type bool ...
CustomMap< unsigned int, CustomSet< unsigned int > > ssa_cond_exprs
The cond exprs driven by a ssa.
#define index(x, y)
Definition: Keccak.c:74
CustomOrderedSet< unsigned int > is_vertex_bounded_rel
Store the set of functional units (identifiers) uniquely bounded.
CustomMap< unsigned int, std::pair< unsigned int, AbsControlStep > > ssa_bb_versions
The bb_version-control root on which the roots of a ssa have been computed.
This class macros for the definition of strong typedef.
double mux_time_unit(unsigned long long fu_prec) const
Data structure used to store all the HLS constraints.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Definition: graph.hpp:1303
double estimate_controller_delay_fb() const
estimate the delay of the controller in feedback mode
const std::map< unsigned int, std::string > & get_proxy_function_units() const
return the set of proxy function units
std::map< unsigned int, unsigned long long > precision_map
map functional units with their precision
double DSPs_margin_stage
coefficient used to modify DSPs stage period
CustomUnorderedSet< unsigned int > single_bool_test_cond_expr_units
store all cond_expr units having a Boolean condition
unsigned int n_complex_operations
number of complex operations
double connection_time_ratio
coefficient used to estimate connection delay
void GetNodeTypePrec(const vertex node, const OpGraphConstRef g, node_kind_prec_infoRef info, HLS_manager::io_binding_type &constant_id, bool is_constrained) const
Extract the node kind and precision, if available.
bool is_proxy_memory_unit(const unsigned int fu_name) const
Returns true if the fu_name is a proxy memory unit.
double time_m_execution_time(operation *op) const
return the execution time of the operation corrected by time_multiplier factor
This wrapper collects all the methods used by the High-level synthesis classes to retrieve informatio...
Definition: allocation.hpp:102
double estimate_mux_area(unsigned int fu_name) const
Estimate the area of a mux attached to a given functional unit.
bool is_operation_bounded(const OpGraphConstRef g, const vertex &op, unsigned int fu_type) const
Checks if the given operation has a bounded execution time or not.
bool can_be_asynchronous_ram(tree_managerConstRef TM, unsigned int var, unsigned int threshold, bool is_read_only_variable, unsigned int channel_number)
Template definition of refcount.
bool is_one_cycle_direct_access_memory_unit(unsigned int fu_type) const
return true in case the functional unit is a direct_access memory unit with a single clock latency fo...
double setup_multiplier
coefficient used to modify setup value
std::vector< unsigned int > tech_constraints
For each functional unit (position in the vector), tech_constraints stores the maximum number of reso...
memoryConstRef Rmem
The memory.
bool is_simple_pointer_plus_expr(const unsigned int fu_name) const
return true in case the functional unit implement a pointer_plus operation and the operands are const...
const unsigned int & address_bitsize
std::map< unsigned int, unsigned int > proxy_memory_units
put into relation proxy memory units with variables
BehavioralHelperConstRef behavioral_helper
The behavioral helper.
std::vector< unsigned long long > input_prec
Vector of input precision.
bool is_dual_port_memory(unsigned int fu_type) const
return true in case the memory has decoupled addresses for writing and reading
const CustomOrderedSet< unsigned int > & can_implement_set(const vertex v) const
Returns the set of functional units that can be used to implement the operation associated with verte...
bool is_simple_pointer_plus_expr
true when the functional unit is a pointer plus expr with two constant operands
unsigned int get_number_channels(unsigned int fu_name) const
return the number of channels available for the functional unit
std::string get_string_name(unsigned int fu_name) const
Returns the name of the functional for debug purpose.
std::map< unsigned int, std::string > proxy_function_units
put into relation proxy function units with shared functions
bool CanBeChained(const unsigned int first_statement_index, const unsigned int second_statement_index) const
Check if two statements can be chained.
size_t max_fanout_size
The maximum size of fanout.
bool is_assign(const unsigned int fu_name) const
Checks if the functional unit implements an ASSIGN operation.
unsigned int get_memory_var(const unsigned int fu_name) const
Returns the base address of the functional unit.
CONSTREF_FORWARD_DECL(AllocationInformation)
Superclass include.
static const std::tuple< const std::vector< unsigned int > &, const std::vector< unsigned int > & > InitializeDSPDB(const AllocationInformationConstRef allocation_information)
Compute the values for the initialization of the DSP characteristics database.
This file collects some hash functors.
Data structures used in operations graph.
CustomSet< unsigned int > ComputeRoots(const unsigned int ssa, const AbsControlStep cs) const
Compute the roots to be considered for fan out computation.
unsigned long long output_prec
Precision of the output.
constraint functor used by get_attribute_of_fu_per_op
double output_DSP_connection_time
Connection delay at the exit of DSP.
std::map< unsigned int, unsigned int > vars_to_memory_units
map between variables and associated memory_units
unsigned int get_number_fu(unsigned int fu_name) const
Returns the number of functional unit given its id.
bool is_return(const unsigned int fu_name) const
Checks if the functional unit implements a RETURN operation.
unsigned int min_number_of_resources(const vertex v) const
Computes the minum number of resources implementing the operation associated with the vertex v...
double GetConnectionTime(const unsigned int first_operation, const unsigned int second_operation, const AbsControlStep cs) const
Return the connection time for a couple of operations or the phi overhead for a single operation...
double time_m_stage_period(operation *op) const
return the stage time of the operation corrected by time_multiplier factor
std::map< unsigned int, unsigned long long > memory_units_sizes
size of each memory unit in bytes
CustomMap< unsigned int, CustomSet< unsigned int > > zero_distance_ops
The operations reachable with delay zero.
double DSPs_margin
coefficient used to modify DSPs execution time
bool is_memory_unit(const unsigned int fu_name) const
Returns true if the fu_name is a memory unit.
bool is_indirect_access_memory_unit(unsigned int fu) const
return true in case fu type is a resource unit performing an indirect access to memory ...
Data structure that contains all information about high level synthesis process.
Definition: hls.hpp:83
const HLS_managerRef hls_manager
The HLS manager.
Definition: hls_ir.hpp:55
double memory_correction_coefficient
coefficient used to correct timing of memories
bool is_proxy_wrapped_unit(const unsigned int fu_name) const
check if a functional unit is a proxy wrapped unit
bool has_to_be_synthetized(const unsigned int fu_name) const
Checks if the functional unit has to be synthetized.
bool is_single_bool_test_cond_expr_units(const unsigned int fu_name) const
return true in case the functional unit implement a cond_expr operation and the condition is a Boolea...
double fanout_coefficient
The coefficient used for estimating fanout delay.
bool is_artificial_fu(const unsigned int fu_name) const
Checks if the functional unit is actually an artificial functional unit like: NOP, ENTRY and EXIT.
void check_library()
Checks library type and sets if it&#39;s ordered, complete or simple.
std::map< unsigned int, unsigned int > get_memory_units() const
Returns the memory units.
ControlStep get_initiation_time(const unsigned int fu_name, const vertex v) const
Returns the initiation time for a given vertex and a given functional unit.
void update(int b[SIZE], int bucket[BUCKETSIZE], int a[SIZE], int exp)
Definition: sort.c:63
bool is_readonly_memory_unit(const unsigned int fu_name) const
return true in case the functional unit is a read-only memory unit
Abstract pure class for the technology structure.
bool has_to_be_shared(const unsigned int fu_name) const
Checks if the functional unit has to be shared.
Base class for intermediate representation used by HLS ifunction steps.
std::map< unsigned int, unsigned int > nports_map
define the number of ports associated with the functional unit
unsigned int max_number_of_resources(const vertex v) const
Computes the maximum number of resources implementing the operation associated with the vertex v...
std::map< unsigned int, unsigned int > memory_units
map between memory units and the associated variables
double EstimateControllerDelay() const
estimate the delay of the controller in straightforward mode
double get_execution_time(const unsigned int fu_name, const vertex v, const OpGraphConstRef g) const
Returns the execution time for a given vertex and a given functional unit.
unsigned int get_number_fu_types() const
Returns the number of functional units types.
unsigned int GetFuType(const unsigned int operation) const
Return the functional unit type used to execute an operation.
CustomSet< unsigned int > GetZeroDistanceOperations(const unsigned int statement_index) const
Return the set of operations with zero time distance from source.

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