gem5
v21.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
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Enumerations
a
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
n
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
l
m
n
o
p
r
s
t
u
v
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
_
a
b
c
d
e
f
g
h
i
l
m
o
p
q
r
s
t
v
Enumerator
_
a
b
c
d
e
f
g
h
i
k
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
sim
kernel_workload.hh
Go to the documentation of this file.
1
/*
2
* Copyright 2019 Google Inc.
3
*
4
* Redistribution and use in source and binary forms, with or without
5
* modification, are permitted provided that the following conditions are
6
* met: redistributions of source code must retain the above copyright
7
* notice, this list of conditions and the following disclaimer;
8
* redistributions in binary form must reproduce the above copyright
9
* notice, this list of conditions and the following disclaimer in the
10
* documentation and/or other materials provided with the distribution;
11
* neither the name of the copyright holders nor the names of its
12
* contributors may be used to endorse or promote products derived from
13
* this software without specific prior written permission.
14
*
15
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
*/
27
28
#ifndef __SIM_KERNEL_WORKLOAD_HH__
29
#define __SIM_KERNEL_WORKLOAD_HH__
30
31
#include <string>
32
#include <vector>
33
34
#include "
base/loader/object_file.hh
"
35
#include "
base/loader/symtab.hh
"
36
#include "
base/types.hh
"
37
#include "params/KernelWorkload.hh"
38
#include "
sim/workload.hh
"
39
40
class
System
;
41
42
class
KernelWorkload
:
public
Workload
43
{
44
protected
:
45
Loader::MemoryImage
image
;
46
53
Addr
_loadAddrMask
;
54
60
Addr
_loadAddrOffset
;
61
62
Addr
_start
,
_end
;
63
64
std::vector<Loader::ObjectFile *>
extras
;
65
66
Loader::ObjectFile
*
kernelObj
=
nullptr
;
67
// Keep a separate copy of the kernel's symbol table so we can add things
68
// to it.
69
Loader::SymbolTable
kernelSymtab
;
70
71
const
std::string
commandLine
;
72
73
public
:
74
PARAMS
(
KernelWorkload
);
75
76
Addr
start
()
const
{
return
_start
; }
77
Addr
end
()
const
{
return
_end
; }
78
Addr
loadAddrMask
()
const
{
return
_loadAddrMask
; }
79
Addr
loadAddrOffset
()
const
{
return
_loadAddrOffset
; }
80
81
KernelWorkload
(
const
Params
&
p
);
82
83
Addr
getEntry
()
const override
{
return
kernelObj
->
entryPoint
(); }
84
Loader::Arch
85
getArch
()
const override
86
{
87
return
kernelObj
->
getArch
();
88
}
89
90
const
Loader::SymbolTable
&
91
symtab
(
ThreadContext
*tc)
override
92
{
93
return
kernelSymtab
;
94
}
95
96
bool
97
insertSymbol
(
const
Loader::Symbol
&symbol)
override
98
{
99
return
kernelSymtab
.
insert
(symbol);
100
}
101
102
void
initState
()
override
;
103
104
void
serialize
(
CheckpointOut
&
cp
)
const override
;
105
void
unserialize
(
CheckpointIn
&
cp
)
override
;
106
122
template
<
class
T,
typename
... Args>
123
T *
124
addKernelFuncEvent
(
const
char
*lbl, Args... args)
125
{
126
return
addFuncEvent<T>(
kernelSymtab
, lbl, std::forward<Args>(args)...);
127
}
128
129
template
<
class
T,
typename
... Args>
130
T *
131
addKernelFuncEventOrPanic
(
const
char
*lbl, Args... args)
132
{
133
T *
e
= addFuncEvent<T>(
kernelSymtab
, lbl, std::forward<Args>(args)...);
134
panic_if
(!
e
,
"Failed to find kernel symbol '%s'"
, lbl);
135
return
e
;
136
}
138
};
139
140
#endif // __SIM_KERNEL_WORKLOAD_HH__
KernelWorkload::addKernelFuncEventOrPanic
T * addKernelFuncEventOrPanic(const char *lbl, Args... args)
Definition:
kernel_workload.hh:131
SimObject::Params
SimObjectParams Params
Definition:
sim_object.hh:162
KernelWorkload::image
Loader::MemoryImage image
Definition:
kernel_workload.hh:45
KernelWorkload::getEntry
Addr getEntry() const override
Definition:
kernel_workload.hh:83
Workload
Definition:
workload.hh:40
KernelWorkload
Definition:
kernel_workload.hh:42
KernelWorkload::addKernelFuncEvent
T * addKernelFuncEvent(const char *lbl, Args... args)
Add a function-based event to a kernel symbol.
Definition:
kernel_workload.hh:124
KernelWorkload::loadAddrOffset
Addr loadAddrOffset() const
Definition:
kernel_workload.hh:79
Loader::SymbolTable
Definition:
symtab.hh:58
KernelWorkload::getArch
Loader::Arch getArch() const override
Definition:
kernel_workload.hh:85
KernelWorkload::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition:
kernel_workload.cc:134
std::vector< Loader::ObjectFile * >
workload.hh
Loader::MemoryImage
Definition:
memory_image.hh:48
KernelWorkload::_end
Addr _end
Definition:
kernel_workload.hh:62
KernelWorkload::kernelSymtab
Loader::SymbolTable kernelSymtab
Definition:
kernel_workload.hh:69
Loader::ObjectFile
Definition:
object_file.hh:74
cp
Definition:
cprintf.cc:37
KernelWorkload::initState
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition:
kernel_workload.cc:86
Loader::ObjectFile::entryPoint
Addr entryPoint() const
Definition:
object_file.hh:112
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition:
thread_context.hh:88
KernelWorkload::_loadAddrOffset
Addr _loadAddrOffset
Offset that should be used for binary/symbol loading.
Definition:
kernel_workload.hh:60
System
Definition:
system.hh:73
KernelWorkload::start
Addr start() const
Definition:
kernel_workload.hh:76
KernelWorkload::_start
Addr _start
Definition:
kernel_workload.hh:62
KernelWorkload::kernelObj
Loader::ObjectFile * kernelObj
Definition:
kernel_workload.hh:66
KernelWorkload::symtab
const Loader::SymbolTable & symtab(ThreadContext *tc) override
Definition:
kernel_workload.hh:91
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition:
types.hh:148
ArmISA::e
Bitfield< 9 > e
Definition:
miscregs_types.hh:61
KernelWorkload::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition:
kernel_workload.cc:128
panic_if
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition:
logging.hh:197
Loader::Arch
Arch
Definition:
object_file.hh:44
Loader::ObjectFile::getArch
Arch getArch() const
Definition:
object_file.hh:103
Loader::Symbol
Definition:
symtab.hh:45
types.hh
KernelWorkload::loadAddrMask
Addr loadAddrMask() const
Definition:
kernel_workload.hh:78
KernelWorkload::end
Addr end() const
Definition:
kernel_workload.hh:77
CheckpointOut
std::ostream CheckpointOut
Definition:
serialize.hh:64
Loader::SymbolTable::insert
bool insert(const Symbol &symbol)
Definition:
symtab.cc:51
symtab.hh
KernelWorkload::PARAMS
PARAMS(KernelWorkload)
KernelWorkload::extras
std::vector< Loader::ObjectFile * > extras
Definition:
kernel_workload.hh:64
KernelWorkload::KernelWorkload
KernelWorkload(const Params &p)
Definition:
kernel_workload.cc:34
MipsISA::p
Bitfield< 0 > p
Definition:
pra_constants.hh:323
KernelWorkload::commandLine
const std::string commandLine
Definition:
kernel_workload.hh:71
KernelWorkload::insertSymbol
bool insertSymbol(const Loader::Symbol &symbol) override
Definition:
kernel_workload.hh:97
CheckpointIn
Definition:
serialize.hh:68
object_file.hh
KernelWorkload::_loadAddrMask
Addr _loadAddrMask
Mask that should be anded for binary/symbol loading.
Definition:
kernel_workload.hh:53
Generated on Tue Mar 23 2021 19:41:28 for gem5 by
doxygen
1.8.17