Operands and parameters
RegDst- Reg5 destination: discard, R1..R23, push U, or push T
SSR_ID- system-register identifier
SrcL- Reg5 source: R0..R23, T#1..T#4, or U#1..U#4
SSRSWAP atomically swaps the complete encoded system-register address.
PTO-SCALAR-SSRSWAPssrswap SrcL, SSR_ID, ->{t, u, Rd}| Field | Bits | Signedness | Architectural role | Encoded zero |
|---|---|---|---|---|
RegDst | 5 | encoding-defined | Reg5 destination: discard, R1..R23, push U, or push T | Encoded zero names the architectural zero GPR. |
SSR_ID | 12 | encoding-defined | system-register identifier | Encoded zero selects value zero of the system-register identifier. |
SrcL | 5 | encoding-defined | Reg5 source: R0..R23, T#1..T#4, or U#1..U#4 | Encoded zero names the architectural zero GPR. |
Loading WaveDrom diagram… The encoding table and WaveJSON remain available below.
| Decoded item | Bit range | Value |
|---|---|---|
| SSR_ID | 31:20 | variable |
| SrcL | 19:15 | variable |
| Constant | 14:12 | 3'b010 |
| RegDst | 11:7 | variable |
| Constant | 6:0 | 7'b0111011 |
{
"reg": [
{
"bits": 7,
"name": "7'b0111011"
},
{
"bits": 5,
"name": "RegDst"
},
{
"bits": 3,
"name": "3'b010"
},
{
"bits": 5,
"name": "SrcL"
},
{
"bits": 12,
"name": "SSR_ID"
}
],
"config": {
"bits": 32,
"fontsize": 13,
"hspace": 900,
"lanes": 1,
"offset": 0
}
}ssrswap SrcL, SSR_ID, ->{t, u, Rd}
RegDstSSR_IDSrcLThis Operation comes directly from the instruction owner; the page does not rewrite its behavior.
readonly func InstructionContractOperation_SSRSWAP() => ScalarOperationbegin return ScalarOperation_SSRSWAP;end;readonly func InstructionContractHandler_SSRSWAP() => ScalarSemanticHandlerbegin return ScalarHandler_ExecuteSystemRegisterSwap;end;
pure func InstructionContractRequiresSystemBlock_SSRSWAP() => booleanbegin return TRUE;end;
pure func InstructionContractSystemTransferKind_SSRSWAP() => bits(2)begin return '10';end;
pure func InstructionContractSystemAddressWidth_SSRSWAP() => integer {5,12,24}begin return 12;end;
pure func InstructionContractPushesTemporaryT_SSRSWAP() => booleanbegin return FALSE;end;// PTO-INSTRUCTION: {"assembly":["ssrswap SrcL, SSR_ID, ->{t, u, Rd}"],"block":[],"catalog_indices":[435],"catalog_records":[{"asm":"ssrswap SrcL, SSR_ID, ->{t, u, Rd}","constraints":[],"encoding":[{"index":0,"mask":"0x0000707f","match":"0x0000203b","width_bits":32}],"encoding_kind":"L32","fields":[{"name":"RegDst","pieces":[{"instruction_lsb":7,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5},{"name":"SSR_ID","pieces":[{"instruction_lsb":20,"value_lsb":0,"width":12}],"signedness":"encoding-defined","width":12},{"name":"SrcL","pieces":[{"instruction_lsb":15,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5}],"form_id":"ssrswap_32_a01c7e2c7c29","length_bits":32,"mnemonic":"SSRSWAP","semantic_family":"SYS","semantic_group":"SYS","semantic_handler":"ExecuteSystemRegisterSwap","semantic_summary":"SSRSWAP atomically swaps the complete encoded system-register address.","status":"accepted"}],"classification":["sys"],"contract":{"block_composition":["SSRSWAP executes as one scalar operation in the body of an active SYS block."],"canonical_assembly":["ssrswap SrcL, SSR_ID, ->{t, u, Rd}"],"defaults":["Every displayed operand is encoded explicitly. Encoded zero is an assigned value and never denotes omission."],"encoding_class":"standalone-encoded","examples":["ssrswap SrcL, SSR_ID, ->{t, u, Rd}"],"exceptions":["Invalid block placement raises Illegal Block Exception before encoded-field legality or effects.","A reserved encoding or rejected access raises Illegal Instruction before destination, queue, system-state, or TPC effects."],"field_contracts":{},"field_zero_meanings":{"RegDst":"Encoded zero names the architectural zero GPR.","SSR_ID":"Encoded zero selects value zero of the system-register identifier.","SrcL":"Encoded zero names the architectural zero GPR."},"legality":["Every fixed bit and explicit field constraint is checked before operation semantics.","The complete encoded address is checked against its RO, WO, RW, unknown-address, and current-ACR access rules before effects."],"memory_effects":["none"],"operands":[{"field":"RegDst","role":"Reg5 destination: discard, R1..R23, push U, or push T"},{"field":"SSR_ID","role":"system-register identifier"},{"field":"SrcL","role":"Reg5 source: R0..R23, T#1..T#4, or U#1..U#4"}],"ordering":["Preflight read permission, write permission, and RW access class before reading SrcL or the old register value.","Snapshot SrcL, read the old value, write the new value, publish the old value, and then advance TPC."],"standalone_opcode":true,"state_effects":["Atomically exchange the selected RW system register with the snapshotted source and publish the old value through RegDst.","A rejected swap performs neither read-side effects nor register, destination, queue, or TPC effects."]},"depends_on":["PTO-SCALAR-MODEL-SYS-REGISTERS"],"id":"PTO-SCALAR-SSRSWAP","mnemonic":"SSRSWAP","summary":"SSRSWAP atomically swaps the complete encoded system-register address.","surface":"scalar"}// PTO-REVIEW: {"review_method":"formal-definition-read","outcome":"FORMAL-COMPLETE","reviewed_fields":["assembly","encoding","defaults","operation","state","memory","ordering","faults","reserved"]}// NDF-BEGIN: PTO-SSRSWAP-ADR-CONTRACT-001// ndf: kind=contract level=L1 layer=scalar status=accepted// Decisions: ADR-0031.// SSRSWAP MUST enforce its mnemonic-owned system or maintenance access// domain before effects and MUST preserve destination, queue, and system state// on rejection except for the ordinary instruction-attempt trap envelope.// NDF-END: PTO-SSRSWAP-ADR-CONTRACT-001// DOC-BEGIN: decodereadonly func InstructionContractOperation_SSRSWAP() => ScalarOperationbegin return ScalarOperation_SSRSWAP;end;// DOC-END: decode// DOC-BEGIN: operationreadonly func InstructionContractHandler_SSRSWAP() => ScalarSemanticHandlerbegin return ScalarHandler_ExecuteSystemRegisterSwap;end;
pure func InstructionContractRequiresSystemBlock_SSRSWAP() => booleanbegin return TRUE;end;
pure func InstructionContractSystemTransferKind_SSRSWAP() => bits(2)begin return '10';end;
pure func InstructionContractSystemAddressWidth_SSRSWAP() => integer {5,12,24}begin return 12;end;
pure func InstructionContractPushesTemporaryT_SSRSWAP() => booleanbegin return FALSE;end;// DOC-END: operation
SSRSWAP atomically exchanges an assigned RW system register and publishes its old XLEN value.
The ASL DOC region selects ScalarHandler_ExecuteSystemRegisterSwap. Placement and encoded legality are checked before sources or system state can change.
The instruction occupies one scalar operation position in the body of an active SYS block.
RegDst carries the Reg5 destination: discard, R1..R23, push U, or push T; SSR_ID carries the system-register identifier; SrcL carries the Reg5 source: R0..R23, T#1..T#4, or U#1..U#4.
Encoded zero is an assigned field value, never an omitted operand.
After read/write preflight, the selected RW system register is atomically exchanged with snapshotted SrcL, and its old XLEN value is published through RegDst.
A rejected swap performs no register, destination, queue, read-side-effect, or TPC update beyond ordinary trap entry.
Both permissions and the RW access class are established before either source or old-register value is consumed.
Invalid SYS-block placement is rejected before field checks. Reserved encodings or denied access produce no destination, queue, system-state, or TPC effect beyond the ordinary trap envelope.
This spelling example is illustrative; exact legality and effects remain in the generated contract below.
Start with ssrswap SrcL, SSR_ID, ->{t, u, Rd} and trace its encoded fields through preflight before following the selected system effect.
Bodies come from owning ASL. Dragging or buttons change only this page-session view order.
Decisions: ADR-0031. SSRSWAP MUST enforce its mnemonic-owned system or maintenance access domain before effects and MUST preserve destination, queue, and system state on rejection except for the ordinary instruction-attempt trap envelope.
PTO-SSRSWAP-ADR-CONTRACT-001asl/scalar/sys/SSRSWAP.asl6ae0b6069c1302eb2ca43e23b4c3ac7a1a73dafa5dc8da7962e35430a20502c8eeea10a8947f9e1a3b655deb18c5d8bb8c3918fa5666dc9352af4d881ad0741b21 matching entries
PTO-AVS-SCALAR-SSRSWAP-DECODE-001tests/asl/scalar/sys/SSRSWAP/scalar-decode-ssrswap-canonical-001.asl6ebc35fa06aea48327c5d87873be95c0436c2854668d72a7f86ca1e28fd8b5e7PTO-AVS-SYS-SSRSWAP-ACCESS-001tests/asl/scalar/sys/SSRSWAP/scalar-fault-ssrswap-access-001.aslfc8ac425642429752f7c56d2b3753ca01009c9fb9a2432300418a60f4516626aPTO-AVS-SYS-SSRSWAP-DISCARD-001tests/asl/scalar/sys/SSRSWAP/scalar-exec-ssrswap-discard-001.asle3818e842276c2e70897f9c8e6e04e13e5040ea9bc6a5921de4af21a99d07f41PTO-AVS-SYS-SSRSWAP-EXEC-001tests/asl/scalar/sys/SSRSWAP/scalar-exec-ssrswap-direct-001.asl5a615418798cf1f10ecea0a99e83410d0a75f986a02cffc50b302617e106f9c5PTO-AVS-SYS-SSRSWAP-PLACE-001tests/asl/scalar/sys/SSRSWAP/scalar-fault-ssrswap-place-001.asla08a8ebd3220cf1fa8589032f99364768e35e4d8fcef40b8fcf816c6fc529109PTO-AVS-SYS-SSRSWAP-RING-001tests/asl/scalar/sys/SSRSWAP/scalar-fault-ssrswap-ring-001.aslda612bcd34689f03fabfa5e81cfa91350b5289bf330e138ea1c4228c9dd6bb1aPTO-AVS-SYS-SSRSWAP-TDST-001tests/asl/scalar/sys/SSRSWAP/scalar-exec-ssrswap-tdst-001.asld23d929b5c6c058230ebca575cd4fdd73a4499c05488a10b30a8673efdf444e3PTO-AVS-SYS-SSRSWAP-TSRC-001tests/asl/scalar/sys/SSRSWAP/scalar-exec-ssrswap-tsrc-001.asl758891007a323c35c9084fa359ddb1a241ed75298042e139fb8a48e08076c20dPTO-AVS-SYS-SSRSWAP-UDST-001tests/asl/scalar/sys/SSRSWAP/scalar-exec-ssrswap-udst-001.asl02a1d27a1ac6674641ef156e6b3e47726c664cb0b1e358af7132d38f8dc47fdbPTO-AVS-SYS-SSRSWAP-UNKNOWN-001tests/asl/scalar/sys/SSRSWAP/scalar-fault-ssrswap-unknown-001.asl75d919ca146cf4d6a3e600ed2dbd85d127a260da3ac0f954f9c84a3a31c47acaPTO-AVS-SYS-SSRSWAP-USRC-001tests/asl/scalar/sys/SSRSWAP/scalar-exec-ssrswap-usrc-001.asl4a3da23a3f5e1f46d8eaf24f3af185eb840d8470839a7bffce97950dab766187PTO-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-0003…
ADR-0003docs/status/decisions/0003-pto-owned-system-register-names.mdc6a5379776c3b29c25f0896bc56f84d8f5c15832bbba0859b822aa99a65e342dLoading ADR-0018…
ADR-0018docs/status/decisions/0018-pto-v0-trap-disposition.mdce33454ffd2a595425ebece5954c9990ea2b9c4890008ad700599f767d7b9716Loading ADR-0031…
ADR-0031docs/status/decisions/0031-scalar-sys-totality-and-profile-boundaries.md5680b3516be6c28a1ccb198c99f5efb66317c65330f6d87434173024d2795a7dLoading 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": [
"sys"
],
"documentation": "docs/scalar/sys/SSRSWAP.md",
"id": "PTO-SCALAR-SSRSWAP",
"instruction_contract": {
"artifact": "spec/evidence/instruction-contract-closure.json",
"mnemonic": "SSRSWAP",
"ndf_clause": "PTO-INST-SCALAR-SSRSWAP"
},
"mnemonic": "SSRSWAP",
"readiness_subjects": [
"ADR-0003",
"ADR-0018",
"ADR-0031",
"ADR-0059",
"ADR-0084"
],
"semantic_tests": [
"PTO-AVS-SYS-SSRSWAP-ACCESS-001",
"PTO-AVS-SYS-SSRSWAP-DISCARD-001",
"PTO-AVS-SYS-SSRSWAP-EXEC-001",
"PTO-AVS-SYS-SSRSWAP-PLACE-001",
"PTO-AVS-SYS-SSRSWAP-RING-001",
"PTO-AVS-SYS-SSRSWAP-TDST-001",
"PTO-AVS-SYS-SSRSWAP-TSRC-001",
"PTO-AVS-SYS-SSRSWAP-UDST-001",
"PTO-AVS-SYS-SSRSWAP-UNKNOWN-001",
"PTO-AVS-SYS-SSRSWAP-USRC-001"
],
"source": "asl/scalar/sys/SSRSWAP.asl",
"surface": "scalar",
"tests": [
"PTO-AVS-SCALAR-SSRSWAP-DECODE-001",
"PTO-AVS-SYS-SSRSWAP-ACCESS-001",
"PTO-AVS-SYS-SSRSWAP-DISCARD-001",
"PTO-AVS-SYS-SSRSWAP-EXEC-001",
"PTO-AVS-SYS-SSRSWAP-PLACE-001",
"PTO-AVS-SYS-SSRSWAP-RING-001",
"PTO-AVS-SYS-SSRSWAP-TDST-001",
"PTO-AVS-SYS-SSRSWAP-TSRC-001",
"PTO-AVS-SYS-SSRSWAP-UDST-001",
"PTO-AVS-SYS-SSRSWAP-UNKNOWN-001",
"PTO-AVS-SYS-SSRSWAP-USRC-001"
]
}0.58.5 · Release candidate7dc8b7e5b121d2b2499a2273bebff29e2cd868126ae0b6069c1302eb2ca43e23b4c3ac7a1a73dafa5dc8da7962e35430a20502c8016ec5523c2075d748c6b9b26f4738d189c145695d9de5535f52970f26603ba7asl/scalar/sys/SSRSWAP.aslasl/scalar/sys/SSRSWAP.aslasl/scalar/sys/SSRSWAP.asl