跳到主要内容
页面框架已切换为简体中文。尚未完成本地化的交互标签暂时使用英文;ASL/NDF 源、稳定标识和证据在所有语言中保持原文。

PTO-TILE-MODEL-MEMORY-GATHER-SCATTER

PTO-TILE-MODEL-MEMORY-GATHER-SCATTER

ASL 伪代码

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

// PTO-UNIT: {"id":"PTO-TILE-MODEL-MEMORY-GATHER-SCATTER","surface":"tile","classification":["model","memory","gather-scatter"],"depends_on":["PTO-TILE-MODEL-MEMORY-LOAD-STORE"]}func MGATHER(destination: TileIndex, base_address: Word, indices: TileIndex,             pad_value: TilePadValue)begin    let destination_tile = _Tiles[[destination]];    let index_tile = _Tiles[[indices]];    assert destination_tile.allocated;    assert index_tile.allocated && index_tile.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 translated_addresses: TilePayload;    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 address = TileMemoryByteDisplacementAddress(base_address,                index_payload[[index_element]], index_tile.data_type);            let probe = ProbeTileMemoryAccess(address,                destination_tile.data_type, FALSE);            if RaiseDataAccessFault(probe, address) then return; end;            translated_addresses[[destination_element]] =                probe.translated_address;        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;    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 element = TileLinearIndex(destination_tile,                row as integer {0..65535}, column as integer {0..65535});            let raw = LoadTranslatedUnsigned(translated_addresses[[element]],                TileMemoryElementBytes(destination_tile.data_type));            RecordLoadEvent(translated_addresses[[element]],                TileMemoryElementBytes(destination_tile.data_type), raw,                CurrentBundleMemoryOrder());            result_payload[[element]] = DecodeTileMemoryElementRaw(                raw, destination_tile.data_type, FALSE);        end;    end;    _Tiles[[destination]].payload = result_payload;    MarkTilePhysicalRegionDefined(destination);end;
func MGATHER(destination: TileIndex, base_address: Word, indices: TileIndex)begin    MGATHER(destination, base_address, indices, TilePad_Null);end;
func CommitScatterLanes(source_tile: TileInfo,                        source_payload: TilePayload,                        lane_order: ScatterLaneOrder,                        lane_count: integer {0..PTO_MODEL_TILE_ELEMENTS},                        original_addresses: TilePayload,                        translated_addresses: TilePayload,                        high_nibbles: bits(PTO_MODEL_TILE_ELEMENTS))begin    // Duplicate-address lanes have an implementation-defined winner.  B.CATR    // atomic makes the whole block non-interleavable, but does not select an    // internal lane order or a duplicate-address winner.    var commit_order = lane_order;    if lane_count > 0 then        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 then                    if ARBITRARY: boolean then                        selected_position = candidate_position as                            integer {0..PTO_MODEL_TILE_ELEMENTS-1};                        selected = TRUE;                    end;                end;            end;            let selected_element = commit_order[[selected_position]];            commit_order[[selected_position]] = commit_order[[position]];            commit_order[[position]] = selected_element;            let element = UInt(commit_order[[position]]) as                ModelTileElementIndex;            let stored_value = StoreTileMemoryElement(                original_addresses[[element]], translated_addresses[[element]],                source_tile.data_type, high_nibbles[element] == '1',                source_payload[[element]]);            RecordStoreEvent(translated_addresses[[element]],                TileMemoryElementBytes(source_tile.data_type), stored_value,                CurrentBundleMemoryOrder());        end;    end;end;
func MSCATTER(base_address: Word, source: TileIndex, indices: TileIndex)begin    let source_tile = _Tiles[[source]];    let index_tile = _Tiles[[indices]];    assert source_tile.allocated && source_tile.contents_defined;    assert index_tile.allocated && index_tile.contents_defined;    assert source_tile.valid_rows == index_tile.valid_rows;    assert source_tile.valid_columns == index_tile.valid_columns;    assert source_tile.layout == index_tile.layout;    assert IndexedTLSUIndexDataTypeLegal(index_tile.data_type);    assert IndexedTLSUTransferDataTypeLegal(source_tile.data_type);    let source_payload = source_tile.payload;    let index_payload = index_tile.payload;    var lane_order: ScatterLaneOrder;    var lane_count: integer {0..PTO_MODEL_TILE_ELEMENTS} = 0;    var original_addresses: TilePayload;    var translated_addresses: TilePayload;    var high_nibbles: bits(PTO_MODEL_TILE_ELEMENTS);    for row = 0 to source_tile.valid_rows - 1 looplimit 65536 do        for column = 0 to source_tile.valid_columns - 1 looplimit 65536 do            let source_element = TileLinearIndex(source_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 address = TileMemoryByteDisplacementAddress(base_address,                index_payload[[index_element]], index_tile.data_type);            let probe = ProbeTileMemoryAccess(address,                source_tile.data_type, TRUE);            if RaiseDataAccessFault(probe, address) then return; end;            original_addresses[[source_element]] = address;            translated_addresses[[source_element]] = probe.translated_address;            high_nibbles[source_element] = '0';            lane_order[[lane_count]] =                NaturalToWord(source_element as integer {0..262144});            lane_count = (lane_count + 1) as                integer {0..PTO_MODEL_TILE_ELEMENTS};        end;    end;    CommitScatterLanes(source_tile, source_payload, lane_order, lane_count,        original_addresses, translated_addresses, high_nibbles);end;
type CorePEPrefetchAddresses of array [[PTO_MODEL_MEMORY_AGENTS]] of TilePayload;
func TPREFETCHCore(base_addresses: CorePEWords,                   row_stride_elements: CorePEWords,                   valid_columns: integer {1..65535},                   valid_rows: integer {1..65535},                   columns: integer {1..65535},                   data_type: TileDataType)begin    assert valid_columns <= columns;    assert IsNonzeroPowerOfTwo(columns);    assert valid_rows * valid_columns <= PTO_MODEL_TILE_ELEMENTS;    var translated_addresses: CorePEPrefetchAddresses;    // TPREFETCH is one four-PE block attempt.  Probe every typed element of    // every PE before recording the first event so a fault cannot expose a    // partial request or event prefix from an earlier PE.    for pe = 0 to PTO_MODEL_MEMORY_AGENTS - 1 do        let agent = pe as MemoryAgentId;        for row = 0 to valid_rows - 1 looplimit 65536 do            for column = 0 to valid_columns - 1 looplimit 65536 do                let element = (row * valid_columns + column) as                    ModelTileElementIndex;                let memory_index = TileMemoryStridedIndex(                    row as integer {0..65535},                    column as integer {0..65535},                    row_stride_elements[[agent]]);                let address = TileMemoryIndexedAddress(                    base_addresses[[agent]], memory_index, data_type);                let probe = ProbeTileMemoryAccess(address, data_type, FALSE);                if RaiseDataAccessFault(probe, address) then return; end;                translated_addresses[[agent]][[element]] =                    probe.translated_address;            end;        end;    end;    for pe = 0 to PTO_MODEL_MEMORY_AGENTS - 1 do        let agent = pe as MemoryAgentId;        for row = 0 to valid_rows - 1 looplimit 65536 do            for column = 0 to valid_columns - 1 looplimit 65536 do                let element = (row * valid_columns + column) as                    ModelTileElementIndex;                let translated_address =                    translated_addresses[[agent]][[element]];                let value = LoadTranslatedUnsigned(translated_address,                    TileMemoryElementBytes(data_type));                RecordLoadEventForAgent(agent, translated_address,                    TileMemoryElementBytes(data_type), value,                    CurrentBundleMemoryOrder());            end;        end;    end;end;
// The generated direct-operation dispatcher carries one decoded base and// stride value.  Its wrapper applies those values to all four PEs; complete// architectural bundles use ExecuteBundleTPREFETCHOperation below to read the// same selectors independently from each PE-private GPR file.func TPREFETCHAllPEs(base_address: Word, row_stride_elements: Word,                     valid_columns: integer {1..65535},                     valid_rows: integer {1..65535},                     columns: integer {1..65535},                     data_type: TileDataType)begin    var base_addresses: CorePEWords;    var row_strides: CorePEWords;    for pe = 0 to PTO_MODEL_MEMORY_AGENTS - 1 do        let agent = pe as MemoryAgentId;        base_addresses[[agent]] = base_address;        row_strides[[agent]] = row_stride_elements;    end;    TPREFETCHCore(base_addresses, row_strides, valid_columns, valid_rows,        columns, data_type);end;
func TPREFETCH(base_address: Word, row_stride_elements: Word,               valid_columns: integer {1..65535},               valid_rows: integer {1..65535},               columns: integer {1..65535})begin    TPREFETCHAllPEs(base_address, row_stride_elements, valid_columns,        valid_rows, columns, TileDataTypeFromEncoding(            CurrentBundleTileOperationDataTypeCode()                as TileDataTypeEncoding));end;
func MGATHER_MASK(destination: TileIndex, base_address: Word, indices: TileIndex,                  mask: TileIndex, pad_value: TilePadValue)begin    let destination_tile = _Tiles[[destination]];    let index_tile = _Tiles[[indices]];    let mask_tile = _Tiles[[mask]];    assert destination_tile.allocated;    assert index_tile.allocated && index_tile.contents_defined;    assert mask_tile.allocated && mask_tile.contents_defined;    assert destination_tile.valid_rows == index_tile.valid_rows;    assert destination_tile.valid_columns == index_tile.valid_columns;    assert destination_tile.valid_rows == mask_tile.valid_rows;    assert destination_tile.valid_columns == mask_tile.valid_columns;    assert destination_tile.layout == index_tile.layout;    assert destination_tile.layout == mask_tile.layout;    assert IndexedTLSUIndexDataTypeLegal(index_tile.data_type);    assert IndexedTLSUTransferDataTypeLegal(destination_tile.data_type);    assert TilePredicateValuesLegal(mask);    let index_payload = index_tile.payload;    var translated_addresses: TilePayload;    var active_lanes: bits(PTO_MODEL_TILE_ELEMENTS) =        Zeros{PTO_MODEL_TILE_ELEMENTS};    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});            if ReadTilePredicateBit(                mask,                row as integer {0..65535},                column as integer {0..65535}) then                let address = TileMemoryByteDisplacementAddress(base_address,                    index_payload[[index_element]], index_tile.data_type);                let probe = ProbeTileMemoryAccess(address,                    destination_tile.data_type, FALSE);                if RaiseDataAccessFault(probe, address) then return; end;                translated_addresses[[destination_element]] =                    probe.translated_address;                active_lanes[destination_element] = '1';            end;        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;    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 element = TileLinearIndex(destination_tile,                row as integer {0..65535}, column as integer {0..65535});            if active_lanes[element] == '1' then                let raw = LoadTranslatedUnsigned(translated_addresses[[element]],                    TileMemoryElementBytes(destination_tile.data_type));                RecordLoadEvent(translated_addresses[[element]],                    TileMemoryElementBytes(destination_tile.data_type), raw,                    CurrentBundleMemoryOrder());                result_payload[[element]] = DecodeTileMemoryElementRaw(                    raw, destination_tile.data_type, FALSE);            end;        end;    end;    _Tiles[[destination]].payload = result_payload;    MarkTilePhysicalRegionDefined(destination);end;
func MSCATTER_MASK(base_address: Word, source: TileIndex, indices: TileIndex,                   mask: TileIndex)begin    let source_tile = _Tiles[[source]];    let index_tile = _Tiles[[indices]];    let mask_tile = _Tiles[[mask]];    assert source_tile.allocated && source_tile.contents_defined;    assert index_tile.allocated && index_tile.contents_defined;    assert mask_tile.allocated && mask_tile.contents_defined;    assert source_tile.valid_rows == index_tile.valid_rows;    assert source_tile.valid_columns == index_tile.valid_columns;    assert source_tile.valid_rows == mask_tile.valid_rows;    assert source_tile.valid_columns == mask_tile.valid_columns;    assert source_tile.layout == index_tile.layout;    assert source_tile.layout == mask_tile.layout;    assert IndexedTLSUIndexDataTypeLegal(index_tile.data_type);    assert IndexedTLSUTransferDataTypeLegal(source_tile.data_type);    assert TilePredicateValuesLegal(mask);    let source_payload = source_tile.payload;    let index_payload = index_tile.payload;    var lane_order: ScatterLaneOrder;    var lane_count: integer {0..PTO_MODEL_TILE_ELEMENTS} = 0;    var original_addresses: TilePayload;    var translated_addresses: TilePayload;    var high_nibbles: bits(PTO_MODEL_TILE_ELEMENTS);    for row = 0 to source_tile.valid_rows - 1 looplimit 65536 do        for column = 0 to source_tile.valid_columns - 1 looplimit 65536 do            let source_element = TileLinearIndex(source_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});            if ReadTilePredicateBit(                mask,                row as integer {0..65535},                column as integer {0..65535}) then                let address = TileMemoryByteDisplacementAddress(base_address,                    index_payload[[index_element]], index_tile.data_type);                let probe = ProbeTileMemoryAccess(address,                    source_tile.data_type, TRUE);                if RaiseDataAccessFault(probe, address) then return; end;                original_addresses[[source_element]] = address;                translated_addresses[[source_element]] =                    probe.translated_address;                high_nibbles[source_element] = '0';                lane_order[[lane_count]] =                    NaturalToWord(source_element as integer {0..262144});                lane_count = (lane_count + 1) as                    integer {0..PTO_MODEL_TILE_ELEMENTS};            end;        end;    end;    CommitScatterLanes(source_tile, source_payload, lane_order, lane_count,        original_addresses, translated_addresses, high_nibbles);end;

