PTO-TILE-MODEL-MEMORY-ATOMICS
PTO-TILE-MODEL-MEMORY-ATOMICSASL pseudocode
The complete ASL owner is shown directly below.
// PTO-UNIT: {"id":"PTO-TILE-MODEL-MEMORY-ATOMICS","surface":"tile","classification":["model","memory","atomics"],"depends_on":["PTO-TILE-MODEL-MEMORY-GATHER-SCATTER","PTO-ARCH-MEMORY-MODEL-ATOMICITY"]}func MGATHER_CAS(destination: TileIndex, base_address: Word, indices: TileIndex, expected: TileIndex, replacement: TileIndex, pad_value: TilePadValue)begin let destination_tile = _Tiles[[destination]]; let index_tile = _Tiles[[indices]]; let expected_payload = _Tiles[[expected]].payload; let replacement_payload = _Tiles[[replacement]].payload; assert destination_tile.allocated; assert index_tile.allocated && index_tile.contents_defined; assert _Tiles[[expected]].allocated && _Tiles[[expected]].contents_defined; assert _Tiles[[replacement]].allocated && _Tiles[[replacement]].contents_defined; assert destination_tile.valid_rows == index_tile.valid_rows; assert destination_tile.valid_columns == index_tile.valid_columns; assert IndexedTLSUIndexDataTypeLegal(index_tile.data_type); assert IndexedTLSUTransferDataTypeLegal(destination_tile.data_type); let index_payload = index_tile.payload; var original_addresses: TilePayload; var translated_addresses: TilePayload; var write_translated_addresses: TilePayload; var expected_values: TilePayload; var replacement_values: TilePayload; var lane_order: ScatterLaneOrder; var lane_count: integer {0..PTO_MODEL_TILE_ELEMENTS} = 0; var result_payload = destination_tile.payload; for row = 0 to destination_tile.valid_rows - 1 looplimit 65536 do for column = 0 to destination_tile.valid_columns - 1 looplimit 65536 do let destination_element = TileLinearIndex(destination_tile, row as integer {0..65535}, column as integer {0..65535}); let index_element = TileLinearIndex(index_tile, row as integer {0..65535}, column as integer {0..65535}); let expected_element = TileLinearIndex(_Tiles[[expected]], row as integer {0..65535}, column as integer {0..65535}); let replacement_element = TileLinearIndex(_Tiles[[replacement]], row as integer {0..65535}, column as integer {0..65535}); let address = TileMemoryByteDisplacementAddress(base_address, index_payload[[index_element]], index_tile.data_type); let read_probe = ProbeTileMemoryAccess(address, destination_tile.data_type, FALSE); if RaiseDataAccessFault(read_probe, address) then return; end; let write_probe = ProbeTileMemoryAccess(address, destination_tile.data_type, TRUE); if RaiseDataAccessFault(write_probe, address) then return; end; if read_probe.translated_address != write_probe.translated_address then SetFault(Fault_DataPage, address); return; end; original_addresses[[destination_element]] = address; translated_addresses[[destination_element]] = read_probe.translated_address; write_translated_addresses[[destination_element]] = write_probe.translated_address; expected_values[[destination_element]] = expected_payload[[expected_element]]; replacement_values[[destination_element]] = replacement_payload[[replacement_element]]; lane_order[[lane_count]] = NaturalToWord(destination_element); lane_count = (lane_count + 1) as integer {0..PTO_MODEL_TILE_ELEMENTS}; end; end; for row = 0 to destination_tile.rows - 1 looplimit 65536 do for column = 0 to destination_tile.columns - 1 looplimit 65536 do let element = TileLinearIndex(destination_tile, row as integer {0..65535}, column as integer {0..65535}); result_payload[[element]] = TilePadValueForDataType( pad_value, destination_tile.data_type); end; end; // Duplicate addresses are serialized in an implementation-defined order. // Each selected lane remains one atomic read-modify-write, but neither // row-major order nor another fixed order becomes architectural. for position = 0 to lane_count - 1 looplimit PTO_MODEL_TILE_ELEMENTS do var selected_position: integer {0..PTO_MODEL_TILE_ELEMENTS-1} = position as integer {0..PTO_MODEL_TILE_ELEMENTS-1}; var selected = FALSE; for candidate_position = position to lane_count - 1 looplimit PTO_MODEL_TILE_ELEMENTS do if !selected && ARBITRARY: boolean then selected_position = candidate_position as integer {0..PTO_MODEL_TILE_ELEMENTS-1}; selected = TRUE; end; end; let selected_element = lane_order[[selected_position]]; lane_order[[selected_position]] = lane_order[[position]]; lane_order[[position]] = selected_element; let element = UInt(lane_order[[position]]) as ModelTileElementIndex; let old_raw = LoadTranslatedUnsigned( translated_addresses[[element]], TileMemoryElementBytes(destination_tile.data_type)); let old_value = DecodeTileMemoryElementRaw( old_raw, destination_tile.data_type, FALSE); result_payload[[element]] = old_value; let succeeds = NormalizeMemoryAccessValue(old_value, TileMemoryElementBytes(destination_tile.data_type)) == NormalizeMemoryAccessValue(expected_values[[element]], TileMemoryElementBytes(destination_tile.data_type)); let write_value = NormalizeMemoryAccessValue( replacement_values[[element]], TileMemoryElementBytes(destination_tile.data_type)); if succeeds then - = StoreTileMemoryElement(original_addresses[[element]], write_translated_addresses[[element]], destination_tile.data_type, FALSE, replacement_values[[element]]); end; RecordAtomicEvent(write_translated_addresses[[element]], TileMemoryElementBytes(destination_tile.data_type), old_raw, write_value, CurrentBundleMemoryOrder(), succeeds); end; _Tiles[[destination]].payload = result_payload; MarkTilePhysicalRegionDefined(destination);end;
func MGATHER_CAS(destination: TileIndex, base_address: Word, indices: TileIndex, expected: TileIndex, replacement: TileIndex)begin MGATHER_CAS(destination, base_address, indices, expected, replacement, TilePad_Null);end;
Architecture behavior
This internal model unit is documented through its normative ASL/NDF owners and validation evidence; it has no reader-guide migration target.
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
7 matching entries
Executable evidence2
PTO-TILE-MODEL-MEMORY-ATOMICS compiles as an independent normative unit
- surfaceTILE
- ownerPTO-TILE-MODEL-MEMORY-ATOMICS
- categorySTATIC-INVARIANT
- case001
Show exact test source
Sources and references
- Complete stable ID
PTO-AVS-TILE-MODEL-MEMORY-ATOMICS-STATIC-001- Path
tests/asl/tile/model/memory/atomics/tile-static-atomics-contract-001.asl- Kind / role
- static-invariant
- Pass condition
- the complete model and this unit's static invariant compile
- SHA-256
e3f0b897d64c12bf23e613b3ab3e3dc15ea37cc37801a86af953ecb2fe9f0995
Commit-scoped evidence5
spec/evidence/release-traceability-readiness.json · closed
PTO-EVIDENCE-RELEASE-TRACEABILITYSources 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
spec/evidence/instruction-contract-closure.json · closed
PTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURESources 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
spec/evidence/architecture-readiness.json · open
PTO-EVIDENCE-ARCHITECTURE-READINESSSources and references
- Complete stable ID
PTO-EVIDENCE-ARCHITECTURE-READINESS- Path
spec/evidence/architecture-readiness.json- Kind / role
- architecture maturity and blockers
- SHA-256
4b0b85199101251bea744e0f3591cc31906909dc80d5ab651c417a936036a004
spec/evidence/release-gate-readiness.json · ready-for-exact-head-verification
PTO-EVIDENCE-RELEASE-GATE-READINESSSources 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
spec/release-manifest.json · draft
PTO-EVIDENCE-RELEASE-MANIFESTSources and references
- Complete stable ID
PTO-EVIDENCE-RELEASE-MANIFEST- Path
spec/release-manifest.json- Kind / role
- release content and encoding fingerprints
- SHA-256
1a64c109ed7a90351c41e2a418b3c0ebaf8ad975838986d2101385186b85c0d8
Unit metadata
Open 4 generated metadata fields
Open generated traceability record
{
"classification": [
"model",
"memory",
"atomics"
],
"documentation": "docs/tile/model/memory/atomics.md",
"id": "PTO-TILE-MODEL-MEMORY-ATOMICS",
"mnemonic": null,
"readiness_subjects": [],
"semantic_tests": [
"PTO-AVS-TILE-TESTSHAREDREGISTERATOMICUPDATES-ATOMICITY-001"
],
"source": "asl/tile/model/memory/atomics.asl",
"surface": "tile",
"tests": [
"PTO-AVS-TILE-MODEL-MEMORY-ATOMICS-STATIC-001",
"PTO-AVS-TILE-TESTSHAREDREGISTERATOMICUPDATES-ATOMICITY-001"
]
}Sources and release identity
Show commit, paths, hashes, version, and canonical owners
- Release
0.58.5· Release candidate- Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812- Original ASL
- asl/tile/model/memory/atomics.asl
- ASL SHA-256
3fe85107f4745fdfbd1513f2485e316778e6ac053f01867f8ee9f6654c4fdeab- Generated documentation
- docs/tile/model/memory/atomics.md · embedded in this page
- Documentation SHA-256
93f80620303b6edf40644769191a1eeedd8f1ea03ef25f4dffa84cc74bce85e0
Exact owners
- ASL PTO-TILE-MODEL-MEMORY-ATOMICS
asl/tile/model/memory/atomics.asl