PandA-2024.02
sdc_scheduling.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) 2014-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 SDC_SCHEDULING_HPP
42 #define SDC_SCHEDULING_HPP
43 
45 #include "scheduling.hpp"
46 
48 #include "custom_map.hpp"
49 #include "custom_set.hpp"
50 #include "hash_helper.hpp"
51 
52 #include <list>
53 #include <set>
54 #include <vector>
55 
62 class OpVertexSet;
64 
65 class SDCScheduling : public Scheduling
66 {
69 
72 
75 
78 
81 
84 
86  double clock_period;
87 
89  double margin;
90 
93 
95  // CustomSet<vertex> unbounded_operations;
96 
99 
101  // CustomMap<vertex, CustomSet<vertex>> full_reachability_map;
102 
105 
106 #ifndef NDEBUG
109 #endif
110 
114  void ExecLoop();
115 
119  void Initialize() override;
120 
127  void AddDelayConstraints(const meilp_solverRef solver, const OpGraphConstRef filtered_op_graph,
128 #ifndef NDEBUG
129  const OpGraphConstRef debug_filtered_op_graph,
130 #endif
131  const std::set<vertex, bb_vertex_order_by_map>& loop_bbs);
132 
140  void AddDependenceConstraint(const meilp_solverRef solver, const vertex source, const vertex target,
141  const bool simultaneous) const;
142 
148  void AddStageConstraints(const meilp_solverRef solver, const vertex operation) const;
149 
156  ComputeHLSRelationships(const DesignFlowStep::RelationshipType relationship_type) const override;
157 
158  void ComputeRelationships(DesignFlowStepSet& relationship,
159  const DesignFlowStep::RelationshipType relationship_type) override;
160 
161  public:
164  std::list<std::vector<unsigned int>> movements_list;
165 
174  SDCScheduling(const ParameterConstRef parameters, const HLS_managerRef HLSMgr, unsigned int function_id,
175  const DesignFlowManagerConstRef design_flow_manager,
177 
181  ~SDCScheduling() override;
182 
187  bool HasToBeExecuted() const override;
188 
194 };
195 #endif
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Definition: hls_step.hpp:205
Class used to sort operation using ALAP in ascending order as primary key and ASAP ascending order as...
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
double clock_period
The clock period.
~SDCScheduling() override
Destructor.
DesignFlowStep_Status InternalExec() override
Execute the step.
string target
Definition: lenet_tvm.py:16
RelationshipType
The relationship type.
void ExecLoop()
Execute the SDCScheduling_Algorithm::SPECULATIVE_LOOP version of the algorithm.
BBGraphConstRef basic_block_graph
The basic block cfg graph.
OpGraphConstRef feedback_op_graph
The operation graph with feedback used to perform scheduling.
CustomUnorderedSet< EdgeDescriptor > temp_edges
The set of temporary flow edges added to the op_graph.
CustomUnorderedMap< std::pair< vertex, unsigned int >, unsigned int > operation_to_varindex
Map operation-stage to variable index.
const CustomUnorderedSet< std::tuple< HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship > > ComputeHLSRelationships(const DesignFlowStep::RelationshipType relationship_type) const override
Compute the relationship of this step.
redefinition of map to manage ordered/unordered structures
A set of operation vertices.
Definition: op_graph.hpp:654
Base class for all scheduling algorithms.
Class used to describe a particular graph with basic blocks as nodes.
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
redefinition of set to manage ordered/unordered structures
BehavioralHelperConstRef behavioral_helper
The behavioral helper.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Definition: graph.hpp:1303
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
fu_bindingRef res_binding
The binding.
Base class providing several methods to encapsulate the interface to several ilp solver.
AllocationInformationConstRef allocation_information
The allocation.
void Initialize() override
Initialize the step.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
The key comparison function for vertices set based on levels.
CustomUnorderedSet< unsigned int > limited_resources
Set of reachable operations (in scheduling graph)
CustomUnorderedMap< unsigned int, CustomSet< vertex > > sharing_operations
The set of unbounded operations.
void AddStageConstraints(const meilp_solverRef solver, const vertex operation) const
Add constraints to force consecutive execution of different pipeline stages.
REF_FORWARD_DECL(fu_binding)
This file collects some hash functors.
SDCScheduling(const ParameterConstRef parameters, const HLS_managerRef HLSMgr, unsigned int function_id, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization)
Constructor.
void AddDelayConstraints(const meilp_solverRef solver, const OpGraphConstRef filtered_op_graph, const OpGraphConstRef debug_filtered_op_graph, const std::set< vertex, bb_vertex_order_by_map > &loop_bbs)
Add constraints to force execution in different steps of operations which cannot be chained...
CONSTREF_FORWARD_DECL(AllocationInformation)
Superclass include.
void AddDependenceConstraint(const meilp_solverRef solver, const vertex source, const vertex target, const bool simultaneous) const
Add constraints to force consecutive execution of dependent operations.
Generic class managing scheduling algorithms.
Definition: scheduling.hpp:64
Class managing the functional-unit binding.
Definition: fu_binding.hpp:90
std::list< std::vector< unsigned int > > movements_list
Result of SPECULATIVE_LOOP: the list of movement to be performed (first element is the operation...
void ComputeRelationships(DesignFlowStepSet &relationship, const DesignFlowStep::RelationshipType relationship_type) override
Compute the relationships of a step with other steps.
OpGraphConstRef op_graph
The operation graph used to perform scheduling.
const HLSFlowStepSpecializationConstRef hls_flow_step_specialization
The information about specialization.
Definition: hls_step.hpp:211
double margin
The margin which has to be introduced with respect to clock period.

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