架构行为

该内部模型单元不在双语读者指南迁移范围内;请直接阅读本页的 ASL/NDF 所有者与验证证据。

NDF 条款

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

No NDF clause is attached to this unit.

Evidence index

6 matching entries

Executable evidence1
  • PTO-TILE-MODEL-MEMORY-GATHER-SCATTER compiles as an independent normative unit
    1. surfaceTILE
    2. ownerPTO-TILE-MODEL-MEMORY-GATHER-SCATTER
    3. categorySTATIC-INVARIANT
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-TILE-MODEL-MEMORY-GATHER-SCATTER-STATIC-001
    Path
    tests/asl/tile/model/memory/gather-scatter/tile-static-gather-scatter-contract-001.asl
    Kind / role
    static-invariant
    Pass condition
    the complete model and this unit's static invariant compile
    SHA-256
    d6cab96d0eebc246fb74ecdff0f75f334333306b431e54d11980faba4d944d02
    Open exact source ↗ for PTO-AVS-TILE-MODEL-MEMORY-GATHER-SCATTER-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

Unit metadata

Open 4 generated metadata fields
id
PTO-TILE-MODEL-MEMORY-GATHER-SCATTER
surface
tile
classification
[
  "model",
  "memory",
  "gather-scatter"
]
depends_on
[
  "PTO-TILE-MODEL-MEMORY-LOAD-STORE"
]
Open generated traceability record
{
  "classification": [
    "model",
    "memory",
    "gather-scatter"
  ],
  "documentation": "docs/tile/model/memory/gather-scatter.md",
  "id": "PTO-TILE-MODEL-MEMORY-GATHER-SCATTER",
  "mnemonic": null,
  "readiness_subjects": [],
  "semantic_tests": [],
  "source": "asl/tile/model/memory/gather-scatter.asl",
  "surface": "tile",
  "tests": [
    "PTO-AVS-TILE-MODEL-MEMORY-GATHER-SCATTER-STATIC-001"
  ]
}

来源与发布信息

展开 commit、路径、hash、版本和规范所有者
发布
0.58.5 · 候选发布
Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812
ASL SHA-256
380643b5cf30271df799fe19de34681f77735147d6a6e6ed31e8dad1f1de62e0
生成文档
docs/tile/model/memory/gather-scatter.md · 已融合到当前页面
文档 SHA-256
ec44bb4410cd42f1ac7bc1ed91f3e5dd77b7d21ebb4d99b2b50361d70d92b7a4

精确所有者