Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ not architecture authority; current meaning remains in the owning ASL/NDF.
- [ADR-NUM-0010](docs/status/decisions/ADR-NUM-0010-hardware-subnormal-policy.md): Hardware numeric subnormal policy
- [ADR-NUM-0011](docs/status/decisions/ADR-NUM-0011-hardware-special-value-checkpoint.md): Hardware special-value result checkpoint
- [ADR-SCALAR-0004](docs/status/decisions/ADR-SCALAR-0004-scalar-fsu-totality-and-profile-boundary.md): Scalar FSU totality and numeric-profile boundary
- [ADR-SCALAR-0007](docs/status/decisions/ADR-SCALAR-0007-sync-core-collective-phase-barrier.md): SYNC.CORE collective architectural phase barrier
- [ADR-STATE-0001](docs/status/decisions/ADR-STATE-0001-pto-owned-system-register-names.md): Use PTO-owned system-register names
- [ADR-STATE-0002](docs/status/decisions/ADR-STATE-0002-architectural-state-contract.md): Define the PTO architectural state contract
- [ADR-STATE-0003](docs/status/decisions/ADR-STATE-0003-scalar-tpc-and-execution-status.md): scalar TPC and execution status
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ it does not establish publication or release readiness.

| Surface | Current executable inventory |
| --- | ---: |
| Scalar instruction forms | 466 |
| Scalar instruction forms | 467 |
| Active bundle and command forms | 96 |
| Direct Tile operations | 119 |
| Architecture and instruction ASL units | 911 |
| Architecture and instruction ASL units | 919 |

<!-- PTO-INVENTORY-END -->

Expand Down
21 changes: 20 additions & 1 deletion asl/arch/data-types/memory-model.asl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ type MemoryFenceStrength of enumeration {
};

type MemoryAgentId of integer {0..PTO_MODEL_MEMORY_AGENTS-1};
type MemoryEventOrigin of enumeration {
MemoryEventOrigin_NonKernel,
MemoryEventOrigin_Kernel,
MemoryEventOrigin_Handler
};
type MemoryEventIndex of integer {0..PTO_MODEL_MEMORY_EVENTS-1};
type MemoryCoherenceRank of integer {0..PTO_MODEL_MEMORY_EVENTS-1};

Expand All @@ -42,8 +47,17 @@ type MemoryEventKind of enumeration {
};

