MESI State Transitions
This chapter defines the coherence state machine of a requester (core-side cache controller). States describe a single cache line in a single core’s private cache.
State definitions
State |
Valid? |
Dirty? |
Other copies? |
Description |
|---|---|---|---|---|
|
Yes |
Yes |
None |
The only valid copy in the system; memory is stale. The core may read and write freely. The line must be written back before being relinquished. |
|
Yes |
No |
None |
Sole cached copy; memory is up to date. The core may read freely and
may write via the silent transition |
|
Yes |
No |
Possible |
Clean copy that other cores may also hold; memory is up to date.
Reads hit; writes require an |
|
No |
— |
— |
No valid copy present. Any access misses and generates a request. |
System-wide invariants
Rule |
Requirement |
|---|---|
|
At most one core holds a given line in
|
|
When any core holds a line in |
|
Dirty data for a line exists in at
most one place: a single |
Transition table
Events are of three kinds: processor accesses (CPU Read, CPU Write), capacity Eviction, and received B-channel messages. Response messages the core must emit are listed as actions.
State |
Event |
Action |
Next state |
|---|---|---|---|
|
CPU Read |
Send |
|
|
CPU Write |
Send |
|
|
|
Send |
|
|
CPU Read |
Hit; no message |
|
|
CPU Write |
Send |
|
|
Eviction |
Silent drop; no message |
|
|
|
Send |
|
|
CPU Read |
Hit; no message |
|
|
CPU Write |
Silent transition; no message |
|
|
Eviction |
Silent drop; no message |
|
|
|
Send |
|
|
CPU Read / CPU Write |
Hit; no message |
|
|
Eviction |
Send |
|
|
|
Send |
|
Requester rules
Rule |
Requirement |
|---|---|
|
Silent transitions. Exactly three state changes occur
without any message: |
|
A core shall issue |
|
A core shall respond to |
|
A core shall not cache or use granted data before the
grant transfer completes, and after transitioning to |
Note
Transient states. This specification defines only the four stable
states. Real controllers implement transient states while a request is
outstanding (e.g. I-awaiting-grant, S-awaiting-GrantM). PicoLink does
not standardize their encodings; it constrains only the externally
visible message behavior. The race rules in Ordering, Races, and Atomicity define
the required behavior when a B-channel message arrives while a request
is outstanding - notably Invalidate arriving during a pending
Upgrade (rule PL-RACE-03).
State diagram
stateDiagram-v2
direction LR
I --> S : CPU Read / GrantS
I --> E : CPU Read or Write / GrantE
S --> M : CPU Write / Upgrade→GrantM
E --> M : CPU Write (silent)
S --> I : Eviction (silent) or Invalidate/InvAck
E --> I : Eviction (silent) or Invalidate/InvAck
M --> I : Eviction or Invalidate / WriteBack
I --> I : Invalidate / InvAck