29 #ifndef __MEM_RUBY_STRUCTURES_PERFECTCACHEMEMORY_HH__ 30 #define __MEM_RUBY_STRUCTURES_PERFECTCACHEMEMORY_HH__ 32 #include <unordered_map> 35 #include "mem/ruby/protocol/AccessPermission.hh" 47 operator<<(std::ostream& out, const PerfectCacheLineState<ENTRY>& obj)
59 bool isTagPresent(
Addr address)
const;
64 bool cacheAvail(
Addr address)
const;
67 void allocate(
Addr address);
69 void deallocate(
Addr address);
72 Addr cacheProbe(
Addr newAddress)
const;
75 ENTRY* lookup(
Addr address);
76 const ENTRY* lookup(
Addr address)
const;
79 AccessPermission getPermission(
Addr address)
const;
80 void changePermission(
Addr address, AccessPermission new_perm);
83 void print(std::ostream& out)
const;
91 std::unordered_map<Addr, PerfectCacheLineState<ENTRY> >
m_map;
96 operator<<(std::ostream& out, const PerfectCacheMemory<ENTRY>& obj)
103 template<
class ENTRY>
110 template<
class ENTRY>
117 template<
class ENTRY>
126 template<
class ENTRY>
137 template<
class ENTRY>
145 template<
class ENTRY>
149 panic(
"cacheProbe called in perfect cache");
154 template<
class ENTRY>
162 template<
class ENTRY>
169 template<
class ENTRY>
170 inline AccessPermission
176 template<
class ENTRY>
179 AccessPermission new_perm)
186 template<
class ENTRY>
192 #endif // __MEM_RUBY_STRUCTURES_PERFECTCACHEMEMORY_HH__ #define panic(...)
This implements a cprintf based panic() function.
void allocate(Addr address)
ENTRY * lookup(Addr address)
void print(std::ostream &out) const
std::unordered_map< Addr, PerfectCacheLineState< ENTRY > > m_map
void deallocate(Addr address)
AccessPermission getPermission(Addr address) const
AccessPermission m_permission
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Addr makeLineAddress(Addr addr)
void changePermission(Addr address, AccessPermission new_perm)
bool isTagPresent(Addr address) const
bool cacheAvail(Addr address) const
Addr cacheProbe(Addr newAddress) const