gem5  v22.1.0.0
AddressProfiler.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met: redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef __MEM_RUBY_PROFILER_ADDRESSPROFILER_HH__
30 #define __MEM_RUBY_PROFILER_ADDRESSPROFILER_HH__
31 
32 #include <iostream>
33 #include <unordered_map>
34 
39 #include "mem/ruby/protocol/AccessType.hh"
40 #include "mem/ruby/protocol/RubyRequest.hh"
41 
42 namespace gem5
43 {
44 
45 namespace ruby
46 {
47 
48 class Set;
49 
51 {
52  public:
53  typedef std::unordered_map<Addr, AccessTraceForAddress> AddressMap;
54 
55  public:
56  AddressProfiler(int num_of_sequencers, Profiler *profiler);
58 
59  void printStats(std::ostream& out) const;
60  void clearStats();
61 
62  void addTraceSample(Addr data_addr, Addr pc_addr,
63  RubyRequestType type, RubyAccessMode access_mode,
64  NodeID id, bool sharing_miss);
65  void profileRetry(Addr data_addr, AccessType type, int count);
66  void profileGetX(Addr datablock, Addr PC,
67  const Set& owner, const Set& sharers, NodeID requestor);
68  void profileGetS(Addr datablock, Addr PC,
69  const Set& owner, const Set& sharers, NodeID requestor);
70 
71  void print(std::ostream& out) const;
72 
73  //added by SS
74  void setHotLines(bool hot_lines);
75  void setAllInstructions(bool all_instructions);
76  void regStats(const std::string &name) {}
77  void collateStats() {}
78 
79  private:
80  // Private copy constructor and assignment operator
83 
85 
95 
97 
98  //added by SS
101 
103 };
104 
107  record_map);
108 
109 void printSorted(std::ostream& out, int num_of_sequencers,
110  const AddressProfiler::AddressMap &record_map,
111  std::string description, Profiler *profiler);
112 
113 inline std::ostream&
114 operator<<(std::ostream& out, const AddressProfiler& obj)
115 {
116  obj.print(out);
117  out << std::flush;
118  return out;
119 }
120 
121 } // namespace ruby
122 } // namespace gem5
123 
124 #endif // __MEM_RUBY_PROFILER_ADDRESSPROFILER_HH__
void profileGetX(Addr datablock, Addr PC, const Set &owner, const Set &sharers, NodeID requestor)
void setHotLines(bool hot_lines)
AddressProfiler(const AddressProfiler &obj)
AddressProfiler(int num_of_sequencers, Profiler *profiler)
void profileRetry(Addr data_addr, AccessType type, int count)
std::unordered_map< Addr, AccessTraceForAddress > AddressMap
void print(std::ostream &out) const
void addTraceSample(Addr data_addr, Addr pc_addr, RubyRequestType type, RubyAccessMode access_mode, NodeID id, bool sharing_miss)
AddressProfiler & operator=(const AddressProfiler &obj)
void setAllInstructions(bool all_instructions)
void profileGetS(Addr datablock, Addr PC, const Set &owner, const Set &sharers, NodeID requestor)
void regStats(const std::string &name)
void printStats(std::ostream &out) const
Bitfield< 3 > addr
Definition: types.hh:84
void printSorted(std::ostream &out, int num_of_sequencers, const AddressMap &record_map, std::string description, Profiler *profiler)
AccessTraceForAddress & lookupTraceForAddress(Addr addr, AddressMap &record_map)
unsigned int NodeID
Definition: TypeDefines.hh:42
std::ostream & operator<<(std::ostream &os, const BoolVec &myvector)
Definition: BoolVec.cc:49
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
const std::string & name()
Definition: trace.cc:49

Generated on Wed Dec 21 2022 10:22:38 for gem5 by doxygen 1.9.1