gem5 v24.0.0.0
Loading...
Searching...
No Matches
AccessTraceForAddress.cc
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
30
32
33namespace gem5
34{
35
36namespace ruby
37{
38
46
47void
48AccessTraceForAddress::print(std::ostream& out) const
49{
50 out << m_addr;
51
52 if (m_histogram_ptr == NULL) {
53 out << " " << m_total;
54 out << " | " << m_loads;
55 out << " " << m_stores;
56 out << " " << m_atomics;
57 out << " | " << m_user;
58 out << " " << m_total-m_user;
59 out << " | " << m_sharing;
60 out << " | " << m_touched_by.count();
61 } else {
62 assert(m_total == 0);
63 out << " " << (*m_histogram_ptr);
64 }
65}
66
67void
69 RubyAccessMode access_mode, NodeID cpu,
70 bool sharing_miss)
71{
72 m_touched_by.add(cpu);
73 m_total++;
74 if (type == RubyRequestType_ATOMIC) {
75 m_atomics++;
76 } else if (type == RubyRequestType_LD){
77 m_loads++;
78 } else if (type == RubyRequestType_ST){
79 m_stores++;
80 } else {
81 // ERROR_MSG("Trying to add invalid access to trace");
82 }
83
84 if (access_mode == RubyAccessMode_User) {
85 m_user++;
86 }
87
88 if (sharing_miss) {
89 m_sharing++;
90 }
91}
92
93int
95{
96 if (m_histogram_ptr == NULL) {
97 return m_total;
98 } else {
99 return m_histogram_ptr->getTotal();
100 }
101}
102
103void
105{
106 assert(m_total == 0);
107 if (m_histogram_ptr == NULL) {
109 }
110 m_histogram_ptr->add(value);
111}
112
113} // namespace ruby
114} // namespace gem5
void update(RubyRequestType type, RubyAccessMode access_mode, NodeID cpu, bool sharing_miss)
void print(std::ostream &out) const
int64_t getTotal() const
Definition Histogram.hh:61
void add(int64_t value)
Definition Histogram.cc:93
void add(NodeID index)
Definition Set.hh:78
int count() const
Definition Set.hh:129
unsigned int NodeID
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36

Generated on Tue Jun 18 2024 16:24:05 for gem5 by doxygen 1.11.0