gem5 documentation Development Building Using KVM Sphinx Documentation Doxygen gem5 APIs Full System Checkpoints Directed Testers Debugging Architecture Support Power and Thermal Model Compiling Workloads Stats Package Stats API
Develop Branch v19.0.0.0 v20.0.0.0 v20.0.0.2 v20.0.0.3 v20.1.0.0 v20.1.0.1 v20.1.0.5 v21.0.0.0 v21.0.1.0 v21.1.0.0 v21.1.0.1 v21.1.0.2 v21.2.0.0 v21.2.1.0 v21.2.1.1 v22.0.0.0 v22.0.0.1 v22.1.0.0 v23.0.0.0 v23.0.0.1 v24.1.0.1
gem5 standard library Standard Library Overview Hello World Tutorial X86 Full-System Tutorial Developing Your Own Components Tutorial How To Create Your Own Board Using The gem5 Standard Library How to use local resources and data sources in gem5
gem5 Resources Creating Disk Images Devices m5term Building Linux ARM Kernel Building Android Marshmallow Guest binaries
Memory System Memory System gem5 Memory System Replacement Policies Indexing Policies Classic memory system coherence Classic caches
Ruby Memory System Ruby Cache Coherence Protocols Garnet 2.0 HeteroGarnet MOESI CMP directory Garnet Synthetic Traffic SLICC MI example Garnet standalone Interconnection network MOESI hammer MOESI CMP token MESI two level CHI Replacement Policies
CPU Models GPU Models M5ops authors: Jason Lowe-Power
last edited: 2025-11-07 04:09:52 +0000
last edited: 2025-11-07 04:09:52 +0000
MOESI CMP token
Protocol Overview
- This protocol also models a 2-level cache hierarchy.
- It maintains coherence permission by explicitly exchanging and counting tokens.
- A fix number of token are assigned to each cache block in the beginning, the number of token remains unchanged.
- To write a block, the processor must have all the token for that block. For reading at least one token is required.
- The protocol also has a persistent message support to avoid starvation.
Related Files
- src/mem/protocols
- MOESI_CMP_token-L1cache.sm: L1 cache controller specification
- MOESI_CMP_token-L2cache.sm: L2 cache controller specification
- MOESI_CMP_token-dir.sm: directory controller specification
- MOESI_CMP_token-dma.sm: dma controller specification
- MOESI_CMP_token-msg.sm: message type specification
- MOESI_CMP_token.slicc: container file
Controller Description
L1 Cache
| States | Invariants |
|---|---|
| MM | The cache block is held exclusively by this node and is potentially modified (similar to conventional “M” state). |
| MM_W | The cache block is held exclusively by this node and is potentially modified (similar to conventional “M” state). Replacements and DMA accesses are not allowed in this state. The block automatically transitions to MM state after a timeout. |
| O | The cache block is owned by this node. It has not been modified by this node. No other node holds this block in exclusive mode, but sharers potentially exist. |
| M | The cache block is held in exclusive mode, but not written to (similar to conventional “E” state). No other node holds a copy of this block. Stores are not allowed in this state. |
| M_W | The cache block is held in exclusive mode, but not written to (similar to conventional “E” state). No other node holds a copy of this block. Only loads and stores are allowed. Silent upgrade happens to MM_W state on store. Replacements and DMA accesses are not allowed in this state. The block automatically transitions to M state after a timeout. |
| S | The cache block is held in shared state by 1 or more nodes. Stores are not allowed in this state. |
| I | The cache block is invalid. |
L2 cache
| States | Invariants |
|---|---|
| NP | The cache block is held exclusively by this node and is potentially locally modified (similar to conventional “M” state). |
| O | The cache block is owned by this node. It has not been modified by this node. No other node holds this block in exclusive mode, but sharers potentially exist. |
| M | The cache block is held in exclusive mode, but not written to (similar to conventional “E” state). No other node holds a copy of this block. Stores are not allowed in this state. |
| S | The cache line holds the most recent, correct copy of the data. Other processors in the system may hold copies of the data in the shared state, as well. The cache line can be read, but not written in this state. |
| I | The cache line is invalid and does not hold a valid copy of the data. |
Directory controller
| States | Invariants |
|---|---|
| O | Owner . |
| NO | Not Owner. |
| L | Locked. |
