gem5
v21.0.1.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
arch
riscv
pagetable.hh
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2002-2005 The Regents of The University of Michigan
3
* Copyright (c) 2007 MIPS Technologies, Inc.
4
* Copyright (c) 2020 Barkhausen Institut
5
* All rights reserved.
6
*
7
* Redistribution and use in source and binary forms, with or without
8
* modification, are permitted provided that the following conditions are
9
* met: redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer;
11
* redistributions in binary form must reproduce the above copyright
12
* notice, this list of conditions and the following disclaimer in the
13
* documentation and/or other materials provided with the distribution;
14
* neither the name of the copyright holders nor the names of its
15
* contributors may be used to endorse or promote products derived from
16
* this software without specific prior written permission.
17
*
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
*/
30
31
#ifndef __ARCH_RISCV_PAGETABLE_H__
32
#define __ARCH_RISCV_PAGETABLE_H__
33
34
#include "
base/bitunion.hh
"
35
#include "
base/logging.hh
"
36
#include "
base/trie.hh
"
37
#include "
base/types.hh
"
38
#include "
sim/serialize.hh
"
39
40
namespace
RiscvISA
{
41
42
BitUnion64
(SATP)
43
Bitfield<63, 60>
mode
;
44
Bitfield<59, 44>
asid
;
45
Bitfield<43, 0>
ppn
;
46
EndBitUnion
(SATP)
47
48
enum AddrXlateMode
49
{
50
BARE = 0,
51
SV39 = 8,
52
SV48 = 9,
53
};
54
55
// Sv39 paging
56
const
Addr
VADDR_BITS
= 39;
57
const
Addr
LEVEL_BITS
= 9;
58
const
Addr
LEVEL_MASK
= (1 <<
LEVEL_BITS
) - 1;
59
60
BitUnion64
(PTESv39)
61
Bitfield<53, 10>
ppn
;
62
Bitfield<53, 28>
ppn2
;
63
Bitfield<27, 19>
ppn1
;
64
Bitfield<18, 10>
ppn0
;
65
Bitfield<7>
d
;
66
Bitfield<6>
a
;
67
Bitfield<5>
g
;
68
Bitfield<4>
u
;
69
Bitfield<3, 1>
perm
;
70
Bitfield<3>
x
;
71
Bitfield<2>
w
;
72
Bitfield<1>
r
;
73
Bitfield<0>
v
;
74
EndBitUnion
(PTESv39)
75
76
struct
TlbEntry
;
77
typedef
Trie<Addr, TlbEntry>
TlbEntryTrie
;
78
79
struct
TlbEntry
:
public
Serializable
80
{
81
// The base of the physical page.
82
Addr
paddr
;
83
84
// The beginning of the virtual page this entry maps.
85
Addr
vaddr
;
86
// The size of the page this represents, in address bits.
87
unsigned
logBytes
;
88
89
uint16_t
asid
;
90
91
PTESv39
pte
;
92
93
TlbEntryTrie::Handle
trieHandle
;
94
95
// A sequence number to keep track of LRU.
96
uint64_t
lruSeq
;
97
98
TlbEntry
()
99
:
paddr
(0),
vaddr
(0),
logBytes
(0),
pte
(),
lruSeq
(0)
100
{}
101
102
// Return the page size in bytes
103
Addr
size
()
const
104
{
105
return
(
static_cast<
Addr
>
(1) <<
logBytes
);
106
}
107
108
void
serialize
(
CheckpointOut
&
cp
)
const override
;
109
void
unserialize
(
CheckpointIn
&
cp
)
override
;
110
};
111
112
};
113
#endif // __ARCH_RISCV_PAGETABLE_H__
114
RiscvISA::TlbEntry
Definition:
pagetable.hh:79
RiscvISA::mode
mode
Definition:
pagetable.hh:43
serialize.hh
RiscvISA::TlbEntry::size
Addr size() const
Definition:
pagetable.hh:103
Trie< Addr, TlbEntry >::Handle
Node * Handle
Definition:
trie.hh:122
RiscvISA::ppn
Bitfield< 43, 0 > ppn
Definition:
pagetable.hh:45
RiscvISA::w
Bitfield< 2 > w
Definition:
pagetable.hh:71
Serializable
Basic support for object serialization.
Definition:
serialize.hh:175
RiscvISA::ppn0
Bitfield< 18, 10 > ppn0
Definition:
pagetable.hh:64
RiscvISA::TlbEntry::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition:
pagetable.cc:51
RiscvISA::g
Bitfield< 5 > g
Definition:
pagetable.hh:67
RiscvISA::TlbEntry::logBytes
unsigned logBytes
Definition:
pagetable.hh:87
RiscvISA::asid
Bitfield< 59, 44 > asid
Definition:
pagetable.hh:44
RiscvISA::TlbEntry::lruSeq
uint64_t lruSeq
Definition:
pagetable.hh:96
RiscvISA::u
Bitfield< 4 > u
Definition:
pagetable.hh:68
Trie< Addr, TlbEntry >
RiscvISA
Definition:
fs_workload.cc:37
RiscvISA::VADDR_BITS
const Addr VADDR_BITS
Definition:
pagetable.hh:56
RiscvISA::TlbEntry::TlbEntry
TlbEntry()
Definition:
pagetable.hh:98
cp
Definition:
cprintf.cc:37
RiscvISA::TlbEntry::pte
PTESv39 pte
Definition:
pagetable.hh:91
RiscvISA::BitUnion64
BitUnion64(SATP) Bitfield< 63
bitunion.hh
RiscvISA::LEVEL_MASK
const Addr LEVEL_MASK
Definition:
pagetable.hh:58
RiscvISA::perm
Bitfield< 3, 1 > perm
Definition:
pagetable.hh:69
RiscvISA::x
Bitfield< 3 > x
Definition:
pagetable.hh:70
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition:
types.hh:148
RiscvISA::v
Bitfield< 0 > v
Definition:
pagetable.hh:73
RiscvISA::ppn1
Bitfield< 27, 19 > ppn1
Definition:
pagetable.hh:63
RiscvISA::LEVEL_BITS
const Addr LEVEL_BITS
Definition:
pagetable.hh:57
RiscvISA::EndBitUnion
EndBitUnion(SATP) enum AddrXlateMode
Definition:
pagetable.hh:46
RiscvISA::ppn2
Bitfield< 53, 28 > ppn2
Definition:
pagetable.hh:62
types.hh
RiscvISA::r
Bitfield< 1 > r
Definition:
pagetable.hh:72
logging.hh
CheckpointOut
std::ostream CheckpointOut
Definition:
serialize.hh:64
RiscvISA::a
Bitfield< 6 > a
Definition:
pagetable.hh:66
RiscvISA::TlbEntry::trieHandle
TlbEntryTrie::Handle trieHandle
Definition:
pagetable.hh:93
CheckpointIn
Definition:
serialize.hh:68
RiscvISA::d
Bitfield< 7 > d
Definition:
pagetable.hh:65
RiscvISA::TlbEntryTrie
Trie< Addr, TlbEntry > TlbEntryTrie
Definition:
pagetable.hh:77
RiscvISA::TlbEntry::vaddr
Addr vaddr
Definition:
pagetable.hh:85
RiscvISA::TlbEntry::paddr
Addr paddr
Definition:
pagetable.hh:82
trie.hh
RiscvISA::TlbEntry::asid
uint16_t asid
Definition:
pagetable.hh:89
RiscvISA::TlbEntry::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition:
pagetable.cc:40
Generated on Tue Jun 22 2021 15:28:21 for gem5 by
doxygen
1.8.17