Skip to main content

PTO-ARCH-MEMORY-MODEL-MEMORY-EVENTS

PTO-ARCH-MEMORY-MODEL-MEMORY-EVENTS

ASL pseudocode

The complete ASL owner is shown directly below.

// PTO-UNIT: {"id":"PTO-ARCH-MEMORY-MODEL-MEMORY-EVENTS","surface":"arch","classification":["memory-model","memory-events"],"depends_on":["PTO-ARCH-MEMORY-MODEL-ADDRESS-SPACE"]}// PTO-REQ-MEMORY-TSO-001: bounded executable candidate-execution checker for// PTO total store order. The event bound is verification infrastructure, not// an architectural limit on agents or executions.
pure func MemoryEventIsRead(event: MemoryEvent) => booleanbegin    return event.kind == MemoryEvent_Load || event.kind == MemoryEvent_Atomic;end;
pure func MemoryEventIsWrite(event: MemoryEvent) => booleanbegin    return event.kind == MemoryEvent_InitialWrite ||           event.kind == MemoryEvent_Store ||           (event.kind == MemoryEvent_Atomic && event.write_performed);end;
pure func MemoryEventIsAccess(event: MemoryEvent) => booleanbegin    return MemoryEventIsRead(event) || MemoryEventIsWrite(event);end;
pure func MemoryEventsShareLocation(left: MemoryEvent,                                    right: MemoryEvent) => booleanbegin    return left.address == right.address && left.size_bytes == right.size_bytes;end;
pure func MemoryEventClass(event: MemoryEvent) => bits(4)begin    // FENCE.D mask bits are: data read, data write, device, and instruction.    // The current candidate model contains data events; atomic events are both    // reads and writes. Instruction and device classes remain explicit masks.    case event.kind of        when MemoryEvent_Load => return '0001';        when MemoryEvent_Store, MemoryEvent_InitialWrite => return '0010';        when MemoryEvent_Atomic => return '0011';        when MemoryEvent_Fence => return Zeros{4};    end;end;
func ResetMemoryExecution()begin    _MemoryEventCount = 0;end;
// Production event extraction is an explicit verification mode because the// bounded event array is model-checking infrastructure, not an architectural// execution limit. Manual candidate construction remains available while// capture is disabled.func StartMemoryEventCapture(agent: MemoryAgentId)begin    ResetMemoryExecution();    _CurrentMemoryAgent = agent;    _MemoryEventCaptureEnabled = TRUE;end;
func SelectMemoryEventAgent(agent: MemoryAgentId)begin    _CurrentMemoryAgent = agent;end;
func StopMemoryEventCapture()begin    _MemoryEventCaptureEnabled = FALSE;end;
func AddMemoryEvent(event: MemoryEvent) => MemoryEventIndexbegin    assert _MemoryEventCount < PTO_MODEL_MEMORY_EVENTS;    let index = _MemoryEventCount as MemoryEventIndex;    _MemoryEvents[[index]] = event;    _MemoryEventCount = (_MemoryEventCount + 1) as        integer {0..PTO_MODEL_MEMORY_EVENTS};    return index;end;
func AddInitialWriteEvent(address: Word, size_bytes: integer {1,2,4,8},                          value: Word) => MemoryEventIndexbegin    return AddMemoryEvent(MemoryEvent {        kind = MemoryEvent_InitialWrite,        agent = 0,        address = address,        size_bytes = size_bytes,        read_value = Zeros{PTO_XLEN},        write_value = NormalizeMemoryAccessValue(value, size_bytes),        write_performed = TRUE,        order = MemoryOrder_Relaxed,        read_from = 0,        coherence_rank = 0,        fence_predecessor = Zeros{4},        fence_successor = Zeros{4}    });end;
func AddLoadEvent(agent: MemoryAgentId, address: Word,                  size_bytes: integer {1,2,4,8}, value: Word,                  order: MemoryOrder) => MemoryEventIndexbegin    return AddMemoryEvent(MemoryEvent {        kind = MemoryEvent_Load,        agent = agent,        address = address,        size_bytes = size_bytes,        read_value = NormalizeMemoryAccessValue(value, size_bytes),        write_value = Zeros{PTO_XLEN},        write_performed = FALSE,        order = order,        read_from = 0,        coherence_rank = 0,        fence_predecessor = Zeros{4},        fence_successor = Zeros{4}    });end;
func AddStoreEvent(agent: MemoryAgentId, address: Word,                   size_bytes: integer {1,2,4,8}, value: Word,                   order: MemoryOrder, rank: MemoryCoherenceRank)                   => MemoryEventIndexbegin    return AddMemoryEvent(MemoryEvent {        kind = MemoryEvent_Store,        agent = agent,        address = address,        size_bytes = size_bytes,        read_value = Zeros{PTO_XLEN},        write_value = NormalizeMemoryAccessValue(value, size_bytes),        write_performed = TRUE,        order = order,        read_from = 0,        coherence_rank = rank,        fence_predecessor = Zeros{4},        fence_successor = Zeros{4}    });end;
func AddAtomicEvent(agent: MemoryAgentId, address: Word,                    size_bytes: integer {1,2,4,8}, read_value: Word,                    write_value: Word, order: MemoryOrder,                    rank: MemoryCoherenceRank) => MemoryEventIndexbegin    return AddAtomicOutcomeEvent(agent, address, size_bytes, read_value,        write_value, order, rank, TRUE);end;
func AddAtomicOutcomeEvent(agent: MemoryAgentId, address: Word,                           size_bytes: integer {1,2,4,8}, read_value: Word,                           write_value: Word, order: MemoryOrder,                           rank: MemoryCoherenceRank,                           write_performed: boolean) => MemoryEventIndexbegin    return AddMemoryEvent(MemoryEvent {        kind = MemoryEvent_Atomic,        agent = agent,        address = address,        size_bytes = size_bytes,        read_value = NormalizeMemoryAccessValue(read_value, size_bytes),        write_value = NormalizeMemoryAccessValue(write_value, size_bytes),        write_performed = write_performed,        order = order,        read_from = 0,        coherence_rank = rank,        fence_predecessor = Zeros{4},        fence_successor = Zeros{4}    });end;
func AddDataFenceEvent(agent: MemoryAgentId, predecessor: bits(4),                       successor: bits(4)) => MemoryEventIndexbegin    return AddMemoryEvent(MemoryEvent {        kind = MemoryEvent_Fence,        agent = agent,        address = Zeros{PTO_XLEN},        size_bytes = 1,        read_value = Zeros{PTO_XLEN},        write_value = Zeros{PTO_XLEN},        write_performed = FALSE,        order = MemoryOrder_AcquireRelease,        read_from = 0,        coherence_rank = 0,        fence_predecessor = predecessor,        fence_successor = successor    });end;

