PandA-2024.02
initialize_hls.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 #include "initialize_hls.hpp"
41 
42 #include "Parameter.hpp"
44 #include "call_graph_manager.hpp"
45 #include "design_flow_graph.hpp"
46 #include "design_flow_manager.hpp"
48 #include "hls.hpp"
49 #include "hls_constraints.hpp"
50 #include "hls_device.hpp"
51 #include "hls_manager.hpp"
52 #include "memory_allocation.hpp"
53 #include "structural_manager.hpp"
54 #include "structural_objects.hpp"
55 #include "technology_flow_step.hpp"
57 #include "technology_manager.hpp"
58 #include "technology_node.hpp"
59 #include "tree_helper.hpp"
60 #include "tree_manager.hpp"
61 #include "tree_node.hpp"
62 
64  unsigned int _function_id, const DesignFlowManagerConstRef _design_flow_manager)
65  : HLSFunctionStep(_parameters, _HLS_mgr, _function_id, _design_flow_manager, HLSFlowStep_Type::INITIALIZE_HLS)
66 {
67 }
68 
70  const DesignFlowStep::RelationshipType relationship_type)
71 {
72  switch(relationship_type)
73  {
75  {
76  const DesignFlowGraphConstRef design_flow_graph = design_flow_manager.lock()->CGetDesignFlowGraph();
77  const auto* frontend_flow_step_factory = GetPointer<const FrontendFlowStepFactory>(
78  design_flow_manager.lock()->CGetDesignFlowStepFactory("Frontend"));
79  const std::string frontend_flow_signature = ApplicationFrontendFlowStep::ComputeSignature(BAMBU_FRONTEND_FLOW);
80  const vertex frontend_flow_step = design_flow_manager.lock()->GetDesignFlowStep(frontend_flow_signature);
81  const DesignFlowStepRef design_flow_step =
82  frontend_flow_step ? design_flow_graph->CGetDesignFlowStepInfo(frontend_flow_step)->design_flow_step :
83  frontend_flow_step_factory->CreateApplicationFrontendFlowStep(BAMBU_FRONTEND_FLOW);
84  relationship.insert(design_flow_step);
85 
86  const auto* technology_flow_step_factory = GetPointer<const TechnologyFlowStepFactory>(
87  design_flow_manager.lock()->CGetDesignFlowStepFactory("Technology"));
88  const std::string technology_flow_signature =
90  const vertex technology_flow_step = design_flow_manager.lock()->GetDesignFlowStep(technology_flow_signature);
91  const DesignFlowStepRef technology_design_flow_step =
92  technology_flow_step ?
93  design_flow_graph->CGetDesignFlowStepInfo(technology_flow_step)->design_flow_step :
94  technology_flow_step_factory->CreateTechnologyFlowStep(TechnologyFlowStep_Type::LOAD_TECHNOLOGY);
95  relationship.insert(technology_design_flow_step);
96  break;
97  }
99  {
100  break;
101  }
103  {
104  break;
105  }
106  default:
107  THROW_UNREACHABLE("");
108  }
109  HLSFunctionStep::ComputeRelationships(relationship, relationship_type);
110 }
111 
113 {
115 }
116 
118 {
120  HLS->controller_type = static_cast<HLSFlowStep_Type>(parameters->getOption<int>(OPT_controller_architecture));
121  if(HLSMgr->GetFunctionBehavior(funId)->is_simple_pipeline())
122  {
124  }
125  HLS->module_binding_algorithm = static_cast<HLSFlowStep_Type>(parameters->getOption<int>(OPT_fu_binding_algorithm));
126  HLS->liveness_algorithm = static_cast<HLSFlowStep_Type>(parameters->getOption<int>(OPT_liveness_algorithm));
127  HLS->chaining_algorithm = static_cast<HLSFlowStep_Type>(parameters->getOption<int>(OPT_chaining_algorithm));
128 
130 }
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Definition: hls_step.hpp:205
Data structure representing the entire HLS information.
RelationshipType
The relationship type.
Source must be executed to satisfy target.
const unsigned int funId
identifier of the function to be processed (0 means that it is a global step)
InitializeHLS(const ParameterConstRef _parameters, const HLS_managerRef _HLS_mgr, unsigned int _function_id, const DesignFlowManagerConstRef design_flow_manager)
DesignFlowStep_Status InternalExec() override
Execute the step.
Class specification of the manager of the technology library data structures.
void ComputeRelationships(DesignFlowStepSet &design_flow_step_set, const DesignFlowStep::RelationshipType relationship_type) override
Compute the relationships of a step with other steps.
static hlsRef create_HLS(const HLS_managerRef HLSMgr, unsigned int functionId)
Creates the HLS flow starting from the given specification.
HLSFlowStep_Type controller_type
The type of controller to be instantiated.
Definition: hls.hpp:90
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Definition: exceptions.hpp:292
HLSFlowStep_Type
Definition: hls_step.hpp:95
Step which intializes hls data structur.
Class specification of the data structures used to manage technology information. ...
HLSFlowStep_Type module_binding_algorithm
The type of module binding to be adopted.
Definition: hls.hpp:93
Classes to describe design flow graph.
static const std::string ComputeSignature(const TechnologyFlowStep_Type technology_flow_step_type)
Compute the signature of a technology flow step.
Factory for technology flow step.
static const std::string ComputeSignature(const FrontendFlowStepType frontend_flow_step_type)
Compute the signature of a function frontend flow step.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Definition: graph.hpp:1303
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
Classes specification of the tree_node data structures.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
Base class to allocate memories in high-level synthesis.
Wrapper of design_flow.
Data structure definition for HLS constraints.
This file collects some utility functions.
refcount< T > lock() const
Definition: refcount.hpp:212
This class describes all classes used to represent a structural object.
HLSFlowStep_Type chaining_algorithm
The type of chaining algorithm to be adopted.
Definition: hls.hpp:96
hlsRef HLS
HLS data structure of the function to be analyzed.
void ComputeRelationships(DesignFlowStepSet &relationship, const DesignFlowStep::RelationshipType relationship_type) final
Compute the relationships of a step with other steps.
This class contains the methods to create a frontend flow step.
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.
Wrapper to call graph.
Class implementation of the structural_manager.
Data structure definition for high-level synthesis flow.
Superclass include.
This class contains the base representation for a generic frontend flow step which works on the whole...
Class specification of the manager of the tree structures extracted from the raw file.
Base class for technology flow steps.
HLS specialization of generic_device.
HLSFlowStep_Type liveness_algorithm
The type of liveness algorithm to be adopted.
Definition: hls.hpp:99

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