MOESI Cache Coherence Protocol Simulator

Interactive demonstration of the MOESI (Modified-Owned-Exclusive-Shared-Invalid) cache coherence protocol. MOESI extends MSI by adding Owned (O) and Exclusive (E) states for better performance optimization.

Understanding the MOESI Protocol

MOESI Protocol States:

  • M (Modified): Cache line is modified, exclusive, and dirty
  • O (Owned): Cache line is owned by this cache, shared with others, responsible for memory updates
  • E (Exclusive): Cache line is exclusive, clean, and unmodified
  • S (Shared): Cache line is shared, clean, and read-only
  • I (Invalid): Cache line is invalid, not present in this cache

Key MOESI Advantages:

  • Owned state allows sharing dirty data without writing back to memory
  • Exclusive state enables silent transitions to Modified on writes
  • Reduced memory traffic through cache-to-cache transfers
  • Better performance for producer-consumer sharing patterns
  • Optimized writeback only when necessary

How to Use This Simulator:

  1. Select a processor (P0 or P1)
  2. Choose an operation (Read or Write)
  3. Select a memory address (0x0 to 0x3)
  1. For writes, enter a data value
  2. Click "Execute Operation" to see the protocol in action
  3. Observe state transitions highlighted in the table above
Try This Test Sequence:
  1. P0 reads 0x0 → I→E (Exclusive access, no other copies)
  2. P1 reads 0x0 → P0: E→S, P1: I→S (Both share clean copy)
  3. P0 writes "100" to 0x0 → P0: S→M, P1: S→I (P0 gets exclusive write)
  4. P1 reads 0x0 → P0: M→O, P1: I→S (P0 owns, P1 shares dirty data)

Simulation Controls

Processor Cache States

Processor 0 Cache

Cache Index State Data Valid
Cache Performance: Hits: 0, Misses: 0

Processor 1 Cache

Cache Index State Data Valid
Cache Performance: Hits: 0, Misses: 0

Bus Transaction Log & State Transitions

No operations performed yet. Execute an operation to see the transaction log.