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.
PTO-ARCH-MEMORY-MODEL-MEMORY-EVENTSThe 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;
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.
size_bytes match.0001 for reads, 0010 for writes, and 0011 for atomics; fence events carry separate predecessor and successor masks.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.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.
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.
Bodies come from owning ASL. Dragging or buttons change only this page-session view order.
No NDF clause is attached to this unit.
8 matching entries
PTO-AVS-ARCH-MEMORY-MODEL-MEMORY-EVENTS-STATIC-001tests/asl/arch/memory-model/memory-events/arch-static-memory-events-contract-001.asl8ee092e2d47ed671d8ef54d6a70ffac9676f058c85fe86b11f0b2ce46a89996dPTO-EVIDENCE-RELEASE-TRACEABILITYPTO-EVIDENCE-RELEASE-TRACEABILITYspec/evidence/release-traceability-readiness.jsonc7327021d39dc67ac5564bc55073b3870a397d79ac8d9648284d56e33bc14a3ePTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSUREPTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSUREspec/evidence/instruction-contract-closure.json3ef2bb62421c79dff8fa77a1c7983923b523244b8090812883ef81286ca8106aPTO-EVIDENCE-ARCHITECTURE-READINESSPTO-EVIDENCE-ARCHITECTURE-READINESSspec/evidence/architecture-readiness.json4b0b85199101251bea744e0f3591cc31906909dc80d5ab651c417a936036a004PTO-EVIDENCE-RELEASE-GATE-READINESSPTO-EVIDENCE-RELEASE-GATE-READINESSspec/evidence/release-gate-readiness.jsona0f4d2b6920c08981ea55fd8ef820708a40d4feb5402c5150e8e9ab532d84ce0PTO-EVIDENCE-RELEASE-MANIFESTPTO-EVIDENCE-RELEASE-MANIFESTspec/release-manifest.json1a64c109ed7a90351c41e2a418b3c0ebaf8ad975838986d2101385186b85c0d8Loading ADR-0006…
ADR-0006docs/status/decisions/0006-pto-total-store-order.mdb80d8782e4587d4023edf02df9d2ba4d3cb2b2999fdc8991e49a2af4f9817735Loading ADR-0020…
ADR-0020docs/status/decisions/0020-production-memory-events-and-atomic-corners.md215b18f05d0b53120949373fce6a5ce22f7ab534fb22df24743a9b2b4beb2dec{
"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"
]
}0.58.5 · Release candidate7dc8b7e5b121d2b2499a2273bebff29e2cd8681232b0cee879199679fb9f94e3b95a11e27c1a29d1e9677f45cdef83e2d43f895f1f0a3b02c574d17e6ca97ced3ce8f02ad64610b4cf9360aab3b2611ed57587f2asl/arch/memory-model/memory-events.asl