PandA-2024.02
parametric_list_based.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  */
47 #ifndef PARAMETRIC_LIST_BASED_HPP
48 #define PARAMETRIC_LIST_BASED_HPP
49 
50 #include <iosfwd>
51 #include <set>
52 #include <vector>
53 
54 #include "Vertex.hpp"
55 #include "custom_map.hpp"
56 #include "custom_set.hpp"
57 #include "hash_helper.hpp"
58 #include "op_graph.hpp"
59 #include "refcount.hpp"
60 #include "rehashed_heap.hpp"
61 #include "scheduling.hpp"
62 
71 class graph;
74 class OpVertexSet;
76 
77 #if HAVE_UNORDERED
78 using PriorityQueues = std::vector<rehashed_heap<int>>;
79 #else
80 struct PrioritySorter : public std::binary_function<vertex, vertex, bool>
82 {
85 
88 
94  PrioritySorter(const refcount<priority_data<int>> priority, const OpGraphConstRef op_graph);
95 
102  bool operator()(const vertex x, const vertex y) const;
103 };
104 
105 using PriorityQueues = std::vector<std::set<vertex, PrioritySorter>>;
106 #endif
107 
109 {
110  DYNAMIC_MOBILITY = 0,
111  STATIC_FIXED,
113 };
114 
119 {
120  public:
123 
128  explicit ParametricListBasedSpecialization(const ParametricListBased_Metric parametric_list_based_metric);
129 
133  std::string GetKindText() const override;
134 
138  std::string GetSignature() const override;
139 };
140 
145 {
146  private:
147  static const double EPSILON;
148 
149  void compute_exec_stage_time(const unsigned int fu_type, double& stage_period, const ControlStep cs,
150  const OpGraphConstRef op_graph, vertex v, double& op_execution_time,
151  double& phi_extra_time, double current_starting_time, double setup_hold_time);
152 
155 
158 
161 
164 
167 
169  double clock_cycle;
170 
173 
175  std::map<std::string, std::set<std::string>> reachable_proxy_functions;
176 
187  void compute_starting_ending_time_asap(
188  const CustomUnorderedSet<vertex>& operations, const vertex v, const unsigned int fu_type, const ControlStep cs,
189  double& current_starting_time, double& current_ending_time, double& stage_period, bool& cannot_be_chained,
190  fu_bindingRef res_binding, const ScheduleConstRef schedule, double& phi_extra_time, double setup_hold_time,
191  CustomMap<std::pair<unsigned int, unsigned int>, double>& local_connection_map);
192 
199  bool BB_update_resources_use(unsigned int& used_resources, const unsigned int fu_type) const;
200 
207  void add_to_priority_queues(PriorityQueues& priority_queue,
208  std::set<unsigned int, resource_ordering_functor>& ready_resources,
209  const vertex v) const;
210 
217  bool store_in_chaining_with_load_in(const CustomUnorderedSet<vertex>& operations, unsigned int current_vertex_cstep,
218  vertex v);
219  bool store_in_chaining_with_load_out(const CustomUnorderedSet<vertex>& operations, unsigned int current_vertex_cstep,
220  vertex v);
221 
222  bool check_non_direct_operation_chaining(const CustomUnorderedSet<vertex>& operations, vertex current_v,
223  unsigned int v_fu_type, const ControlStep cs,
224  const ScheduleConstRef schedule, fu_bindingRef res_binding) const;
225 
226  bool check_direct_operation_chaining(const CustomUnorderedSet<vertex>& operations, vertex current_v,
227  const ControlStep cs, const ScheduleConstRef schedule,
228  fu_bindingRef res_binding) const;
229 
230  bool check_LOAD_chaining(const CustomUnorderedSet<vertex>& operations, vertex current_v, const ControlStep cs,
231  const ScheduleConstRef schedule) const;
232 
233  void CheckSchedulabilityConditions(
234  const CustomUnorderedSet<vertex>& operations, const vertex& current_vertex, ControlStep current_cycle,
235  double& current_starting_time, double& current_ending_time, double& current_stage_period,
236  CustomMap<std::pair<unsigned int, unsigned int>, double>& local_connection_map,
237  double current_cycle_starting_time, double current_cycle_ending_time, double setup_hold_time,
238  double& phi_extra_time, double scheduling_mux_margins, bool unbounded, bool unbounded_Functions,
239  bool LoadStoreOp, const std::set<std::string>& proxy_functions_used, bool cstep_has_RET_conflict,
240  unsigned int fu_type, const vertex2obj<ControlStep>& current_ASAP, const fu_bindingRef res_binding,
241  const ScheduleRef schedule, bool& predecessorsCond, bool& pipeliningCond, bool& cannotBeChained0,
242  bool& chainingRetCond, bool& cannotBeChained1, bool& asyncCond, bool& cannotBeChained2, bool& cannotBeChained3,
243  bool& MultiCond0, bool& MultiCond1, bool& LoadStoreFunctionConflict, bool& FunctionStoreconflict,
244  bool& proxyFunCond, bool unbounded_RW, bool seeMulticycle);
245 
247  ComputeHLSRelationships(const DesignFlowStep::RelationshipType relationship_type) const override;
248 
252  void compute_function_topological_order();
253 
254  public:
263  parametric_list_based(const ParameterConstRef parameters, const HLS_managerRef HLSMgr, unsigned int _funId,
264  const DesignFlowManagerConstRef design_flow_manager,
265  const HLSFlowStepSpecializationConstRef hls_flow_step_specialization);
266 
270  ~parametric_list_based() override;
271 
276  DesignFlowStep_Status InternalExec() override;
277 
281  void exec(const OpVertexSet& operations, ControlStep current_cycle);
282 
286  void Initialize() override;
287 };
288 #endif
vertex2float starting_time
The starting time given the scheduling (used for chaining)
const ParametricListBased_Metric parametric_list_based_metric
The metric used in list based.
Functor used to compare which of two resources has to be considered first in the scheduling.
Class managing the schedule of the operations.
Definition: schedule.hpp:118
RelationshipType
The relationship type.
std::map< std::string, std::set< std::string > > reachable_proxy_functions
reachable proxy from a given function
CustomOrderedMap< T, U > CustomMap
Definition: custom_map.hpp:167
Data structures used to manage set of vertexes.
Class managing map of the vertexes on a generic object.
Definition: Vertex.hpp:59
Sorter for connection.
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMapUnstable
Definition: custom_map.hpp:156
redefinition of map to manage ordered/unordered structures
PrioritySorter(const refcount< priority_data< int >> priority, const OpGraphConstRef op_graph)
Constructor.
A set of operation vertices.
Definition: op_graph.hpp:654
This package provides the class used to represent the priority queues adopted by the list based algor...
REF_FORWARD_DECL(hls)
const ParametricListBased_Metric parametric_list_based_metric
The used metric.
std::vector< std::set< vertex, PrioritySorter > > PriorityQueues
Abstract class containing information about specialization of the single steps.
Definition: hls_step.hpp:75
Base class for all scheduling algorithms.
CustomUnorderedMapUnstable< std::pair< vertex, unsigned int >, bool > is_complex
memoization table used for connection estimation
const OpGraphConstRef op_graph
The operation graph.
redefinition of set to manage ordered/unordered structures
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Definition: graph.hpp:1303
OpGraphConstRef flow_graph
The dependence graph.
General class used to describe a graph in PandA.
Definition: graph.hpp:771
DesignFlowStep_Status
The status of a step.
bool operator()(const vertex x, const vertex y) const
Compare position of two vertices.
Class managing list based scheduling algorithms.
Template definition of refcount.
Information about specialization of parametric list based step.
refcount< priority_data< int > > priority
The priority.
ParametricListBased_Metric
OpVertexMap< double > ending_time
The ending time given the scheduling (used for chaining)
This file collects some hash functors.
Data structures used in operations graph.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
double clock_cycle
The clock cycle.
Generic class managing scheduling algorithms.
Definition: scheduling.hpp:64
Data structure that contains all information about high level synthesis process.
Definition: hls.hpp:83
Class managing the functional-unit binding.
Definition: fu_binding.hpp:90
x
Return the smallest n such that 2^n >= _x.
Class used to describe a particular graph with operations as nodes.
Definition: op_graph.hpp:783
CONSTREF_FORWARD_DECL(OpGraph)
OpGraphConstRef flow_graph_with_feedbacks
The dependence graph with feedbacks.

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