type MemoryEvent of record {
active: boolean,
committed: boolean,
replay_epoch: integer,
kind: MemoryEventKind,
core_identity: PTOModelCoreIdentity,
agent: MemoryAgentId,
origin: MemoryEventOrigin,
invocation: integer,
program_order: integer,
collective_epoch: integer,
collective_history_sequence: integer,
address: Word,
size_bytes: integer {1,2,4,8},
read_value: Word,
Expand All @@ -63,5 +77,10 @@ type MemoryReplayState of record {
active: boolean,
request: Word,
committed_event_count: integer {0..PTO_MODEL_MEMORY_EVENTS},
epoch: integer
epoch: integer,
owner_core: PTOModelCoreIdentity,
owner_agent: MemoryAgentId,
owner_origin: MemoryEventOrigin,
owner_invocation: integer,
owner_program_order: integer
};
4 changes: 2 additions & 2 deletions asl/arch/data-types/trap-context.asl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ type TrapContext of record {
source_acr: AccessControlRing,
tpc: Word,
bpc: Word,
bundle_start_encoded_instruction: bits(64),
core_state: Word,
bundle_argument: Word,
commit_argument: Word,
Expand All @@ -30,12 +31,11 @@ type TrapContext of record {
bundle_data_attributes_present: boolean,
bundle_hint: BundleHintAttributes,
bundle_fixed_point_attributes: BundleFixedPointAttributes,
local_generations: LocalGenerationSnapshot,
shared_generations: SharedGenerationSnapshot,
bundle_execution_domain_token: integer,
memory_copy_template: MemoryCopyTemplateState,
frame_template: FrameTemplateState,
memory_replay_state: MemoryReplayState,
memory_origin: MemoryEventOrigin,
t_queue: TemporaryQueueSnapshot,
t_queue_valid: TemporaryQueueValiditySnapshot,
u_queue: TemporaryQueueSnapshot,
Expand Down
6 changes: 5 additions & 1 deletion asl/arch/dispatch/top-level.asl
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@

type PTOInstructionExecutionStatus of enumeration {
PTOInstruction_Executed,
PTOInstruction_Rejected
PTOInstruction_Rejected,
PTOInstruction_Blocked
};

func ExecutePTOInstruction(instruction: bits(64),
length_bits: integer {16,32,48,64})
=> PTOInstructionExecutionStatus
begin
_CurrentEncodedInstruction = instruction;
if DecodeCommandForm(instruction, length_bits) != PTO_COMMAND_FORM_COUNT then
let command_status = ExecuteCommandInstruction(instruction, length_bits);
if command_status == CommandExecution_Executed then
Expand All @@ -31,6 +33,8 @@ begin
instruction[47:0], length_bits as integer {16,32,48});
if scalar_status == ScalarExecution_Executed then
return PTOInstruction_Executed;
elsif scalar_status == ScalarExecution_Blocked then
return PTOInstruction_Blocked;
else
return PTOInstruction_Rejected;
end;
Expand Down
68 changes: 65 additions & 3 deletions asl/arch/memory-model/fault-precision.asl
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,87 @@
// elements, or a memory event already admitted before the fault. Recovery
// retries from the saved instruction/request template.
// NDF-END: PTO-ARCH-MEMORY-MODEL-FLUSH-001
// NDF-BEGIN: PTO-ARCH-MEMORY-MODEL-TRAP-RESTORE-001
// ndf: kind=contract level=L1 layer=memory status=accepted
// Trap return restores only the interrupted PE's precise instruction and
// Block restart carriers. It MUST NOT rewind shared GM/event history, Core
// synchronization, shared Tile generations, or another PE's cooperative local
// generation progress. An instruction owner performs any required scoped
// abort or squash before saving its restart point.
// NDF-END: PTO-ARCH-MEMORY-MODEL-TRAP-RESTORE-001

func BeginMemoryReplay(request: Word)
begin
_MemoryReplayState.active = TRUE;
_MemoryReplayState.request = request;
_MemoryReplayState.committed_event_count = _MemoryEventCount;
_MemoryReplayState.epoch = _MemoryReplayState.epoch + 1;
_MemoryReplayState.owner_core = _CurrentModelCore;
_MemoryReplayState.owner_agent = _CurrentMemoryAgent;
_MemoryReplayState.owner_origin = _CurrentMemoryOrigin;
_MemoryReplayState.owner_invocation = _CurrentKernelInvocation;
_MemoryReplayState.owner_program_order = _CurrentProgramOrder;
end;

func CommitMemoryReplayEffect()
begin
if _MemoryReplayState.active then
for event_number = 0 to _MemoryEventCount - 1 do
let event_index = event_number as MemoryEventIndex;
if _MemoryEvents[[event_index]].active &&
_MemoryEvents[[event_index]].replay_epoch ==
_MemoryReplayState.epoch &&
_MemoryEvents[[event_index]].core_identity ==
_MemoryReplayState.owner_core &&
_MemoryEvents[[event_index]].agent ==
_MemoryReplayState.owner_agent &&
_MemoryEvents[[event_index]].origin ==
_MemoryReplayState.owner_origin &&
_MemoryEvents[[event_index]].invocation ==
_MemoryReplayState.owner_invocation &&
_MemoryEvents[[event_index]].program_order ==
_MemoryReplayState.owner_program_order then
_MemoryEvents[[event_index]].committed = TRUE;
end;
end;
_MemoryReplayState.committed_event_count = _MemoryEventCount;
end;
end;

func FlushMemoryReplay()
begin
if _MemoryReplayState.active then
// Event records after the last committed effect are speculative and
// are removed. Architectural memory and Tile state are not undone.
_MemoryEventCount = _MemoryReplayState.committed_event_count;
// Event slots are stable because surviving events and saved contexts
// can refer to them through read_from. Deactivate only this owner's
// uncommitted records from this replay epoch; never rewind the shared
// event log or disturb another PE/Core's event references.
for event_number = 0 to _MemoryEventCount - 1 do
let event_index = event_number as MemoryEventIndex;
if _MemoryEvents[[event_index]].active &&
!_MemoryEvents[[event_index]].committed &&
_MemoryEvents[[event_index]].replay_epoch ==
_MemoryReplayState.epoch &&
_MemoryEvents[[event_index]].core_identity ==
_MemoryReplayState.owner_core &&
_MemoryEvents[[event_index]].agent ==
_MemoryReplayState.owner_agent &&
_MemoryEvents[[event_index]].origin ==
_MemoryReplayState.owner_origin &&
_MemoryEvents[[event_index]].invocation ==
_MemoryReplayState.owner_invocation &&
_MemoryEvents[[event_index]].program_order ==
_MemoryReplayState.owner_program_order then
_MemoryEvents[[event_index]].active = FALSE;
end;
end;
_MemoryReplayState.active = FALSE;
end;
end;

func CompleteMemoryReplay()
begin
if _MemoryReplayState.active then
CommitMemoryReplayEffect();
_MemoryReplayState.committed_event_count = _MemoryEventCount;
_MemoryReplayState.active = FALSE;
end;
Expand All @@ -62,6 +114,9 @@ begin
else TrapTargetForFault(source_ring);
if code != Fault_None then
SaveTrapContext(ring, source_ring);
// Subsequent event capture belongs to the handler until recovery
// restores the interrupted PE's saved provenance.
_CurrentMemoryOrigin = MemoryEventOrigin_Handler;
end;
_LastFault = code;
_FaultAddress = address;
Expand Down Expand Up @@ -125,6 +180,10 @@ begin
_ACRTrapCause[[target_ring]] = ZeroExtend{24}(request_type);
_ACRTrapNumber[[target_ring]] = Zeros{6} + 6;
_ACRTrapArgument0[[target_ring]] = source_tpc;
// SaveTrapContext records the origin to restore. Once entry succeeds,
// subsequent memory events are handler work and cannot participate in a
// kernel collective.
_CurrentMemoryOrigin = MemoryEventOrigin_Handler;
SetCurrentACR(target_ring);
WriteTPC(TrapVectorEntry(target_ring, source_tpc));
return TRUE;
Expand Down Expand Up @@ -157,6 +216,9 @@ begin
_ACRTrapNumber[[ring]] = Zeros{6} + 44;
_ACRTrapArgument0[[ring]] =
NaturalToWord(interrupt_id as integer {0..262144});
// SaveTrapContext preserves the interrupted origin. Establish handler
// provenance only after the enabled interrupt has actually entered.
_CurrentMemoryOrigin = MemoryEventOrigin_Handler;
SetCurrentACR(ring);
WriteTPC(TrapVectorEntry(ring, ReadTPC()));
end;
Expand Down
Loading
Loading