Architecture behavior

purpose scope

Purpose and scope

This unit defines the bounded event records used to construct and inspect a PTO total-store-order candidate execution. It supports explicit event construction and optional capture from production memory helpers.

concepts state

Event kinds and fields

  • Loads and atomics are reads; initial writes, stores, and write-performing atomics are writes.
  • Two events share a location only when both address and size_bytes match.
  • Data event classes use 0001 for reads, 0010 for writes, and 0011 for atomics; fence events carry separate predecessor and successor masks.
rules interactions

Capture lifecycle

  • StartMemoryEventCapture resets the sequence, selects a MemoryAgentId, and enables capture.
  • SelectMemoryEventAgent changes the agent used by subsequent wrappers.
  • StopMemoryEventCapture disables automatic recording without deleting the captured sequence.
  • AddMemoryEvent appends one event and advances _MemoryEventCount; specialized helpers normalize access values before appending.
boundaries

Verification boundary

The event array bound and PTO_MODEL_MEMORY_EVENTS assertion are model-checking infrastructure. They do not impose an architectural limit on the number of agents or the length of a real execution. Instruction and device fence classes remain explicit mask space even though this candidate model records data events.

example usage

illustrative capture example

Use this example block only as a reading aid: apply the rules above, then confirm the result in the normative ASL owner. It does not add an architectural contract.

