41#ifndef __MEM_RUBY_STRUCTURES_PERFECTCACHEMEMORY_HH__
42#define __MEM_RUBY_STRUCTURES_PERFECTCACHEMEMORY_HH__
45#include <unordered_map>
49#include "mem/ruby/protocol/AccessPermission.hh"
67inline std::ostream& {
…}
106 void print(std::ostream& out)
const;
114 std::unordered_map<Addr, PerfectCacheLineState<ENTRY> >
m_map;
120 std::is_member_function_pointer_v<
decltype(&ENTRY::setRubySystem)>;
124inline std::ostream& {
…}
143 m_block_size =
rs->getBlockSizeBytes();
170 if constexpr (entryRequiresRubySystem) {
171 line_state.
m_entry.setRubySystem(m_ruby_system);
174 m_map.emplace(line_addr, line_state);
183 [[maybe_unused]]
auto num_erased = m_map.erase(line_addr);
184 assert(num_erased == 1);
192 panic(
"cacheProbe called in perfect cache");
202 return &m_map[line_addr].m_entry;
211 return &m_map[line_addr].m_entry;
215inline AccessPermission
219 return m_map[line_addr].m_permission;
225 AccessPermission new_perm)
ENTRY * lookup(Addr address)
PerfectCacheMemory & operator=(const PerfectCacheMemory &obj)
bool isTagPresent(Addr address) const
bool cacheAvail(Addr address) const
void setRubySystem(RubySystem *rs)
Addr cacheProbe(Addr newAddress) const
static constexpr bool entryRequiresRubySystem
PerfectCacheMemory(const PerfectCacheMemory &obj)
std::unordered_map< Addr, PerfectCacheLineState< ENTRY > > m_map
RubySystem * m_ruby_system
AccessPermission getPermission(Addr address) const
void allocate(Addr address)
void deallocate(Addr address)
void print(std::ostream &out) const
void changePermission(Addr address, AccessPermission new_perm)
static constexpr std::enable_if_t< std::is_integral_v< T >, int > floorLog2(T x)
#define panic(...)
This implements a cprintf based panic() function.
Addr makeLineAddress(Addr addr, int cacheLineBits)
Copyright (c) 2024 Arm Limited All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
std::ostream & operator<<(std::ostream &os, const BaseSemihosting::InPlaceArg &ipa)
AccessPermission m_permission