diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2011-03-19 18:34:59 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2011-03-19 18:34:59 -0500 |
commit | 611f052e963b06b4a7e02b2fc6d847cd6d08d038 (patch) | |
tree | 0a3bdb5787d5e6ae9b0e07145cf2d32b4a532d6b /src/mem/protocol | |
parent | 2f4276448b82b2aa077ae257171b5cb04b7048f6 (diff) | |
download | gem5-611f052e963b06b4a7e02b2fc6d847cd6d08d038.tar.xz |
Ruby: Convert CacheRequestType to RubyRequestType
This patch converts CacheRequestType to RubyRequestType so that both the
protocol dependent and independent code makes use of the same request type.
Diffstat (limited to 'src/mem/protocol')
-rw-r--r-- | src/mem/protocol/MESI_CMP_directory-L1cache.sm | 12 | ||||
-rw-r--r-- | src/mem/protocol/MI_example-cache.sm | 10 | ||||
-rw-r--r-- | src/mem/protocol/MOESI_CMP_directory-L1cache.sm | 12 | ||||
-rw-r--r-- | src/mem/protocol/MOESI_CMP_token-L1cache.sm | 24 | ||||
-rw-r--r-- | src/mem/protocol/MOESI_hammer-cache.sm | 14 | ||||
-rw-r--r-- | src/mem/protocol/RubySlicc_Exports.sm | 28 |
6 files changed, 53 insertions, 47 deletions
diff --git a/src/mem/protocol/MESI_CMP_directory-L1cache.sm b/src/mem/protocol/MESI_CMP_directory-L1cache.sm index ab37a1bd8..705b2831c 100644 --- a/src/mem/protocol/MESI_CMP_directory-L1cache.sm +++ b/src/mem/protocol/MESI_CMP_directory-L1cache.sm @@ -183,15 +183,15 @@ machine(L1Cache, "MSI Directory L1 Cache CMP") } } - Event mandatory_request_type_to_event(CacheRequestType type) { - if (type == CacheRequestType:LD) { + Event mandatory_request_type_to_event(RubyRequestType type) { + if (type == RubyRequestType:LD) { return Event:Load; - } else if (type == CacheRequestType:IFETCH) { + } else if (type == RubyRequestType:IFETCH) { return Event:Ifetch; - } else if ((type == CacheRequestType:ST) || (type == CacheRequestType:ATOMIC)) { + } else if ((type == RubyRequestType:ST) || (type == RubyRequestType:ATOMIC)) { return Event:Store; } else { - error("Invalid CacheRequestType"); + error("Invalid RubyRequestType"); } } @@ -273,7 +273,7 @@ machine(L1Cache, "MSI Directory L1 Cache CMP") // Check for data access to blocks in I-cache and ifetchs to blocks in D-cache - if (in_msg.Type == CacheRequestType:IFETCH) { + if (in_msg.Type == RubyRequestType:IFETCH) { // ** INSTRUCTION ACCESS *** Entry L1Icache_entry := getL1ICacheEntry(in_msg.LineAddress); diff --git a/src/mem/protocol/MI_example-cache.sm b/src/mem/protocol/MI_example-cache.sm index c992e4a68..7923ef65c 100644 --- a/src/mem/protocol/MI_example-cache.sm +++ b/src/mem/protocol/MI_example-cache.sm @@ -84,15 +84,15 @@ machine(L1Cache, "MI Example L1 Cache") } // FUNCTIONS - Event mandatory_request_type_to_event(CacheRequestType type) { - if (type == CacheRequestType:LD) { + Event mandatory_request_type_to_event(RubyRequestType type) { + if (type == RubyRequestType:LD) { return Event:Load; - } else if (type == CacheRequestType:IFETCH) { + } else if (type == RubyRequestType:IFETCH) { return Event:Ifetch; - } else if ((type == CacheRequestType:ST) || (type == CacheRequestType:ATOMIC)) { + } else if ((type == RubyRequestType:ST) || (type == RubyRequestType:ATOMIC)) { return Event:Store; } else { - error("Invalid CacheRequestType"); + error("Invalid RubyRequestType"); } } diff --git a/src/mem/protocol/MOESI_CMP_directory-L1cache.sm b/src/mem/protocol/MOESI_CMP_directory-L1cache.sm index 310c3027a..291621af9 100644 --- a/src/mem/protocol/MOESI_CMP_directory-L1cache.sm +++ b/src/mem/protocol/MOESI_CMP_directory-L1cache.sm @@ -194,15 +194,15 @@ machine(L1Cache, "Directory protocol") } } - Event mandatory_request_type_to_event(CacheRequestType type) { - if (type == CacheRequestType:LD) { + Event mandatory_request_type_to_event(RubyRequestType type) { + if (type == RubyRequestType:LD) { return Event:Load; - } else if (type == CacheRequestType:IFETCH) { + } else if (type == RubyRequestType:IFETCH) { return Event:Ifetch; - } else if ((type == CacheRequestType:ST) || (type == CacheRequestType:ATOMIC)) { + } else if ((type == RubyRequestType:ST) || (type == RubyRequestType:ATOMIC)) { return Event:Store; } else { - error("Invalid CacheRequestType"); + error("Invalid RubyRequestType"); } } @@ -309,7 +309,7 @@ machine(L1Cache, "Directory protocol") // Check for data access to blocks in I-cache and ifetchs to blocks in D-cache - if (in_msg.Type == CacheRequestType:IFETCH) { + if (in_msg.Type == RubyRequestType:IFETCH) { // ** INSTRUCTION ACCESS *** Entry L1Icache_entry := getL1ICacheEntry(in_msg.LineAddress); diff --git a/src/mem/protocol/MOESI_CMP_token-L1cache.sm b/src/mem/protocol/MOESI_CMP_token-L1cache.sm index f801bebd8..8537029e7 100644 --- a/src/mem/protocol/MOESI_CMP_token-L1cache.sm +++ b/src/mem/protocol/MOESI_CMP_token-L1cache.sm @@ -341,31 +341,31 @@ machine(L1Cache, "Token protocol") } } - Event mandatory_request_type_to_event(CacheRequestType type) { - if (type == CacheRequestType:LD) { + Event mandatory_request_type_to_event(RubyRequestType type) { + if (type == RubyRequestType:LD) { return Event:Load; - } else if (type == CacheRequestType:IFETCH) { + } else if (type == RubyRequestType:IFETCH) { return Event:Ifetch; - } else if (type == CacheRequestType:ST) { + } else if (type == RubyRequestType:ST) { return Event:Store; - } else if (type == CacheRequestType:ATOMIC) { + } else if (type == RubyRequestType:ATOMIC) { if (no_mig_atomic) { return Event:Atomic; } else { return Event:Store; } } else { - error("Invalid CacheRequestType"); + error("Invalid RubyRequestType"); } } - AccessType cache_request_type_to_access_type(CacheRequestType type) { - if ((type == CacheRequestType:LD) || (type == CacheRequestType:IFETCH)) { + AccessType cache_request_type_to_access_type(RubyRequestType type) { + if ((type == RubyRequestType:LD) || (type == RubyRequestType:IFETCH)) { return AccessType:Read; - } else if ((type == CacheRequestType:ST) || (type == CacheRequestType:ATOMIC)) { + } else if ((type == RubyRequestType:ST) || (type == RubyRequestType:ATOMIC)) { return AccessType:Write; } else { - error("Invalid CacheRequestType"); + error("Invalid RubyRequestType"); } } @@ -629,7 +629,7 @@ machine(L1Cache, "Token protocol") TBE tbe := L1_TBEs[in_msg.LineAddress]; - if (in_msg.Type == CacheRequestType:IFETCH) { + if (in_msg.Type == RubyRequestType:IFETCH) { // ** INSTRUCTION ACCESS *** Entry L1Icache_entry := getL1ICacheEntry(in_msg.LineAddress); @@ -1313,7 +1313,7 @@ machine(L1Cache, "Token protocol") peek(mandatoryQueue_in, CacheMsg) { tbe.PC := in_msg.ProgramCounter; tbe.AccessType := cache_request_type_to_access_type(in_msg.Type); - if (in_msg.Type == CacheRequestType:ATOMIC) { + if (in_msg.Type == RubyRequestType:ATOMIC) { tbe.IsAtomic := true; } tbe.Prefetch := in_msg.Prefetch; diff --git a/src/mem/protocol/MOESI_hammer-cache.sm b/src/mem/protocol/MOESI_hammer-cache.sm index 860a7dc1d..ea2a1d6e3 100644 --- a/src/mem/protocol/MOESI_hammer-cache.sm +++ b/src/mem/protocol/MOESI_hammer-cache.sm @@ -214,15 +214,15 @@ machine(L1Cache, "AMD Hammer-like protocol") } } - Event mandatory_request_type_to_event(CacheRequestType type) { - if (type == CacheRequestType:LD) { + Event mandatory_request_type_to_event(RubyRequestType type) { + if (type == RubyRequestType:LD) { return Event:Load; - } else if (type == CacheRequestType:IFETCH) { + } else if (type == RubyRequestType:IFETCH) { return Event:Ifetch; - } else if ((type == CacheRequestType:ST) || (type == CacheRequestType:ATOMIC)) { + } else if ((type == RubyRequestType:ST) || (type == RubyRequestType:ATOMIC)) { return Event:Store; } else { - error("Invalid CacheRequestType"); + error("Invalid RubyRequestType"); } } @@ -359,7 +359,7 @@ machine(L1Cache, "AMD Hammer-like protocol") // Check for data access to blocks in I-cache and ifetchs to blocks in D-cache TBE tbe := TBEs[in_msg.LineAddress]; - if (in_msg.Type == CacheRequestType:IFETCH) { + if (in_msg.Type == RubyRequestType:IFETCH) { // ** INSTRUCTION ACCESS *** Entry L1Icache_entry := getL1ICacheEntry(in_msg.LineAddress); @@ -700,7 +700,7 @@ machine(L1Cache, "AMD Hammer-like protocol") cache_entry.DataBlk); cache_entry.Dirty := true; - if (in_msg.Type == CacheRequestType:ATOMIC) { + if (in_msg.Type == RubyRequestType:ATOMIC) { cache_entry.AtomicAccessed := true; } } diff --git a/src/mem/protocol/RubySlicc_Exports.sm b/src/mem/protocol/RubySlicc_Exports.sm index 7258e9ccd..1f7a1dda2 100644 --- a/src/mem/protocol/RubySlicc_Exports.sm +++ b/src/mem/protocol/RubySlicc_Exports.sm @@ -103,16 +103,22 @@ enumeration(TransitionResult, desc="...") { ProtocolStall, desc="Protocol specified stall"; } -// CacheRequestType -enumeration(CacheRequestType, desc="...", default="CacheRequestType_NULL") { - LD, desc="Load"; - ST, desc="Store"; - ATOMIC, desc="Atomic Load/Store"; - IFETCH, desc="Instruction fetch"; - IO, desc="I/O"; - REPLACEMENT, desc="Replacement"; - COMMIT, desc="Commit version"; - NULL, desc="Invalid request type"; +// RubyRequestType +enumeration(RubyRequestType, desc="...", default="RubyRequestType_NULL") { + LD, desc="Load"; + ST, desc="Store"; + ATOMIC, desc="Atomic Load/Store"; + IFETCH, desc="Instruction fetch"; + IO, desc="I/O"; + REPLACEMENT, desc="Replacement"; + Load_Linked, desc=""; + Store_Conditional, desc=""; + RMW_Read, desc=""; + RMW_Write, desc=""; + Locked_RMW_Read, desc=""; + Locked_RMW_Write, desc=""; + COMMIT, desc="Commit version"; + NULL, desc="Invalid request type"; } enumeration(SequencerRequestType, desc="...", default="SequencerRequestType_NULL") { @@ -211,7 +217,7 @@ enumeration(PrefetchBit, default="PrefetchBit_No", desc="...") { structure(CacheMsg, desc="...", interface="Message") { Address LineAddress, desc="Line address for this request"; Address PhysicalAddress, desc="Physical address for this request"; - CacheRequestType Type, desc="Type of request (LD, ST, etc)"; + RubyRequestType Type, desc="Type of request (LD, ST, etc)"; Address ProgramCounter, desc="Program counter of the instruction that caused the miss"; RubyAccessMode AccessMode, desc="user/supervisor access type"; int Size, desc="size in bytes of access"; |