summaryrefslogtreecommitdiff
path: root/src/mem/protocol/MOESI_CMP_token-dir.sm
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2011-06-08 11:58:09 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2011-06-08 11:58:09 -0500
commit67bb3070032fcb944a63aabb4ecfff692840e7bf (patch)
tree104a8558a460aed6bc716f624bdd156b8f12f28d /src/mem/protocol/MOESI_CMP_token-dir.sm
parent1f7a6274017821d58f3087120079477ac211ceaf (diff)
downloadgem5-67bb3070032fcb944a63aabb4ecfff692840e7bf.tar.xz
Ruby: Correctly set access permissions for directory entries
The access permissions for the directory entries are not being set correctly. This is because pointers are not used for handling directory entries. function. get and set functions for access permissions have been added to the Controller state machine. The changePermission() function provided by the AbstractEntry and AbstractCacheEntry classes has been exposed to SLICC code once again. The set_permission() functionality has been removed. NOTE: Each protocol will have to define these get and set functions in order to compile successfully.
Diffstat (limited to 'src/mem/protocol/MOESI_CMP_token-dir.sm')
-rw-r--r--src/mem/protocol/MOESI_CMP_token-dir.sm15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mem/protocol/MOESI_CMP_token-dir.sm b/src/mem/protocol/MOESI_CMP_token-dir.sm
index aabde0af8..9ca0f1fc6 100644
--- a/src/mem/protocol/MOESI_CMP_token-dir.sm
+++ b/src/mem/protocol/MOESI_CMP_token-dir.sm
@@ -199,7 +199,20 @@ machine(Directory, "Token protocol")
// assert(getDirectoryEntry(addr).Tokens >= (max_tokens() / 2)); // Only mostly true; this might not always hold
}
}
-
+
+ AccessPermission getAccessPermission(Address addr) {
+ TBE tbe := TBEs[addr];
+ if(is_valid(tbe)) {
+ return Directory_State_to_permission(tbe.TBEState);
+ }
+
+ return Directory_State_to_permission(getDirectoryEntry(addr).DirectoryState);
+ }
+
+ void setAccessPermission(Address addr, State state) {
+ getDirectoryEntry(addr).changePermission(Directory_State_to_permission(state));
+ }
+
bool okToIssueStarving(Address addr, MachineID machinID) {
return persistentTable.okToIssueStarving(addr, machineID);
}