ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
etiss
include
etiss
mm
PTEFormatBuilder.h
Go to the documentation of this file.
1
45
#ifndef ETISS_INCLUDE_MM_PTEFORMATBUILDER_H_
46
#define ETISS_INCLUDE_MM_PTEFORMATBUILDER_H_
47
48
#include <iostream>
49
#include <map>
50
#include <memory>
51
52
#include "
etiss/mm/PTEFormat.h
"
53
54
namespace
etiss
55
{
56
namespace
mm
57
{
58
62
class
PTEFormatBuilder
63
{
64
public
:
68
static
PTEFormatBuilder
&
Instance
()
69
{
70
static
std::shared_ptr<PTEFormatBuilder> builder(
new
PTEFormatBuilder
((
PTEFormat::Instance
())));
71
return
*builder;
72
}
73
77
PTEFormatBuilder
&
AddPPNBitField
(
uint32_t
begin,
uint32_t
end)
78
{
79
format_
.
AddBitField
(
"PPN"
, begin, end);
80
return
*
this
;
81
}
82
87
PTEFormatBuilder
&
AddPageOffset
(
uint32_t
begin,
uint32_t
end)
88
{
89
format_
.
AddBitField
(
"PAGEOFFSET"
, begin, end);
90
return
*
this
;
91
}
92
96
PTEFormatBuilder
&
AddFlag
(std::string name,
uint32_t
begin,
uint32_t
end)
97
{
98
format_
.
AddBitField
(name, begin, end);
99
return
*
this
;
100
}
101
105
PTEFormatBuilder
&
AddFlag
(std::string name,
uint32_t
pos)
106
{
107
format_
.
AddBitField
(name, pos, pos);
108
return
*
this
;
109
}
110
111
private
:
112
PTEFormatBuilder
(
PTEFormat
&format) :
format_
(format) {}
113
114
PTEFormat
&
format_
;
115
116
friend
class
PTEFormat
;
117
};
118
119
}
// namespace mm
120
}
// namespace etiss
121
122
#endif
PTEFormat.h
uint32_t
static __inline__ uint32_t
Definition:
arm_cde.h:25
etiss::mm::PTEFormatBuilder
Sigleton builder utility to build up customized PTE format.
Definition:
PTEFormatBuilder.h:63
etiss::mm::PTEFormatBuilder::AddFlag
PTEFormatBuilder & AddFlag(std::string name, uint32_t begin, uint32_t end)
Add optional bit field for protection flag in PTE.
Definition:
PTEFormatBuilder.h:96
etiss::mm::PTEFormatBuilder::format_
PTEFormat & format_
Definition:
PTEFormatBuilder.h:114
etiss::mm::PTEFormatBuilder::AddFlag
PTEFormatBuilder & AddFlag(std::string name, uint32_t pos)
Add optional bit field for protection flag in PTE.
Definition:
PTEFormatBuilder.h:105
etiss::mm::PTEFormatBuilder::PTEFormatBuilder
PTEFormatBuilder(PTEFormat &format)
Definition:
PTEFormatBuilder.h:112
etiss::mm::PTEFormatBuilder::AddPageOffset
PTEFormatBuilder & AddPageOffset(uint32_t begin, uint32_t end)
Add mandatory bit field for page size offset (Not included in PTE neither in PTE format)
Definition:
PTEFormatBuilder.h:87
etiss::mm::PTEFormatBuilder::AddPPNBitField
PTEFormatBuilder & AddPPNBitField(uint32_t begin, uint32_t end)
Add mandatory bit field, Physical Page Number (PPN), for PTE.
Definition:
PTEFormatBuilder.h:77
etiss::mm::PTEFormatBuilder::Instance
static PTEFormatBuilder & Instance()
Get the singleton instance.
Definition:
PTEFormatBuilder.h:68
etiss::mm::PTEFormat
Definition:
PTEFormat.h:65
etiss::mm::PTEFormat::Instance
static PTEFormat & Instance()
Get the singleton instance.
Definition:
PTEFormat.h:70
etiss::mm::PTEFormat::AddBitField
void AddBitField(std::string name, uint32_t begin, uint32_t end)
Called only by PTEFormatBuilder.
Definition:
PTEFormat.cpp:57
etiss
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
Definition:
Benchmark.h:53
Generated on Thu Oct 24 2024 09:40:11 for ETISS 0.8.0 by
1.9.1