页面框架已切换为简体中文。尚未完成本地化的交互标签暂时使用英文;ASL/NDF 源、稳定标识和证据在所有语言中保持原文。
PTO-SCALAR-MODEL-AGU-MEMORY
PTO-SCALAR-MODEL-AGU-MEMORYASL 伪代码
下面直接显示完整的 ASL 所有者。
// PTO-UNIT: {"id":"PTO-SCALAR-MODEL-AGU-MEMORY","surface":"scalar","classification":["model","agu","memory"],"depends_on":["PTO-SCALAR-MODEL-BRU-SEMANTICS","PTO-ARCH-MEMORY-MODEL-ORDERING"]}// PTO-REQ-MEMORY-001, PTO-REQ-MEMORY-COMPLETION-001,// PTO-REQ-MEMORY-TSO-001: profile-backed, little-endian memory with precise// instruction-wide completion and PTO-TSO event extraction.
readonly func RangesOverlap(left_address: Word, left_size: integer, right_address: Word, right_size: integer) => booleanbegin let left_start = UInt(left_address); let right_start = UInt(right_address); return left_start < right_start + right_size && right_start < left_start + left_size;end;
readonly func ReservationGranuleAddress() => Wordbegin return _ReservationAddress - NaturalToWord( (UInt(_ReservationAddress) MOD PTO_RESERVATION_GRANULE_BYTES) as integer {0..262144});end;
readonly impdef func TranslateDataAddress(address: Word, size_bytes: integer {1..262144}, write: boolean) => Wordbegin // The portable model uses identity translation. return address;end;
readonly impdef func DataAccessPermitted(address: Word, size_bytes: integer {1..262144}, write: boolean) => booleanbegin // The portable model exposes one bounded, readable, writable address space. return UInt(address) + size_bytes <= PTO_MODEL_MEMORY_BYTES;end;
func ProbeDataAccess(address: Word, size_bytes: integer {1..262144}, alignment_bytes: integer {1,2,4,8}, write: boolean) => DataAccessProbebegin if UInt(address) MOD alignment_bytes != 0 then return DataAccessProbe { fault = Fault_DataAlignment, translated_address = address }; end; let translated_address = TranslateDataAddress(address, size_bytes, write); if !DataAccessPermitted(translated_address, size_bytes, write) || UInt(translated_address) + size_bytes > PTO_MODEL_MEMORY_BYTES then return DataAccessProbe { fault = Fault_DataPage, translated_address = translated_address }; end; return DataAccessProbe { fault = Fault_None, translated_address = translated_address };end;
func RaiseDataAccessFault(probe: DataAccessProbe, address: Word) => booleanbegin if probe.fault == Fault_None then return FALSE; end; SetFault(probe.fault, address); return TRUE;end;
readonly func LoadTranslatedUnsigned(translated_address: Word, size_bytes: integer {1,2,4,8}) => Wordbegin var result: Word = Zeros{PTO_XLEN}; for byte_index = 0 to size_bytes - 1 do let byte_address = translated_address + NaturalToWord(byte_index as integer {0..262144}); result[(byte_index * 8) +: 8] = ReadMemoryByte(byte_address); end; return result;end;
readonly func LoadTranslatedBytes64(translated_address: Word) => array [[64]] of Bytebegin var result: array [[64]] of Byte; for byte_index = 0 to 63 do let byte_address = translated_address + NaturalToWord(byte_index as integer {0..262144}); result[[byte_index]] = ReadMemoryByte(byte_address); end; return result;end;
pure func Bytes64ChunkValue(value: array [[64]] of Byte, chunk: integer {0..7}) => Wordbegin var result: Word = Zeros{PTO_XLEN}; for byte_index = 0 to 7 do let snapshot_index = (chunk * 8 + byte_index) as integer {0..63}; result[(byte_index * 8) +: 8] = value[[snapshot_index]]; end; return result;end;
readonly func LoadTranslatedBytesBounded(translated_address: Word, byte_count: integer {0..63}) => array [[64]] of Bytebegin var result: array [[64]] of Byte; for byte_index = 0 to 63 do if byte_index < byte_count then let byte_address = translated_address + NaturalToWord(byte_index as integer {0..262144}); result[[byte_index]] = ReadMemoryByte(byte_address); else result[[byte_index]] = Zeros{8}; end; end; return result;end;
pure func NormalizeLoadedValue(value: Word, size_bytes: integer {1,2,4,8}, signed_load: boolean) => Wordbegin if !signed_load then return value; end; case size_bytes of when 1 => return SignExtend{PTO_XLEN}(value[7:0]); when 2 => return SignExtend{PTO_XLEN}(value[15:0]); when 4 => return SignExtend{PTO_XLEN}(value[31:0]); when 8 => return value; end;end;
pure func NormalizeMemoryAccessValue(value: Word, size_bytes: integer {1,2,4,8}) => Wordbegin case size_bytes of when 1 => return ZeroExtend{PTO_XLEN}(value[7:0]); when 2 => return ZeroExtend{PTO_XLEN}(value[15:0]); when 4 => return ZeroExtend{PTO_XLEN}(value[31:0]); when 8 => return value; end;end;
func StoreTranslatedBytes64(original_address: Word, translated_address: Word, value: array [[64]] of Byte)begin for byte_index = 0 to 63 do let byte_address = translated_address + NaturalToWord(byte_index as integer {0..262144}); WriteMemoryByte(byte_address, value[[byte_index]]); end; if _ReservationValid && RangesOverlap(original_address, 64, ReservationGranuleAddress(), PTO_RESERVATION_GRANULE_BYTES) then _ReservationValid = FALSE; end;end;
func StoreTranslatedBytesBounded(original_address: Word, translated_address: Word, byte_count: integer {0..63}, value: array [[64]] of Byte)begin for byte_index = 0 to 63 do if byte_index < byte_count then let byte_address = translated_address + NaturalToWord(byte_index as integer {0..262144}); WriteMemoryByte(byte_address, value[[byte_index]]); end; end; if _ReservationValid && RangesOverlap(original_address, byte_count, ReservationGranuleAddress(), PTO_RESERVATION_GRANULE_BYTES) then _ReservationValid = FALSE; end;end;
func StoreTranslatedFillBounded(original_address: Word, translated_address: Word, byte_count: integer {0..63}, value: Byte)begin for byte_index = 0 to 63 do if byte_index < byte_count then let byte_address = translated_address + NaturalToWord(byte_index as integer {0..262144}); WriteMemoryByte(byte_address, value); end; end; if _ReservationValid && RangesOverlap(original_address, byte_count, ReservationGranuleAddress(), PTO_RESERVATION_GRANULE_BYTES) then _ReservationValid = FALSE; end;end;
func StoreTranslated(original_address: Word, translated_address: Word, size_bytes: integer {1,2,4,8}, value: Word)begin for byte_index = 0 to size_bytes - 1 do let byte_address = translated_address + NaturalToWord(byte_index as integer {0..262144}); WriteMemoryByte(byte_address, value[(byte_index * 8) +: 8]); end; if _ReservationValid && RangesOverlap(original_address, size_bytes, ReservationGranuleAddress(), PTO_RESERVATION_GRANULE_BYTES) then _ReservationValid = FALSE; end;end;
func LoadWithOrder(address: Word, size_bytes: integer {1,2,4,8}, order: MemoryOrder) => Wordbegin let probe = ProbeDataAccess(address, size_bytes, size_bytes, FALSE); if RaiseDataAccessFault(probe, address) then return Zeros{PTO_XLEN}; end; let value = LoadTranslatedUnsigned(probe.translated_address, size_bytes); RecordLoadEvent(probe.translated_address, size_bytes, value, order); return value;end;
func LoadUnsigned(address: Word, size_bytes: integer {1,2,4,8}) => Wordbegin return LoadWithOrder(address, size_bytes, MemoryOrder_Relaxed);end;
func LoadSigned(address: Word, size_bytes: integer {1,2,4,8}) => Wordbegin let value = LoadUnsigned(address, size_bytes); return NormalizeLoadedValue(value, size_bytes, TRUE);end;
func StoreWithOrder(address: Word, size_bytes: integer {1,2,4,8}, value: Word, order: MemoryOrder)begin let probe = ProbeDataAccess(address, size_bytes, size_bytes, TRUE); if RaiseDataAccessFault(probe, address) then return; end; StoreTranslated(address, probe.translated_address, size_bytes, value); RecordStoreEvent(probe.translated_address, size_bytes, value, order);end;
func Store(address: Word, size_bytes: integer {1,2,4,8}, value: Word)begin StoreWithOrder(address, size_bytes, value, MemoryOrder_Relaxed);end;
架构行为
该内部模型单元不在双语读者指南迁移范围内;请直接阅读本页的 ASL/NDF 所有者与验证证据。
NDF 条款
正文来自 owning ASL。拖拽或按钮只临时改变当前页面显示顺序。
No NDF clause is attached to this unit.
Evidence index
8 matching entries
Executable evidence3
PTO-SCALAR-MODEL-AGU-MEMORY compiles as an independent normative unit
- surfaceSCALAR
- ownerPTO-SCALAR-MODEL-AGU-MEMORY
- categorySTATIC-INVARIANT
- case001
Show exact test source
Sources and references
- Complete stable ID
PTO-AVS-SCALAR-MODEL-AGU-MEMORY-STATIC-001- Path
tests/asl/scalar/model/agu/memory/scalar-static-memory-contract-001.asl- Kind / role
- static-invariant
- Pass condition
- the complete model and this unit's static invariant compile
- SHA-256
a344a3eee4c2e9e8b7d94d799def75411bd223f3ed741cf2c90ee1e53d421d26
Covers Scalar Memory.
- surfaceSCALAR
- ownerPTO-SCALAR-MODEL-AGU-MEMORY
- categoryEXECUTION
- case001
Show exact test source
Sources and references
- Complete stable ID
PTO-AVS-SCALAR-TESTSCALARMEMORY-EXECUTION-001- Path
tests/asl/scalar/model/agu/memory/scalar-exec-memory-effects-001.asl- Kind / role
- execution
- Pass condition
- TestScalarMemory completes without assertion failure
- SHA-256
e8092a4fcc7267269aa95bbf908894050070343813c2a5260ce52fde46aeaf09
Covers Scalar Pair Memory Completion.
- surfaceSCALAR
- ownerPTO-SCALAR-MODEL-AGU-MEMORY
- categoryEXECUTION
- case001
Show exact test source
Sources and references
- Complete stable ID
PTO-AVS-SCALAR-TESTSCALARPAIRMEMORYCOMPLETION-EXECUTION-001- Path
tests/asl/scalar/model/agu/memory/scalar-exec-pair-completion-001.asl- Kind / role
- execution
- Pass condition
- TestScalarPairMemoryCompletion completes without assertion failure
- SHA-256
e998f84da89580079f56d07ee9bda7620c1bfc9bcf3d00317a6974f5fc066196
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",
"agu",
"memory"
],
"documentation": "docs/scalar/model/agu/memory.md",
"id": "PTO-SCALAR-MODEL-AGU-MEMORY",
"mnemonic": null,
"readiness_subjects": [],
"semantic_tests": [
"PTO-AVS-SCALAR-TESTSCALARMEMORY-EXECUTION-001",
"PTO-AVS-SCALAR-TESTSCALARPAIRMEMORYCOMPLETION-EXECUTION-001"
],
"source": "asl/scalar/model/agu/memory.asl",
"surface": "scalar",
"tests": [
"PTO-AVS-SCALAR-MODEL-AGU-MEMORY-STATIC-001",
"PTO-AVS-SCALAR-TESTSCALARMEMORY-EXECUTION-001",
"PTO-AVS-SCALAR-TESTSCALARPAIRMEMORYCOMPLETION-EXECUTION-001"
]
}来源与发布信息
展开 commit、路径、hash、版本和规范所有者
- 发布
0.58.5· 候选发布- Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812- ASL SHA-256
3e11650bdd6950bf78085be8b1de9735f65310d69b1edfb54d92e59baffee643- 生成文档
- docs/scalar/model/agu/memory.md · 已融合到当前页面
- 文档 SHA-256
49ba74af963b146d5edc0fae4778e78db738c54f85c65409635fb14b04ae803f
精确所有者
- ASL PTO-SCALAR-MODEL-AGU-MEMORY
asl/scalar/model/agu/memory.asl