PandA-2024.02
sched_based_chaining_computation.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  */
40 
41 #include "exceptions.hpp"
42 #include "function_behavior.hpp"
43 #include "hls.hpp"
44 #include "hls_manager.hpp"
45 
47 #include "custom_map.hpp"
48 #include "custom_set.hpp"
49 
50 #include "Parameter.hpp"
51 #include "dbgPrintHelper.hpp"
52 #include "schedule.hpp"
53 
55 #include "chaining_information.hpp"
56 #include "string_manipulation.hpp" // for GET_CLASS
57 
59  const HLS_managerRef _HLSMgr, unsigned int _funId,
60  const DesignFlowManagerConstRef _design_flow_manager)
61  : chaining(_Param, _HLSMgr, _funId, _design_flow_manager, HLSFlowStep_Type::SCHED_CHAINING)
62 {
63  debug_level = parameters->get_class_debug_level(GET_CLASS(*this));
64 }
65 
67 
69 {
73 }
74 
76 {
77  const FunctionBehaviorConstRef FB = HLSMgr->CGetFunctionBehavior(funId);
79 
80  VertexIterator op, op_end;
81  for(boost::tie(op, op_end) = boost::vertices(*flow_graph); op != op_end; ++op)
82  {
83  const auto current_starting_cycle = HLS->Rsch->get_cstep(*op);
84  const auto current_ending_cycle = HLS->Rsch->get_cstep_end(*op);
85  if(current_starting_cycle == current_ending_cycle)
86  {
88  "---Operations " + GET_NAME(flow_graph, *op) + " and " + GET_NAME(flow_graph, *op) +
89  " are chained in");
91  }
92  InEdgeIterator ei, ei_end;
93  bool is_chained_test = false;
94  for(boost::tie(ei, ei_end) = boost::in_edges(*op, *flow_graph); ei != ei_end; ei++)
95  {
96  vertex src = boost::source(*ei, *flow_graph);
97  if(HLS->Rsch->get_cstep_end(src) == current_starting_cycle)
98  {
100  std::string("Operations ") + GET_NAME(flow_graph, src) + " and " +
101  GET_NAME(flow_graph, *op) + " are chained in");
103  is_chained_test = true;
104  }
105  }
106  if(is_chained_test)
107  {
109  std::string("Operations ") + GET_NAME(flow_graph, *op) + " is chained with something");
111  }
112  OutEdgeIterator eo, eo_end;
113  for(boost::tie(eo, eo_end) = boost::out_edges(*op, *flow_graph); eo != eo_end; eo++)
114  {
115  vertex tgt = boost::target(*eo, *flow_graph);
116  if(HLS->Rsch->get_cstep(tgt) == current_ending_cycle)
117  {
119  std::string("Operations ") + GET_NAME(flow_graph, tgt) + " and " +
120  GET_NAME(flow_graph, *op) + " are chained out");
122  }
123  }
124  }
126 }
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Definition: hls_step.hpp:205
Data structure representing the entire HLS information.
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
class containing information about chaining
boost::graph_traits< graph >::out_edge_iterator OutEdgeIterator
out_edge_iterator definition.
Definition: graph.hpp:1312
File containing functions and utilities to support the printing of debug messagges.
void add_chained_vertices_in(vertex op1, vertex src)
put into relation the vertices whith respect the chained vertices connected with the input ...
#define DEBUG_LEVEL_PEDANTIC
very verbose debugging print is performed.
string target
Definition: lenet_tvm.py:16
#define GET_CLASS(obj)
Macro returning the actual type of an object.
void Initialize()
Initialize the object (i.e., like a constructor, but executed just before exec of a step) ...
AbsControlStep get_cstep(const vertex &op) const
Returns the clock cycle where the given operation has been scheduled.
Definition: schedule.cpp:270
const unsigned int funId
identifier of the function to be processed (0 means that it is a global step)
#define GET_NAME(data, vertex_index)
Helper macro returning the name associated with a node.
boost::graph_traits< graph >::in_edge_iterator InEdgeIterator
in_edge_iterator definition.
Definition: graph.hpp:1310
exceptions managed by PandA
AbsControlStep get_cstep_end(const vertex &op) const
Return the last clock cycle in which the operation execute.
Definition: schedule.cpp:302
~sched_based_chaining_computation() override
Destructor.
redefinition of map to manage ordered/unordered structures
Auxiliary methods for manipulating string.
DesignFlowStep_Status InternalExec() override
Execute the step.
ScheduleRef Rsch
Store the refcounted scheduling of the operations.
Definition: hls.hpp:118
Data structure used to store the schedule of the operations.
void add_chained_vertices_out(vertex op1, vertex tgt)
put into relation the vertices whith respect the chained vertices connected with the output ...
HLSFlowStep_Type
Definition: hls_step.hpp:95
redefinition of set to manage ordered/unordered structures
chaining computation starting from the results of the scheduling step
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Definition: graph.hpp:1303
boost::graph_traits< graph >::vertex_iterator VertexIterator
vertex_iterator definition.
Definition: graph.hpp:1307
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
sched_based_chaining_computation(const ParameterConstRef Param, const HLS_managerRef HLSMgr, unsigned int funId, const DesignFlowManagerConstRef design_flow_manager)
Constructor.
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
CustomOrderedSet< vertex > is_chained_with
set of vertices chained with something
const OpGraphConstRef CGetOpGraph(FunctionBehavior::graph_type gt) const
This method returns the operation graphs.
hlsRef HLS
HLS data structure of the function to be analyzed.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
System dependence + anti-dependence + output dependence graph + flow graph.
this class is used to manage the command-line or XML options.
int debug_level
The debug level.
Data structure definition for high-level synthesis flow.
refcount< ChainingInformation > ChainingInformationRef
refcount definition of the class
A brief description of the C++ Header File.
ChainingInformationRef chaining_information
Store the refcounted chaining info.
Definition: hls.hpp:142

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