PandA-2024.02
Discrepancy.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  */
39 #ifndef DISCREPANCY_HPP
40 #define DISCREPANCY_HPP
41 
42 #include "Parameter.hpp"
43 
44 // include from HLS/vcd/
45 #include "UnfoldedCallGraph.hpp"
46 
47 // includes from parser/discrepancy/
48 #include "DiscrepancyOpInfo.hpp"
49 #include "vcd_parser.hpp"
50 
51 // includes from tree/
52 #include "tree_node.hpp"
53 
54 // includes from utility/
55 #include "refcount.hpp"
56 
57 #include "custom_map.hpp"
58 #include "custom_set.hpp"
59 #include <string>
60 
62 
64 {
73 };
74 
77 
79 {
85 
92 
100 
109 
111 
120 };
121 
124 
126 {
129 
132 
135 
138 
144 
150 
153 
156 
161 
167 
172 
180  std::map<DiscrepancyOpInfo, std::list<std::pair<uint64_t, std::string>>> c_op_trace;
181 
189 
196 
202 
204  std::string c_trace_filename;
205 
206  unsigned long long n_total_operations = 0;
207 
208  unsigned long long n_checked_operations = 0;
209 
211  : call_sites_info(CallSitesInfoRef(new CallSitesInfo())),
212  hw_discrepancy_info(HWDiscrepancyInfoRef(new HWDiscrepancyInfo())),
213  DiscrepancyCallGraph(GraphInfoRef(new GraphInfo())){};
214 
215  void clear()
216  {
217  call_sites_info.reset(new CallSitesInfo);
218  DiscrepancyCallGraph = UnfoldedCallGraph(GraphInfoRef(new GraphInfo()));
219  unfolded_root_v = {};
220  selected_vcd_signals.clear();
221  opid_to_outsignal.clear();
222  unfolded_v_to_scope.clear();
223  f_id_to_scope.clear();
224  c_op_trace.clear();
225  c_control_flow_trace.clear();
226  c_addr_map.clear();
227  context_to_scope.clear();
228  c_trace_filename.clear();
229  n_total_operations = 0;
230  n_checked_operations = 0;
231  }
232 };
233 
236 #endif
REF_FORWARD_DECL(structural_manager)
Base class storing user data information to the whole graph.
Definition: graph_info.hpp:60
This class manages the circuit structures.
std::string c_trace_filename
name of the file that contains the c trace to parse
HWDiscrepancyInfoRef hw_discrepancy_info
Reference to a struct holding info on the control flow traces for hw discrepancy analysis.
CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int > > fu_id_to_call_ids
Maps every function to the calls it performs.
Definition: Discrepancy.hpp:66
CustomUnorderedMap< unsigned int, std::string > opid_to_outsignal
A map to store the name of the output signal of every operation.
CallSitesInfoRef call_sites_info
Reference to a struct holding info on the call sites.
TreeNodeSet ssa_to_skip_if_address
Set of tree nodes.
CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int > > fu_id_to_states_to_check
Maps every function ID to a set of states that must always be checked by the hardware discrepancy con...
Definition: Discrepancy.hpp:84
CustomUnorderedMap< uint64_t, std::string > context_to_scope
Maps every call context in the discrepancy trace to the corresponding scope in the generated HW...
redefinition of map to manage ordered/unordered structures
CustomUnorderedMap< unsigned int, std::map< uint64_t, std::list< unsigned int > > > c_control_flow_trace
This contains the control flow traces gathered from software execution.
UnorderedMapStd< std::string, UnorderedSetStdStable< std::string > > vcd_filter_t
this is the type used to select which signals have to be filtered during parsing. ...
Definition: vcd_parser.hpp:101
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
Definition: custom_map.hpp:148
TreeNodeSet address_ssa
Set of tree nodes representing the ssa_name to be treated as addresses in discrepancy analysis...
CustomUnorderedMap< unsigned int, size_t > fu_id_to_epp_trace_bitsize
Maps every function ID to the bitsize of the epp trace that is necessary for checking the control flo...
redefinition of set to manage ordered/unordered structures
UnfoldedVertexDescriptor unfolded_root_v
UnfoldedVertexDescriptor of the root of the DiscrepancyCallGraph.
CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int > > fu_id_to_feedback_states_to_check
Maps every function ID to a set of states that must be checked by the hardware discrepancy control fl...
Definition: Discrepancy.hpp:91
CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int > > call_id_to_called_id
Maps every id of a call site to the id of the called function.
Definition: Discrepancy.hpp:68
Classes specification of the tree_node data structures.
boost::graph_traits< UnfoldedCallGraph >::vertex_descriptor UnfoldedVertexDescriptor
Template definition of refcount.
CustomUnorderedSet< unsigned int > indirect_calls
Set of indirect calls.
Definition: Discrepancy.hpp:70
refcount< GraphInfo > GraphInfoRef
RefCount type definition of the GraphInfo class structure.
Definition: graph_info.hpp:74
UnfoldedCallGraph DiscrepancyCallGraph
Reference to the unfolded call graph used for the discrepancy analysis.
TreeNodeSet ssa_to_skip
Set of tree nodes representing the ssa_name to be skipped in discrepancy analysis.
CustomUnorderedSet< unsigned int > taken_addresses
Set of taken addresses.
Definition: Discrepancy.hpp:72
CustomUnorderedMap< uint64_t, CustomUnorderedMapStable< unsigned int, uint64_t > > c_addr_map
Address map used for address discrepancy analysis.
CustomUnorderedSet< unsigned int > fu_id_control_flow_skip
This set contains the ids of functions for which the control flow hardware discrepancy analyssi is no...
vcd_parser::vcd_filter_t selected_vcd_signals
A map to store the vcd signals to be dumped.
CustomUnorderedMap< UnfoldedVertexDescriptor, std::string > unfolded_v_to_scope
Map every vertex of the UnfoldedCallGraph to a scope in HW.
CustomUnorderedMap< unsigned int, UnorderedSetStdStable< EdgeDescriptor > > fu_id_to_reset_edges
Maps every function ID to a set EdgeDescriptors.
Definition: Discrepancy.hpp:99
this class is used to manage the command-line or XML options.
CustomUnorderedMap< unsigned int, CustomOrderedSet< std::string > > f_id_to_scope
Map every fun_id to the set of HW scopes of the functional modules.
CustomUnorderedMap< unsigned int, size_t > fu_id_to_max_epp_path_val
std::map< DiscrepancyOpInfo, std::list< std::pair< uint64_t, std::string > > > c_op_trace
Map a discrepancy info to the list of pairs representing the corresponding assignments in C...

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