diff options
author | Brad Beckmann <Brad.Beckmann@amd.com> | 2011-02-23 16:41:59 -0800 |
---|---|---|
committer | Brad Beckmann <Brad.Beckmann@amd.com> | 2011-02-23 16:41:59 -0800 |
commit | 12a05c23b7d351afee4b0c531021d8fb8ea5f57d (patch) | |
tree | 99a18647ecf642166068187915f2816a1007567d /src/mem/protocol/MOESI_CMP_token-L2cache.sm | |
parent | 7842e955193c3fba850201acc45001306fe2ff9b (diff) | |
download | gem5-12a05c23b7d351afee4b0c531021d8fb8ea5f57d.tar.xz |
ruby: automate permission setting
This patch integrates permissions with cache and memory states, and then
automates the setting of permissions within the generated code. No longer
does one need to manually set the permissions within the setState funciton.
This patch will faciliate easier functional access support by always correctly
setting permissions for both cache and memory states.
--HG--
rename : src/mem/slicc/ast/EnumDeclAST.py => src/mem/slicc/ast/StateDeclAST.py
rename : src/mem/slicc/ast/TypeFieldEnumAST.py => src/mem/slicc/ast/TypeFieldStateAST.py
Diffstat (limited to 'src/mem/protocol/MOESI_CMP_token-L2cache.sm')
-rw-r--r-- | src/mem/protocol/MOESI_CMP_token-L2cache.sm | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/mem/protocol/MOESI_CMP_token-L2cache.sm b/src/mem/protocol/MOESI_CMP_token-L2cache.sm index c23f98f9a..e685984c5 100644 --- a/src/mem/protocol/MOESI_CMP_token-L2cache.sm +++ b/src/mem/protocol/MOESI_CMP_token-L2cache.sm @@ -62,17 +62,17 @@ machine(L2Cache, "Token protocol") MessageBuffer L1RequestToL2Cache, network="From", virtual_network="1", ordered="false"; // STATES - enumeration(State, desc="L2 Cache states", default="L2Cache_State_I") { + state_declaration(State, desc="L2 Cache states", default="L2Cache_State_I") { // Base states - NP, desc="Not Present"; - I, desc="Idle"; - S, desc="Shared, not present in any local L1s"; - O, desc="Owned, not present in any L1s"; - M, desc="Modified, not present in any L1s"; + NP, AccessPermission:Invalid, desc="Not Present"; + I, AccessPermission:Invalid, desc="Idle"; + S, AccessPermission:Read_Only, desc="Shared, not present in any local L1s"; + O, AccessPermission:Read_Only, desc="Owned, not present in any L1s"; + M, AccessPermission:Read_Write, desc="Modified, not present in any L1s"; // Locked states - I_L, "I^L", desc="Invalid, Locked"; - S_L, "S^L", desc="Shared, Locked"; + I_L, AccessPermission:Busy, "I^L", desc="Invalid, Locked"; + S_L, AccessPermission:Busy, "S^L", desc="Shared, Locked"; } // EVENTS @@ -208,17 +208,6 @@ machine(L2Cache, "Token protocol") } cache_entry.CacheState := state; - - // Set permission - if (state == State:I) { - cache_entry.changePermission(AccessPermission:Invalid); - } else if (state == State:S || state == State:O ) { - cache_entry.changePermission(AccessPermission:Read_Only); - } else if (state == State:M ) { - cache_entry.changePermission(AccessPermission:Read_Write); - } else { - cache_entry.changePermission(AccessPermission:Invalid); - } } } |