gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
81  AddressProfiler(const AddressProfiler& obj);
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__
gem5::ruby::AddressProfiler::setAllInstructions
void setAllInstructions(bool all_instructions)
Definition: AddressProfiler.cc:175
gem5::ruby::AddressProfiler::m_retryProfileHisto
Histogram m_retryProfileHisto
Definition: AddressProfiler.hh:90
gem5::ruby::Set
Definition: Set.hh:48
Profiler.hh
gem5::ruby::AddressProfiler::m_retryProfileHistoRead
Histogram m_retryProfileHistoRead
Definition: AddressProfiler.hh:92
Histogram.hh
gem5::ruby::AddressProfiler::m_retryProfileMap
AddressMap m_retryProfileMap
Definition: AddressProfiler.hh:89
gem5::ruby::AddressProfiler::profileGetX
void profileGetX(Addr datablock, Addr PC, const Set &owner, const Set &sharers, NodeID requestor)
Definition: AddressProfiler.cc:264
gem5::ruby::AddressProfiler::collateStats
void collateStats()
Definition: AddressProfiler.hh:77
gem5::ruby::operator<<
std::ostream & operator<<(std::ostream &os, const BoolVec &myvector)
Definition: BoolVec.cc:49
gem5::ruby::AddressProfiler::~AddressProfiler
~AddressProfiler()
Definition: AddressProfiler.cc:164
gem5::ruby::AddressProfiler::printStats
void printStats(std::ostream &out) const
Definition: AddressProfiler.cc:181
gem5::ruby::AddressProfiler::addTraceSample
void addTraceSample(Addr data_addr, Addr pc_addr, RubyRequestType type, RubyAccessMode access_mode, NodeID id, bool sharing_miss)
Definition: AddressProfiler.cc:299
gem5::ruby::AddressProfiler::print
void print(std::ostream &out) const
gem5::ruby::AddressProfiler::m_retryProfileHistoWrite
Histogram m_retryProfileHistoWrite
Definition: AddressProfiler.hh:91
gem5::ruby::AddressProfiler::m_gets_sharing_histogram
Histogram m_gets_sharing_histogram
Definition: AddressProfiler.hh:94
gem5::ruby::AddressProfiler::m_hot_lines
bool m_hot_lines
Definition: AddressProfiler.hh:99
gem5::ruby::AddressProfiler::m_macroBlockAccessTrace
AddressMap m_macroBlockAccessTrace
Definition: AddressProfiler.hh:87
gem5::ruby::AddressProfiler::regStats
void regStats(const std::string &name)
Definition: AddressProfiler.hh:76
gem5::ruby::AddressProfiler::m_all_instructions
bool m_all_instructions
Definition: AddressProfiler.hh:100
gem5::ruby::AddressProfiler::profileGetS
void profileGetS(Addr datablock, Addr PC, const Set &owner, const Set &sharers, NodeID requestor)
Definition: AddressProfiler.cc:282
gem5::ruby::AddressProfiler::m_num_of_sequencers
int m_num_of_sequencers
Definition: AddressProfiler.hh:102
gem5::ruby::AddressProfiler::m_profiler
Profiler * m_profiler
Definition: AddressProfiler.hh:96
gem5::ruby::AddressProfiler::AddressProfiler
AddressProfiler(int num_of_sequencers, Profiler *profiler)
Definition: AddressProfiler.cc:157
gem5::ruby::AddressProfiler::setHotLines
void setHotLines(bool hot_lines)
Definition: AddressProfiler.cc:169
gem5::X86ISA::count
count
Definition: misc.hh:710
gem5::ruby::lookupTraceForAddress
AccessTraceForAddress & lookupTraceForAddress(Addr addr, AddressMap &record_map)
Definition: AddressProfiler.cc:50
gem5::X86ISA::type
type
Definition: misc.hh:734
gem5::ruby::AddressProfiler
Definition: AddressProfiler.hh:50
gem5::ruby::printSorted
void printSorted(std::ostream &out, int num_of_sequencers, const AddressMap &record_map, std::string description, Profiler *profiler)
Definition: AddressProfiler.cc:72
gem5::ruby::AddressProfiler::AddressMap
std::unordered_map< Addr, AccessTraceForAddress > AddressMap
Definition: AddressProfiler.hh:53
AccessTraceForAddress.hh
gem5::ruby::AddressProfiler::m_getx_sharing_histogram
Histogram m_getx_sharing_histogram
Definition: AddressProfiler.hh:93
gem5::ruby::AddressProfiler::operator=
AddressProfiler & operator=(const AddressProfiler &obj)
gem5::ruby::AccessTraceForAddress
Definition: AccessTraceForAddress.hh:47
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
name
const std::string & name()
Definition: trace.cc:48
gem5::ruby::Histogram
Definition: Histogram.hh:44
gem5::ruby::AddressProfiler::profileRetry
void profileRetry(Addr data_addr, AccessType type, int count)
Definition: AddressProfiler.cc:336
Address.hh
gem5::ruby::AddressProfiler::m_dataAccessTrace
AddressMap m_dataAccessTrace
Definition: AddressProfiler.hh:86
gem5::ruby::NodeID
unsigned int NodeID
Definition: TypeDefines.hh:42
gem5::ruby::AddressProfiler::m_programCounterAccessTrace
AddressMap m_programCounterAccessTrace
Definition: AddressProfiler.hh:88
gem5::ruby::AddressProfiler::m_sharing_miss_counter
int64_t m_sharing_miss_counter
Definition: AddressProfiler.hh:84
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::ruby::Profiler
Definition: Profiler.hh:71
gem5::ruby::AddressProfiler::clearStats
void clearStats()
Definition: AddressProfiler.cc:248
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84

Generated on Sun Jul 30 2023 01:56:59 for gem5 by doxygen 1.8.17