Related owners

  • Address-space helpers provide bounded byte storage beneath event-producing operations.
  • Atomicity assigns coherence and reads-from data; ordering evaluates the complete candidate.

NDF clauses

Bodies come from owning ASL. Dragging or buttons change only this page-session view order.

No NDF clause is attached to this unit.

Evidence index

8 matching entries

Executable evidence1
  • PTO-ARCH-MEMORY-MODEL-MEMORY-EVENTS compiles as an independent normative unit
    1. surfaceARCH
    2. ownerPTO-ARCH-MEMORY-MODEL-MEMORY-EVENTS
    3. categorySTATIC-INVARIANT
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-ARCH-MEMORY-MODEL-MEMORY-EVENTS-STATIC-001
    Path
    tests/asl/arch/memory-model/memory-events/arch-static-memory-events-contract-001.asl
    Kind / role
    static-invariant
    Pass condition
    the complete model and this unit's static invariant compile
    SHA-256
    8ee092e2d47ed671d8ef54d6a70ffac9676f058c85fe86b11f0b2ce46a89996d
    Open exact source ↗ for PTO-AVS-ARCH-MEMORY-MODEL-MEMORY-EVENTS-STATIC-001
Commit-scoped evidence5
  • spec/evidence/release-traceability-readiness.json · closedPTO-EVIDENCE-RELEASE-TRACEABILITY
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-RELEASE-TRACEABILITY
    Path
    spec/evidence/release-traceability-readiness.json
    Kind / role
    ASL/NDF/documentation/AVS traceability
    SHA-256
    c7327021d39dc67ac5564bc55073b3870a397d79ac8d9648284d56e33bc14a3e
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-TRACEABILITY
  • spec/evidence/instruction-contract-closure.json · closedPTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE
    Path
    spec/evidence/instruction-contract-closure.json
    Kind / role
    mnemonic and encoding contract closure
    SHA-256
    3ef2bb62421c79dff8fa77a1c7983923b523244b8090812883ef81286ca8106a
    Open exact source ↗ for PTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE
  • spec/evidence/architecture-readiness.json · openPTO-EVIDENCE-ARCHITECTURE-READINESS
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-ARCHITECTURE-READINESS
    Path
    spec/evidence/architecture-readiness.json
    Kind / role
    architecture maturity and blockers
    SHA-256
    4b0b85199101251bea744e0f3591cc31906909dc80d5ab651c417a936036a004
    Open exact source ↗ for PTO-EVIDENCE-ARCHITECTURE-READINESS
  • spec/evidence/release-gate-readiness.json · ready-for-exact-head-verificationPTO-EVIDENCE-RELEASE-GATE-READINESS
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-RELEASE-GATE-READINESS
    Path
    spec/evidence/release-gate-readiness.json
    Kind / role
    exact-head gate readiness
    SHA-256
    a0f4d2b6920c08981ea55fd8ef820708a40d4feb5402c5150e8e9ab532d84ce0
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-GATE-READINESS
  • spec/release-manifest.json · draftPTO-EVIDENCE-RELEASE-MANIFEST
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-RELEASE-MANIFEST
    Path
    spec/release-manifest.json
    Kind / role
    release content and encoding fingerprints
    SHA-256
    1a64c109ed7a90351c41e2a418b3c0ebaf8ad975838986d2101385186b85c0d8
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-MANIFEST
Decision history2
  • PTO total store order candidate model · accepted
    1. decision recordADR
    2. case0006

    Decision record

    Loading ADR-0006…

    Sources and references
    Complete stable ID
    ADR-0006
    Path
    docs/status/decisions/0006-pto-total-store-order.md
    Affected units
    PTO-ARCH-MEMORY-MODEL-ADDRESS-SPACE, PTO-ARCH-MEMORY-MODEL-ATOMICITY, PTO-ARCH-MEMORY-MODEL-FAULT-PRECISION, PTO-ARCH-MEMORY-MODEL-MEMORY-EVENTS, PTO-ARCH-MEMORY-MODEL-ORDERING, PTO-ARCH-OVERVIEW-ARCHITECTURE
    Affected NDF
    PTO-ARCH-COMMIT-EVENT-CONFORMANCE-001
    SHA-256
    b80d8782e4587d4023edf02df9d2ba4d3cb2b2999fdc8991e49a2af4f9817735
    Open exact decision source ↗ for ADR-0006
  • Production memory events and atomic corners · accepted
    1. decision recordADR
    2. case0020

    Decision record

    Loading ADR-0020…

    Sources and references
    Complete stable ID
    ADR-0020
    Path
    docs/status/decisions/0020-production-memory-events-and-atomic-corners.md
    Affected units
    PTO-ARCH-MEMORY-MODEL-ADDRESS-SPACE, PTO-ARCH-MEMORY-MODEL-ATOMICITY, PTO-ARCH-MEMORY-MODEL-FAULT-PRECISION, PTO-ARCH-MEMORY-MODEL-GLOBAL-MEMORY-ACCESS, PTO-ARCH-MEMORY-MODEL-MEMORY-EVENTS, PTO-ARCH-MEMORY-MODEL-ORDERING, PTO-BLOCK-BSTART-GMOV, PTO-BLOCK-BSTART-MGATHER, PTO-BLOCK-BSTART-MGATHER-CAS, PTO-BLOCK-BSTART-MGATHER-MASK, PTO-BLOCK-BSTART-MSCATTER, PTO-BLOCK-BSTART-MSCATTER-MASK, PTO-BLOCK-BSTART-TLOAD, PTO-BLOCK-BSTART-TPREFETCH, PTO-BLOCK-BSTART-TSTORE, PTO-SCALAR-CASB, PTO-SCALAR-CASD, PTO-SCALAR-CASH, PTO-SCALAR-CASW, PTO-SCALAR-DMA, PTO-SCALAR-HL-CASB, PTO-SCALAR-HL-CASD, PTO-SCALAR-HL-CASH, PTO-SCALAR-HL-CASW, PTO-SCALAR-LD-ADD, PTO-SCALAR-LD-AND, PTO-SCALAR-LD-OR, PTO-SCALAR-LD-SMAX, PTO-SCALAR-LD-SMIN, PTO-SCALAR-LD-UMAX, PTO-SCALAR-LD-UMIN, PTO-SCALAR-LD-XOR, PTO-SCALAR-LR-B, PTO-SCALAR-LR-D, PTO-SCALAR-LR-H, PTO-SCALAR-LR-W, PTO-SCALAR-LW-ADD, PTO-SCALAR-LW-AND, PTO-SCALAR-LW-OR, PTO-SCALAR-LW-SMAX, PTO-SCALAR-LW-SMIN, PTO-SCALAR-LW-UMAX, PTO-SCALAR-LW-UMIN, PTO-SCALAR-LW-XOR, PTO-SCALAR-SC-B, PTO-SCALAR-SC-D, PTO-SCALAR-SC-H, PTO-SCALAR-SC-W, PTO-SCALAR-SD-ADD, PTO-SCALAR-SD-AND, PTO-SCALAR-SD-OR, PTO-SCALAR-SD-SMAX, PTO-SCALAR-SD-SMIN, PTO-SCALAR-SD-UMAX, PTO-SCALAR-SD-UMIN, PTO-SCALAR-SD-XOR, PTO-SCALAR-SW-ADD, PTO-SCALAR-SW-AND, PTO-SCALAR-SW-OR, PTO-SCALAR-SW-SMAX, PTO-SCALAR-SW-SMIN, PTO-SCALAR-SW-UMAX, PTO-SCALAR-SW-UMIN, PTO-SCALAR-SW-XOR, PTO-SCALAR-SWAPB, PTO-SCALAR-SWAPD, PTO-SCALAR-SWAPH, PTO-SCALAR-SWAPW, PTO-TILE-GMOV, PTO-TILE-MGATHER, PTO-TILE-MGATHER-CAS, PTO-TILE-MGATHER-MASK, PTO-TILE-MSCATTER, PTO-TILE-MSCATTER-MASK, PTO-TILE-TLOAD, PTO-TILE-TMOV, PTO-TILE-TPREFETCH, PTO-TILE-TSTORE
    Affected NDF
    PTO-ARCH-GM-ACCESS-001, PTO-BSTART-GMOV-COLLECTIVE-001, PTO-BSTART-MGATHER-CAS-SCHEMA-001, PTO-BSTART-MGATHER-MASK-SCHEMA-001, PTO-BSTART-MGATHER-SCHEMA-001, PTO-BSTART-MSCATTER-MASK-SCHEMA-001, PTO-BSTART-MSCATTER-SCHEMA-001, PTO-BSTART-TLOAD-CUBE-001, PTO-BSTART-TLOAD-MEMORY-001, PTO-BSTART-TPREFETCH-MEMORY-001, PTO-BSTART-TSTORE-CUBE-001, PTO-BSTART-TSTORE-MEMORY-001, PTO-GMOV-CORE4-PEER-001, PTO-MGATHER-BYTE-DISPLACEMENT-001, PTO-MGATHER-CAS-ATOMIC-001, PTO-MGATHER-CAS-PUBLICATION-001, PTO-MGATHER-MASK-PREDICATE-001, PTO-MGATHER-MASK-PUBLICATION-001, PTO-MGATHER-MASK-TYPE-002, PTO-MSCATTER-BYTE-DISPLACEMENT-001, PTO-MSCATTER-DUPLICATE-ORDER-001, PTO-MSCATTER-MASK-DUPLICATE-001, PTO-MSCATTER-MASK-PREDICATE-001, PTO-MSCATTER-MASK-TYPE-002, PTO-SD-XOR-ADR-CONTRACT-001, PTO-SW-ADD-ADR-CONTRACT-001, PTO-SW-AND-ADR-CONTRACT-001, PTO-SW-OR-ADR-CONTRACT-001, PTO-SW-SMAX-ADR-CONTRACT-001, PTO-SW-SMIN-ADR-CONTRACT-001, PTO-SW-UMAX-ADR-CONTRACT-001, PTO-SW-UMIN-ADR-CONTRACT-001, PTO-SW-XOR-ADR-CONTRACT-001, PTO-SWAPB-ADR-CONTRACT-001, PTO-SWAPD-ADR-CONTRACT-001, PTO-SWAPH-ADR-CONTRACT-001, PTO-SWAPW-ADR-CONTRACT-001, PTO-TLOAD-CUBE-001, PTO-TLOAD-MEMORY-001, PTO-TMOV-CONTRACT-001, PTO-TPREFETCH-FOOTPRINT-001, PTO-TSTORE-CUBE-001, PTO-TSTORE-MEMORY-001
    SHA-256
    215b18f05d0b53120949373fce6a5ce22f7ab534fb22df24743a9b2b4beb2dec
    Open exact decision source ↗ for ADR-0020

