ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
PTEFormat.h
Go to the documentation of this file.
1 
45 #ifndef ETISS_INCLUDE_MM_PTEFORMAT_H_
46 #define ETISS_INCLUDE_MM_PTEFORMAT_H_
47 #include <iostream>
48 #include <map>
49 #include <memory>
50 #include <string>
51 
52 namespace etiss
53 {
54 namespace mm
55 {
56 
62 typedef std::map<std::string, std::pair<uint32_t, uint32_t>> PTEFormatMap;
63 
64 class PTEFormat
65 {
66  public:
70  static PTEFormat &Instance()
71  {
72  static std::shared_ptr<PTEFormat> instance = std::shared_ptr<PTEFormat>(new PTEFormat());
73  return *instance;
74  }
75 
81  void AddBitField(std::string name, uint32_t begin, uint32_t end);
82 
86  void DumpBitFild(std::string name);
87 
91  void Dump();
92 
93  uint32_t GetPTELength() const { return pte_len_; }
94 
96 
97  private:
98  PTEFormat() : pte_len_(0) {}
101 };
102 
103 } // namespace mm
104 } // namespace etiss
105 
106 #endif
static __inline__ uint32_t
Definition: arm_cde.h:25
static PTEFormat & Instance()
Get the singleton instance.
Definition: PTEFormat.h:70
uint32_t GetPTELength() const
Definition: PTEFormat.h:93
void DumpBitFild(std::string name)
Dump the details of the bit field according to given name.
Definition: PTEFormat.cpp:66
void Dump()
Dump the details of the whole PTE format.
Definition: PTEFormat.cpp:81
void AddBitField(std::string name, uint32_t begin, uint32_t end)
Called only by PTEFormatBuilder.
Definition: PTEFormat.cpp:57
PTEFormatMap & GetFormatMap()
Definition: PTEFormat.h:95
PTEFormatMap format_map_
Definition: PTEFormat.h:99
std::map< std::string, std::pair< uint32_t, uint32_t > > PTEFormatMap
Singleton to represent specific PTE format, every PTE uses this singleton to parse raw PTE value into...
Definition: PTEFormat.h:62
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
Definition: Benchmark.h:53