gem5
v19.0.0.0
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
+
Enumerations
a
b
c
d
e
f
i
l
m
o
p
r
s
t
v
x
+
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
+
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
w
+
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Related Functions
:
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
z
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
+
Enumerations
a
b
c
d
e
f
g
i
l
m
o
p
r
s
t
v
w
+
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
cpu
pc_event.hh
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2002-2005 The Regents of The University of Michigan
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
* Authors: Nathan Binkert
29
* Steve Reinhardt
30
*/
31
32
#ifndef __PC_EVENT_HH__
33
#define __PC_EVENT_HH__
34
35
#include <vector>
36
37
#include "
base/logging.hh
"
38
#include "
base/types.hh
"
39
40
class
ThreadContext
;
41
class
PCEventQueue
;
42
class
System
;
43
class
PCEventScope
;
44
45
class
PCEvent
46
{
47
protected
:
48
std::string
description
;
49
PCEventScope
*
scope
;
50
Addr
evpc
;
51
52
public
:
53
PCEvent
(
PCEventScope
*
q
,
const
std::string &desc,
Addr
pc
);
54
55
virtual
~PCEvent
() {
if
(scope)
remove
(); }
56
57
// for DPRINTF
58
virtual
const
std::string
name
()
const
{
return
description
; }
59
60
std::string
descr
()
const
{
return
description
; }
61
Addr
pc
()
const
{
return
evpc
; }
62
63
bool
remove
();
64
virtual
void
process
(
ThreadContext
*tc) = 0;
65
};
66
67
class
PCEventScope
68
{
69
public
:
70
virtual
bool
remove
(
PCEvent
*
event
) = 0;
71
virtual
bool
schedule(
PCEvent
*
event
) = 0;
72
};
73
74
class
PCEventQueue
:
public
PCEventScope
75
{
76
protected
:
77
class
MapCompare
{
78
public
:
79
bool
80
operator()
(
PCEvent
*
const
&
l
,
PCEvent
*
const
&
r
)
const
81
{
82
return
l->
pc
() < r->
pc
();
83
}
84
bool
85
operator()
(
PCEvent
*
const
&
l
,
Addr
pc
)
const
86
{
87
return
l->
pc
() <
pc
;
88
}
89
bool
90
operator()
(
Addr
pc
,
PCEvent
*
const
&
r
)
const
91
{
92
return
pc < r->
pc
();
93
}
94
};
95
typedef
std::vector<PCEvent *>
Map
;
96
97
public
:
98
typedef
Map::iterator
iterator
;
99
typedef
Map::const_iterator
const_iterator
;
100
101
protected
:
102
typedef
std::pair<iterator, iterator>
range_t
;
103
typedef
std::pair<const_iterator, const_iterator>
const_range_t
;
104
105
protected
:
106
Map
pcMap
;
107
108
bool
doService(
Addr
pc
,
ThreadContext
*tc);
109
110
public
:
111
PCEventQueue
();
112
~
PCEventQueue
();
113
114
bool
remove
(
PCEvent
*
event
)
override
;
115
bool
schedule(
PCEvent
*
event
)
override
;
116
bool
service
(
Addr
pc
,
ThreadContext
*tc)
117
{
118
if
(pcMap.empty())
119
return
false
;
120
121
return
doService(pc, tc);
122
}
123
124
range_t equal_range(
Addr
pc
);
125
range_t
equal_range
(
PCEvent
*
event
) {
return
equal_range
(event->
pc
()); }
126
127
void
dump
()
const
;
128
};
129
130
131
inline
132
PCEvent::PCEvent
(
PCEventScope
*
s
,
const
std::string &desc,
Addr
pc
)
133
:
description
(desc),
scope
(s),
evpc
(pc)
134
{
135
scope
->
schedule
(
this
);
136
}
137
138
inline
bool
139
PCEvent::remove
()
140
{
141
if
(!
scope
)
142
panic
(
"cannot remove an uninitialized event;"
);
143
144
return
scope
->
remove
(
this
);
145
}
146
147
class
BreakPCEvent
:
public
PCEvent
148
{
149
protected
:
150
bool
remove
;
151
152
public
:
153
BreakPCEvent
(
PCEventScope
*
s
,
const
std::string &desc,
Addr
addr
,
154
bool
del =
false
);
155
virtual
void
process
(
ThreadContext
*tc);
156
};
157
158
class
PanicPCEvent
:
public
PCEvent
159
{
160
public
:
161
PanicPCEvent
(
PCEventScope
*
s
,
const
std::string &desc,
Addr
pc
);
162
virtual
void
process
(
ThreadContext
*tc);
163
};
164
165
#endif // __PC_EVENT_HH__
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition:
logging.hh:167
PanicPCEvent
Definition:
pc_event.hh:158
logging.hh
PCEvent::PCEvent
PCEvent(PCEventScope *q, const std::string &desc, Addr pc)
Definition:
pc_event.hh:132
PCEvent::remove
bool remove()
Definition:
pc_event.hh:139
std::pair
STL pair class.
Definition:
stl.hh:61
PCEventQueue::service
bool service(Addr pc, ThreadContext *tc)
Definition:
pc_event.hh:116
PCEvent::pc
Addr pc() const
Definition:
pc_event.hh:61
addr
ip6_addr_t addr
Definition:
inet.hh:335
PCEvent::descr
std::string descr() const
Definition:
pc_event.hh:60
PCEventQueue::MapCompare
Definition:
pc_event.hh:77
PCEvent::~PCEvent
virtual ~PCEvent()
Definition:
pc_event.hh:55
PCEvent::name
virtual const std::string name() const
Definition:
pc_event.hh:58
System
Definition:
system.hh:77
PCEvent::scope
PCEventScope * scope
Definition:
pc_event.hh:49
PCEvent::evpc
Addr evpc
Definition:
pc_event.hh:50
PCEventQueue::const_iterator
Map::const_iterator const_iterator
Definition:
pc_event.hh:99
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Definition:
thread_context.hh:93
std::vector< PCEvent * >
PCEventScope::schedule
virtual bool schedule(PCEvent *event)=0
PCEventQueue::MapCompare::operator()
bool operator()(PCEvent *const &l, Addr pc) const
Definition:
pc_event.hh:85
PCEventQueue::range_t
std::pair< iterator, iterator > range_t
Definition:
pc_event.hh:102
PCEvent::description
std::string description
Definition:
pc_event.hh:48
PCEventQueue
Definition:
pc_event.hh:74
ArmISA::s
Bitfield< 4 > s
Definition:
miscregs_types.hh:558
ArmISA::q
Bitfield< 27 > q
Definition:
miscregs_types.hh:55
PCEventQueue::equal_range
range_t equal_range(PCEvent *event)
Definition:
pc_event.hh:125
MipsISA::r
r
Definition:
pra_constants.hh:97
PCEventQueue::MapCompare::operator()
bool operator()(PCEvent *const &l, PCEvent *const &r) const
Definition:
pc_event.hh:80
types.hh
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition:
types.hh:142
PCEventQueue::Map
std::vector< PCEvent * > Map
Definition:
pc_event.hh:95
MipsISA::event
Bitfield< 10, 5 > event
Definition:
pra_constants.hh:299
PCEventQueue::const_range_t
std::pair< const_iterator, const_iterator > const_range_t
Definition:
pc_event.hh:103
PCEvent::process
virtual void process(ThreadContext *tc)=0
PCEventQueue::pcMap
Map pcMap
Definition:
pc_event.hh:106
PCEvent
Definition:
pc_event.hh:45
PCEventScope
Definition:
pc_event.hh:67
BreakPCEvent
Definition:
pc_event.hh:147
PCEventQueue::iterator
Map::iterator iterator
Definition:
pc_event.hh:98
Stats::dump
void dump()
Dump all statistics data to the registered outputs.
Definition:
statistics.cc:561
PCEventScope::remove
virtual bool remove(PCEvent *event)=0
MipsISA::l
Bitfield< 5 > l
Definition:
pra_constants.hh:322
PCEventQueue::MapCompare::operator()
bool operator()(Addr pc, PCEvent *const &r) const
Definition:
pc_event.hh:90
Generated on Fri Feb 28 2020 16:26:59 for gem5 by
doxygen
1.8.13