跳到主要内容

PTO-ARCH-MEMORY-MODEL-MEMORY-EVENTS

PTO-ARCH-MEMORY-MODEL-MEMORY-EVENTS

ASL 伪代码

下面直接显示完整的 ASL 所有者。

// 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;

架构行为

目的与范围

用途与范围

本单元定义用于构造和检查 PTO 全存储排序候选执行的有界事件记录。它既支持显式构造事件,也支持从实际内存辅助函数进行可选捕获。

概念与架构状态

事件种类与字段

  • 读取和原子操作属于读;初始写入、存储以及执行写入的原子操作属于写。
  • 两个事件只有在地址和 size_bytes 都相同时才共享一个位置。
  • 数据事件类别使用 0001 表示读,0010 表示写,0011 表示原子操作;栅栏事件另行携带前驱与后继掩码。
规则与交互

捕获生命周期

  • StartMemoryEventCapture 重置序列、选择一个 MemoryAgentId 并启用捕获。
  • SelectMemoryEventAgent 修改后续包装函数使用的代理。
  • StopMemoryEventCapture 禁用自动记录,但不会删除已捕获序列。
  • AddMemoryEvent 追加一个事件并推进 _MemoryEventCount;专用辅助函数会在追加前规范化访问值。
边界与未定义范围

验证边界

事件数组边界与 PTO_MODEL_MEMORY_EVENTS 断言属于模型检查基础设施。它们不对真实执行中的代理数量或执行长度施加架构限制。尽管当前候选模型记录数据事件,指令与设备栅栏类别仍保留显式掩码空间。

使用示例

示例性捕获示例

本示例块只用于帮助阅读:先应用上文规则,再到规范 ASL 所有者中确认结果。它不会增加任何架构契约。

相关所有者

  • 地址空间辅助函数为产生事件的操作提供底层有界字节存储。
  • 原子性单元分配一致性与读自数据;排序单元评估完整候选执行。

NDF 条款

正文来自 owning ASL。拖拽或按钮只临时改变当前页面显示顺序。

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"
  ]
}

来源与发布信息

展开 commit、路径、hash、版本和规范所有者
发布
0.58.5 · 候选发布
Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812
ASL SHA-256
32b0cee879199679fb9f94e3b95a11e27c1a29d1e9677f45cdef83e2d43f895f
文档 SHA-256
49bfe2a3c774d09c537c3d2c591980e23467f4299b0563173fc08e5b6a778537

精确所有者