PandA-2024.02
InterfaceInfer.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) 2022-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 #ifndef INTERFACE_INFER_HPP
41 #define INTERFACE_INFER_HPP
42 
44 #include "custom_set.hpp"
45 #include "refcount.hpp"
46 
47 #include <list>
48 #include <set>
49 
55 struct statement_list;
56 struct function_decl;
57 struct gimple_assign;
58 struct gimple_node;
59 
61 {
62  private:
63  enum class m_axi_type;
64  enum class datatype;
66 
67  bool already_executed;
68 
74  ComputeFrontendRelationships(const DesignFlowStep::RelationshipType relationship_type) const override;
75 
76  void ComputeRelationships(DesignFlowStepSet& relationship,
77  const DesignFlowStep::RelationshipType relationship_type) override;
78 
80  std::list<tree_nodeRef>& writeStmt, std::list<tree_nodeRef>& readStmt,
81  interface_info& info);
82 
83  void ChasePointerInterface(tree_nodeRef ptr_var, std::list<tree_nodeRef>& writeStmt,
84  std::list<tree_nodeRef>& readStmt, interface_info& info);
85 
86  void forwardInterface(const tree_nodeRef& fnode, const tree_nodeRef& parm_node, const interface_info& info);
87 
88  void setReadInterface(tree_nodeRef stmt, const std::string& arg_name, std::set<std::string>& operationsR,
89  bool commonRWSignature, tree_nodeConstRef interface_datatype,
90  const tree_manipulationRef tree_man, const tree_managerRef TM);
91 
92  void setWriteInterface(tree_nodeRef stmt, const std::string& arg_name, std::set<std::string>& operationsW,
93  bool commonRWSignature, tree_nodeConstRef interface_datatype,
94  const tree_manipulationRef tree_man, const tree_managerRef TM);
95 
96  void create_resource_Read_simple(const std::set<std::string>& operations, const interface_info& info,
97  FunctionArchitectureRef func_arch, bool IO_port) const;
98 
99  void create_resource_Write_simple(const std::set<std::string>& operations, const interface_info& info,
100  FunctionArchitectureRef func_arch, bool IO_port) const;
101 
102  void create_resource_array(const std::set<std::string>& operationsR, const std::set<std::string>& operationsW,
103  const interface_info& info, FunctionArchitectureRef func_arch) const;
104 
105  void create_resource_m_axi(const std::set<std::string>& operationsR, const std::set<std::string>& operationsW,
106  const interface_info& info, FunctionArchitectureRef func_arch) const;
107 
108  void create_resource(const std::set<std::string>& operationsR, const std::set<std::string>& operationsW,
109  const interface_info& info, FunctionArchitectureRef func_arch) const;
110 
111  public:
118  InterfaceInfer(const application_managerRef AppM, const DesignFlowManagerConstRef design_flow_manager,
120 
124  ~InterfaceInfer() override;
125 
126  bool HasToBeExecuted() const override;
127 
132  DesignFlowStep_Status Exec() override;
133 };
134 
135 #endif
void ChasePointerInterface(tree_nodeRef ptr_var, std::list< tree_nodeRef > &writeStmt, std::list< tree_nodeRef > &readStmt, interface_info &info)
This struct specifies the statement_list node.
Definition: tree_node.hpp:4662
RelationshipType
The relationship type.
struct definition of the function_decl tree node.
Definition: tree_node.hpp:2759
This class manages the tree structures extracted from the raw file.
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
void create_resource_Read_simple(const std::set< std::string > &operations, const interface_info &info, FunctionArchitectureRef func_arch, bool IO_port) const
REF_FORWARD_DECL(tree_node)
~InterfaceInfer() override
Destructor.
Abstract pure class for the tree structure.
Definition: tree_node.hpp:139
void ChasePointerInterfaceRecurse(CustomOrderedSet< unsigned > &Visited, tree_nodeRef ptr_var, std::list< tree_nodeRef > &writeStmt, std::list< tree_nodeRef > &readStmt, interface_info &info)
This struct specifies the gimple_assign node (GCC 4.3 tree node).
Definition: tree_node.hpp:3015
void create_resource_m_axi(const std::set< std::string > &operationsR, const std::set< std::string > &operationsW, const interface_info &info, FunctionArchitectureRef func_arch) const
InterfaceInfer(const application_managerRef AppM, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
Constructor.
redefinition of set to manage ordered/unordered structures
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
void create_resource_array(const std::set< std::string > &operationsR, const std::set< std::string > &operationsW, const interface_info &info, FunctionArchitectureRef func_arch) const
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
Template definition of refcount.
void setReadInterface(tree_nodeRef stmt, const std::string &arg_name, std::set< std::string > &operationsR, bool commonRWSignature, tree_nodeConstRef interface_datatype, const tree_manipulationRef tree_man, const tree_managerRef TM)
const application_managerRef AppM
The application manager.
DesignFlowStep_Status Exec() override
Execute this step.
struct definition of the common part of a gimple with virtual operands
Definition: tree_node.hpp:1078
void create_resource_Write_simple(const std::set< std::string > &operations, const interface_info &info, FunctionArchitectureRef func_arch, bool IO_port) const
void create_resource(const std::set< std::string > &operationsR, const std::set< std::string > &operationsW, const interface_info &info, FunctionArchitectureRef func_arch) const
void forwardInterface(const tree_nodeRef &fnode, const tree_nodeRef &parm_node, const interface_info &info)
const CustomUnorderedSet< std::pair< FrontendFlowStepType, FunctionRelationship > > ComputeFrontendRelationships(const DesignFlowStep::RelationshipType relationship_type) const override
Return the set of analyses in relationship with this design step.
void setWriteInterface(tree_nodeRef stmt, const std::string &arg_name, std::set< std::string > &operationsW, bool commonRWSignature, tree_nodeConstRef interface_datatype, const tree_manipulationRef tree_man, const tree_managerRef TM)
CONSTREF_FORWARD_DECL(tree_node)
This class contains the base representation for a generic frontend flow step which works on the whole...
This class creates a layer to add nodes and to manipulate the tree_nodes manager. ...
void ComputeRelationships(DesignFlowStepSet &relationship, const DesignFlowStep::RelationshipType relationship_type) override
Compute the relationships of a step with other steps.

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