PandA-2024.02
VcdSignalSelection.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) 2015-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  */
37 #include "hls_step.hpp"
38 
39 // tree/ include
40 #include "tree_node.hpp"
41 
44 
46 {
47  protected:
49 
51 
53  std::string present_state_name;
54 
59  ComputeHLSRelationships(const DesignFlowStep::RelationshipType relationship_type) const override;
60 
68  void SelectInitialAddrParam(const CustomOrderedSet<unsigned int>& reached_body_fun_ids,
70 
84  const tree_nodeConstRef& tn, const CustomUnorderedSet<unsigned int>& addr_fun_ids,
85  const CustomUnorderedMap<unsigned int, UnorderedSetStdStable<unsigned int>>& call_id_to_called_id);
86 
93 
101  void
102  SelectInitialSsa(const CustomOrderedSet<unsigned int>& reached_body_fun_ids,
103  const CustomUnorderedSet<unsigned int>& addr_fun_ids,
104  const CustomUnorderedMap<unsigned int, UnorderedSetStdStable<unsigned int>>& call_id_to_called_id);
105 
109  void SingleStepPropagateParamToSsa(const TreeNodeMap<size_t>& used_ssa, const TreeNodeSet& address_parameters);
110 
120  const CustomOrderedSet<unsigned int>& reached_body_fun_ids);
121 
125  void SingleStepPropagateAddrSsa(const tree_nodeRef& curr_tn);
126 
131  void PropagateAddrSsa();
132 
139  void DetectInvalidReturns(const CustomOrderedSet<unsigned int>& reached_body_functions,
140  CustomUnorderedSet<unsigned int>& addr_fun_ids);
141 
151  const CustomOrderedSet<unsigned int>& reached_body_functions,
152  CustomUnorderedSet<unsigned int>& addr_fun_ids);
153 
168  const CustomOrderedSet<unsigned int>& reached_body_functions,
169  const CustomUnorderedSet<unsigned int>& addr_fun_ids,
170  const CustomUnorderedMap<unsigned int, UnorderedSetStdStable<unsigned int>>& fu_id_to_call_ids,
171  const CustomUnorderedMap<unsigned int, UnorderedSetStdStable<unsigned int>>& call_id_to_called_id);
172 
179  void
180  SelectAddrSsa(const CustomUnorderedMap<unsigned int, UnorderedSetStdStable<unsigned int>>& fu_id_to_call_ids,
181  const CustomUnorderedMap<unsigned int, UnorderedSetStdStable<unsigned int>>& call_id_to_called_id);
182 
186  bool IsAddressType(const unsigned int type_index) const;
187 
189  CustomUnorderedMap<unsigned int, UnorderedSetStdStable<std::string>>& fun_id_to_sig_names) const;
190 
191  public:
196  const DesignFlowManagerConstRef design_flow_manager);
197 
201  ~VcdSignalSelection() override;
202 
207  DesignFlowStep_Status Exec() override;
208 
209  bool HasToBeExecuted() const override;
210 };
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Definition: hls_step.hpp:205
void PropagateAddrSsa()
Propagates the information on the ssa representing addresses across all the ssa in the functions with...
absl::node_hash_set< _Value, _Hash, _Pred, _Alloc > UnorderedSetStdStable
Definition: custom_set.hpp:215
void SelectInternalSignals(CustomUnorderedMap< unsigned int, UnorderedSetStdStable< std::string >> &fun_id_to_sig_names) const
RelationshipType
The relationship type.
This class manages the tree structures extracted from the raw file.
~VcdSignalSelection() override
Destructor.
REF_FORWARD_DECL(Discrepancy)
VcdSignalSelection(const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, const DesignFlowManagerConstRef design_flow_manager)
Constructor.
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
CONSTREF_FORWARD_DECL(tree_manager)
void SingleStepPropagateAddrSsa(const tree_nodeRef &curr_tn)
Single step used in the loop of PropagateAddrSsa()
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
Definition: custom_map.hpp:148
bool IsAddressType(const unsigned int type_index) const
Checks if type_index represents an address type.
void DetectInvalidReturns(const CustomOrderedSet< unsigned int > &reached_body_functions, CustomUnorderedSet< unsigned int > &addr_fun_ids)
Detects return statements resulting in values to be skipped in the discrepancy analysis.
void SelectInitialAddrParam(const CustomOrderedSet< unsigned int > &reached_body_fun_ids, CustomUnorderedMap< unsigned int, TreeNodeSet > &address_parameters)
Selects the initial set of function parameters to skip, iterating on the reached functions with a bod...
std::string present_state_name
The name of the present state signal.
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
Classes specification of the tree_node data structures.
DesignFlowStep_Status
The status of a step.
void SingleStepPropagateParamToSsa(const TreeNodeMap< size_t > &used_ssa, const TreeNodeSet &address_parameters)
Single step used in the loop of PropagateAddrParamToSsa()
void CrossPropagateAddrSsa(CustomUnorderedMap< unsigned int, TreeNodeSet > &address_parameters, const CustomOrderedSet< unsigned int > &reached_body_functions, const CustomUnorderedSet< unsigned int > &addr_fun_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &fu_id_to_call_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &call_id_to_called_id)
Propagates the information on the parameters to skip across function calls.
const DiscrepancyRef Discr
void PropagateAddrParamToSsa(const CustomUnorderedMap< unsigned int, TreeNodeSet > &address_parameters, const CustomOrderedSet< unsigned int > &reached_body_fun_ids)
Propagates the information on the ssa to skip to all the ssa in the functions with body...
void SelectAddrSsa(const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &fu_id_to_call_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &call_id_to_called_id)
Compute the ssa representing address values.
const tree_managerRef TM
void InProcedurePropagateAddr(const CustomUnorderedMap< unsigned int, TreeNodeSet > &address_parameters, const CustomOrderedSet< unsigned int > &reached_body_functions, CustomUnorderedSet< unsigned int > &addr_fun_ids)
Propagates the information on the ssa to skip to all the ssa in the functions with body...
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
DesignFlowStep_Status Exec() override
Executes the step.
void InitialPhiResIsAddress(const tree_nodeConstRef &tn)
Determines if the tree_node tn assigns an ssa_name representing an address.
void InitialSsaIsAddress(const tree_nodeConstRef &tn, const CustomUnorderedSet< unsigned int > &addr_fun_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &call_id_to_called_id)
Determines if the tree_node tn assigns an ssa_name representing an address.
const CustomUnorderedSet< std::tuple< HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship > > ComputeHLSRelationships(const DesignFlowStep::RelationshipType relationship_type) const override
Return the set of analyses in relationship with this design step.
void SelectInitialSsa(const CustomOrderedSet< unsigned int > &reached_body_fun_ids, const CustomUnorderedSet< unsigned int > &addr_fun_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &call_id_to_called_id)
Selects the initial set of ssa to skip, iterating on the reached functions with a body and inserting ...

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