Unit metadata

Open 4 generated metadata fields
id
PTO-ARCH-MEMORY-MODEL-MEMORY-EVENTS
surface
arch
classification
[
  "memory-model",
  "memory-events"
]
depends_on
[
  "PTO-ARCH-MEMORY-MODEL-ADDRESS-SPACE"
]
Open generated traceability record
{
  "classification": [
    "memory-model",
    "memory-events"
  ],
  "documentation": "docs/arch/memory-model/memory-events.md",
  "id": "PTO-ARCH-MEMORY-MODEL-MEMORY-EVENTS",
  "mnemonic": null,
  "readiness_subjects": [
    "ADR-0006",
    "ADR-0020"
  ],
  "semantic_tests": [],
  "source": "asl/arch/memory-model/memory-events.asl",
  "surface": "arch",
  "tests": [
    "PTO-AVS-ARCH-MEMORY-MODEL-MEMORY-EVENTS-STATIC-001"
  ]
}

Sources and release identity

Show commit, paths, hashes, version, and canonical owners
Release
0.58.5 · Release candidate
Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812
ASL SHA-256
32b0cee879199679fb9f94e3b95a11e27c1a29d1e9677f45cdef83e2d43f895f
Generated documentation
docs/arch/memory-model/memory-events.md · embedded in this page
Documentation SHA-256
1f0a3b02c574d17e6ca97ced3ce8f02ad64610b4cf9360aab3b2611ed57587f2

Exact owners