操作数与参数
DstBegin- first register in the inclusive R2..R23 ring range
DstEnd- last register in the inclusive R2..R23 ring range
uimm- frame byte count, encoded in multiples of eight
Restores a restartable stack frame whose first stack slot supplies the validated return target.
PTO-BLOCK-FRET-STKFRET.STK [ra ~ RegDstn], sp!, uimm| 字段 | 位宽 | 有符号性 | 架构角色 | 编码零 |
|---|---|---|---|---|
DstBegin | 5 | encoding-defined | first register in the inclusive R2..R23 ring range | Encoded zero is outside the callee-save ring and is reserved. |
DstEnd | 5 | encoding-defined | last register in the inclusive R2..R23 ring range | Encoded zero is outside the callee-save ring and is reserved. |
uimm | 15 | unsigned | frame byte count, encoded in multiples of eight | Encoded zero is a real zero-byte frame size and is illegal for every nonempty range. |
Loading WaveDrom diagram… The encoding table and WaveJSON remain available below.
| Decoded item | Bit range | Value |
|---|---|---|
| uimm | 31:25 | variable |
| DstEnd | 24:20 | variable |
| DstBegin | 19:15 | variable |
| Constant | 14:12 | 3'b011 |
| uimm | 11:7 | variable |
| Constant | 6:0 | 7'b1000001 |
{
"reg": [
{
"bits": 7,
"name": "7'b1000001"
},
{
"bits": 5,
"name": "uimm"
},
{
"bits": 3,
"name": "3'b011"
},
{
"bits": 5,
"name": "DstBegin"
},
{
"bits": 5,
"name": "DstEnd"
},
{
"bits": 7,
"name": "uimm"
}
],
"config": {
"bits": 32,
"fontsize": 13,
"hspace": 900,
"lanes": 1,
"offset": 0
}
}FRET.STK [ra ~ RegDstn], sp!, uimm
DstBeginDstEnduimmDecode 与 Operation 均直接来自指令所有者,并按执行阶段分开显示。
readonly func InstructionContractMatches_FRET_STK(operation: CommandOperation) => booleanbegin return (operation == CommandOperation_fret_stk_32_4fe246bd8241);end;readonly func InstructionContractHandler_FRET_STK() => CommandSemanticHandlerbegin return CommandHandler_ExecuteFrameReturnStack;end;
func ExecuteFRETSTK(begin_reg: Reg5Selector, end_reg: Reg5Selector, frame_size: Word)begin ReturnFromFrame(begin_reg, end_reg, frame_size, FALSE);end;
pure func InstructionContractUsesInclusiveRegisterRange_FRET_STK() => booleanbegin return TRUE;end;
pure func InstructionContractRejectsInvalidFrameRange_FRET_STK() => booleanbegin return TRUE;end;// PTO-INSTRUCTION: {"assembly":["FRET.STK [ra ~ RegDstn], sp!, uimm"],"block":[],"catalog_indices":[65],"catalog_records":[{"asm":"FRET.STK [ra ~ RegDstn], sp!, uimm","constraints":[{"field":"DstBegin","operator":"one-of","values":[10]},{"field":"DstEnd","operator":"one-of","values":[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]}],"encoding":[{"index":0,"mask":"0x0000707f","match":"0x00003041","width_bits":32}],"encoding_kind":"L32","fields":[{"name":"DstBegin","pieces":[{"instruction_lsb":15,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5},{"name":"DstEnd","pieces":[{"instruction_lsb":20,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5},{"name":"uimm","pieces":[{"instruction_lsb":25,"value_lsb":3,"width":7},{"instruction_lsb":7,"value_lsb":10,"width":5}],"signedness":"unsigned","width":15}],"form_id":"fret_stk_32_4fe246bd8241","length_bits":32,"mnemonic":"FRET.STK","semantic_family":"CMD","semantic_group":"Bundle Split","semantic_handler":"ExecuteFrameReturnStack","semantic_summary":"Restores a restartable stack frame whose first stack slot supplies the validated return target.","status":"accepted"}],"classification":["lifecycle"],"contract":{"block_composition":["none"],"canonical_assembly":["FRET.STK [ra ~ RegDstn], sp!, uimm"],"defaults":["The inclusive register range is the ring R2..R23. Singleton, full-ring, and wraparound ranges are assigned.","uimm is always present and represents a byte count in multiples of eight; encoded zero is real zero and is illegal because every assigned range contains at least one register.","The range must begin at architectural ra (R10); stack slot zero supplies both restored ra and the return target."],"encoding_class":"standalone-encoded","examples":["FRET.STK [ra ~ RegDstn], sp!, uimm"],"exceptions":["Reserved endpoints or an insufficient frame size raise Fault_IllegalInstruction before sp, register, memory, target, progress, or TPC effects.","Each eight-byte stack access is a restart boundary. A recoverable access fault preserves earlier committed events and retries exactly the first uncommitted event from trap-preserved template state.","An odd slot-zero value raises Fault_InstructionPC before ra, target, slot-zero progress, or later-register effects; an earlier committed sp adjustment remains restart-visible."],"field_contracts":{},"field_zero_meanings":{"DstBegin":"Encoded zero is outside the callee-save ring and is reserved.","DstEnd":"Encoded zero is outside the callee-save ring and is reserved.","uimm":"Encoded zero is a real zero-byte frame size and is illegal for every nonempty range."},"legality":["DstBegin and DstEnd select the inclusive R2..R23 callee-save ring; every endpoint outside 2..23 is reserved before effects.","If the range contains N registers, uimm must be at least 8*N bytes. The encoding supplies only multiples of eight.","DstBegin must encode R10 exactly; other otherwise legal ring endpoints are reserved for FRET.STK."],"memory_effects":["Load one aligned eight-byte value per selected destination; slot zero is the return-target load and remains an exact restart boundary."],"operands":[{"field":"DstBegin","role":"first register in the inclusive R2..R23 ring range"},{"field":"DstEnd","role":"last register in the inclusive R2..R23 ring range"},{"field":"uimm","role":"frame byte count, encoded in multiples of eight"}],"ordering":["Add uimm to sp, load and validate slot zero before restoring ra, then restore the remaining selected registers in ring order.","After the final restore, publish the validated slot-zero target to TPC; the command does not perform a sequential TPC increment."],"standalone_opcode":true,"state_effects":["Slot zero updates both architectural ra and the retained return-address state; subsequent slots restore the rest of the inclusive range.","Completion decrements nonzero frame depth, publishes the last-frame tuple, clears progress, and transfers to the validated target."]},"depends_on":["PTO-BLOCK-MODEL-SCHEMA-PROFILE-ENCODING"],"id":"PTO-BLOCK-FRET-STK","mnemonic":"FRET.STK","summary":"Restores a restartable stack frame whose first stack slot supplies the validated return target.","surface":"block"}// NDF-BEGIN: PTO-FRET-STK-RESTARTABLE-FRAME-001// ndf: kind=contract level=L1 layer=block status=accepted// FRET.STK MUST begin its inclusive ring at ra, load and validate stack slot// zero as the target, then restore remaining slots and publish that target.// NDF-END: PTO-FRET-STK-RESTARTABLE-FRAME-001// DOC-BEGIN: decodereadonly func InstructionContractMatches_FRET_STK(operation: CommandOperation) => booleanbegin return (operation == CommandOperation_fret_stk_32_4fe246bd8241);end;// DOC-END: decode// DOC-BEGIN: operationreadonly func InstructionContractHandler_FRET_STK() => CommandSemanticHandlerbegin return CommandHandler_ExecuteFrameReturnStack;end;
func ExecuteFRETSTK(begin_reg: Reg5Selector, end_reg: Reg5Selector, frame_size: Word)begin ReturnFromFrame(begin_reg, end_reg, frame_size, FALSE);end;
pure func InstructionContractUsesInclusiveRegisterRange_FRET_STK() => booleanbegin return TRUE;end;
pure func InstructionContractRejectsInvalidFrameRange_FRET_STK() => booleanbegin return TRUE;end;// DOC-END: operation// PTO-REVIEW: {"review_method":"formal-definition-read","outcome":"FORMAL-COMPLETE","reviewed_fields":["assembly","encoding","defaults","operation","state","memory","ordering","faults","reserved"]}
FRET.STK 是独立的栈帧生命周期命令;发布栈帧或控制流效果前,会先验证寄存器范围与栈状态。
FRET.STK 作为独立的 32 位命令执行,不要求放在 BSTART/BSTOP Block 体内。
已接受载体使用 L32 编码类别;命令在读取绑定或改变状态前,会先解析所有显示字段。
命令会在第一个可见效果前快照所有必需源,随后遵循归属单元定义的提交或重启边界。
DstBegin — R2..R23 闭环范围中的首个寄存器; DstEnd — R2..R23 闭环范围中的最后一个寄存器; uimm — 以八字节倍数编码的栈帧字节数。源验证与快照发生在所有寄存器、队列、栈帧、内存、事件或控制流效果之前。
命令按内存契约规定的重启边界提交;只有归属单元明确允许保存重启进度时,先前已提交步骤才保持可见。
固定比特、保留值、选择器取值域与必需的 Block 放置关系都在架构效果之前检查。
当前归属单元通过 Fault_IllegalInstruction, Fault_InstructionPC 报告无效模式、状态、地址或后继条件;本页说明文字不创建额外故障规则。
除非当前归属单元明确规定带保留进度的重启边界,否则拒绝发生在效果之前;完成顺序始终采用 ASL 顺序。
该示例只演示放置关系与载体流;精确行为仍由当前 ASL 和指令契约定义。
FRET.STK [ra ~ RegDstn], sp!, uimm所示已接受拼写从当前载体解析字段,快照必需源,再执行归属单元规定的状态与顺序转换。
正文来自 owning ASL。拖拽或按钮只临时改变当前页面显示顺序。
FRET.STK MUST begin its inclusive ring at ra, load and validate stack slot zero as the target, then restore remaining slots and publish that target.
PTO-FRET-STK-RESTARTABLE-FRAME-001asl/block/lifecycle/FRET.STK.asle6a461b486dc85d9341537560f4ee28a41c8b7acde7f8c13a9ba3f09a1986a820b92e9f818aa9b432feb0b94ad013ebb84a1949766b3b4e02400270db8e5d56c14 matching entries
PTO-AVS-BLOCK-FRET-STK-DECODE-001tests/asl/block/lifecycle/FRET.STK/block-decode-fret-stk-canonical-001.asl26222ccb8cbc0e32a2d58f3f2d40adac2cedc2d472aa80bedd03f509e4a38712PTO-AVS-BLOCK-FRET-STK-ODD-TARGET-002tests/asl/block/lifecycle/FRET.STK/block-fault-fret-stk-target-002.asl1bacaca9402b0c6eced627d19e370a1db623ea36cc284406b692c8a8ed348669PTO-AVS-BLOCK-FRET-STK-RANGE-001tests/asl/block/lifecycle/FRET.STK/block-fault-fret-stk-range-001.aslf2a934afdc9da212385fefe80022ded5c32d1399ed65e21e2cf1c616932f8819PTO-AVS-BLOCK-FRET-STK-RESTART-003tests/asl/block/lifecycle/FRET.STK/block-fault-fret-stk-restart-003.asl8ccbe27752220a0d8ff686277e13bfa25ca69c2972020a443363242867f6f0fbPTO-AVS-BLOCK-FRET-STK-TARGET-001tests/asl/block/lifecycle/FRET.STK/block-exec-fret-stk-target-001.asl09a7fd7743f0a0cb673f4774b42dc88dd12bb77462786858da529d3b9a2f4bb4PTO-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-0032…
ADR-0032docs/status/decisions/0032-bundle-command-totality-and-profile-boundaries.mde1f91826817343c0977a565a91e495a15397b83fa2af227124f225821ffa54aeLoading ADR-0052…
ADR-0052docs/status/decisions/0052-direct-tile-and-bundle-catalog-closure.md5fdb38bf480e37affe5075f93b35a57d32803018c986bfe05160f188a19ccaf6Loading ADR-0059…
ADR-0059docs/status/decisions/0059-mnemonic-field-encoding-closure.mdf18d13f735cfaf9f2803c754c5818f4af33d1cc42c489f0d9ce060b07bb3a196Loading ADR-0084…
ADR-0084docs/status/decisions/0084-scalar-system-and-queue-operations.mde068992fa81e2c4ac46e492391a2f784141d68e041bf0b9e0586c37217d1e08c{
"classification": [
"lifecycle"
],
"documentation": "docs/block/lifecycle/FRET.STK.md",
"id": "PTO-BLOCK-FRET-STK",
"instruction_contract": {
"artifact": "spec/evidence/instruction-contract-closure.json",
"mnemonic": "FRET.STK",
"ndf_clause": "PTO-INST-BLOCK-FRET-STK"
},
"mnemonic": "FRET.STK",
"readiness_subjects": [
"ADR-0032",
"ADR-0052",
"ADR-0059",
"ADR-0084"
],
"semantic_tests": [
"PTO-AVS-BLOCK-FRET-STK-ODD-TARGET-002",
"PTO-AVS-BLOCK-FRET-STK-RANGE-001",
"PTO-AVS-BLOCK-FRET-STK-RESTART-003",
"PTO-AVS-BLOCK-FRET-STK-TARGET-001"
],
"source": "asl/block/lifecycle/FRET.STK.asl",
"surface": "block",
"tests": [
"PTO-AVS-BLOCK-FRET-STK-DECODE-001",
"PTO-AVS-BLOCK-FRET-STK-ODD-TARGET-002",
"PTO-AVS-BLOCK-FRET-STK-RANGE-001",
"PTO-AVS-BLOCK-FRET-STK-RESTART-003",
"PTO-AVS-BLOCK-FRET-STK-TARGET-001"
]
}0.58.5 · 候选发布7dc8b7e5b121d2b2499a2273bebff29e2cd86812e6a461b486dc85d9341537560f4ee28a41c8b7acde7f8c13a9ba3f09a1986a822d050be02b56d2ba1856b52431e147fc92e3d459a29d6688c51998f3f3aec8eaasl/block/lifecycle/FRET.STK.aslasl/block/lifecycle/FRET.STK.aslasl/block/lifecycle/FRET.STK.asl