diff options
Diffstat (limited to 'src/mem/protocol/MOESI_CMP_token-L2cache.sm')
-rw-r--r-- | src/mem/protocol/MOESI_CMP_token-L2cache.sm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mem/protocol/MOESI_CMP_token-L2cache.sm b/src/mem/protocol/MOESI_CMP_token-L2cache.sm index 8b87889b1..c9c729263 100644 --- a/src/mem/protocol/MOESI_CMP_token-L2cache.sm +++ b/src/mem/protocol/MOESI_CMP_token-L2cache.sm @@ -211,6 +211,21 @@ machine(L2Cache, "Token protocol") } } + AccessPermission getAccessPermission(Address addr) { + Entry cache_entry := getCacheEntry(addr); + if(is_valid(cache_entry)) { + return L2Cache_State_to_permission(cache_entry.CacheState); + } + + return AccessPermission:NotPresent; + } + + void setAccessPermission(Entry cache_entry, Address addr, State state) { + if (is_valid(cache_entry)) { + cache_entry.changePermission(L2Cache_State_to_permission(state)); + } + } + void removeSharer(Address addr, NodeID id) { if (localDirectory.isTagPresent(addr)) { |