Repository navigation
Conversation
helper_rfci/rfdi/rfmci passed the SPR number (SPR_BOOKE_CSRR1 etc.) instead of the register's value to do_rfi, so the restored MSR was a constant unrelated to the interrupted context. Co-authored-by: Claude Code <claude-code[bot]@users.noreply.github.com>
Privileged instructions executed in problem state raised a program exception with the illegal-instruction reason (INVAL | PRIV_*), so ESR[PIL] was set instead of ESR[PPR]. Add gen_priv_exception and use it for the PRIV_OPC/PRIV_REG cases. Co-authored-by: Claude Code <claude-code[bot]@users.noreply.github.com>
mcrxr must copy XER[SO,OV,CA] into bits 3..1 of the CR field (LT,GT,EQ) and clear bit 0. The shift by XER_CA placed them one bit too low. Co-authored-by: Claude Code <claude-code[bot]@users.noreply.github.com>
Writing MSR through tlib_set_register_value stored the raw value and left hflags and the MMU index stale until the next mtmsr. Route MSR writes through ppc_store_msr. Co-authored-by: Claude Code <claude-code[bot]@users.noreply.github.com>
e200 cores (e200z6 and family) implement a Book E 2.06 MAS-style MMU: TLB0 is not present and TLB1 is a fully associative array with variable page sizes and IPROT. The model used the 440-style embedded TLB (TLB_EMB, 64 entries) and the classic Book E TLB instructions, so tlbwe/tlbre/tlbsx through MAS registers did not work. Configure TLB1 (32 entries) through TLBnCFG, use TLB_MAS and the BOOKE206 instructions, and make L1CSR0 cache-invalidate and lock-flash-clear commands complete immediately so polling loops terminate. Co-authored-by: Claude Code <claude-code[bot]@users.noreply.github.com>
e200z4d as used in NXP MPC56xx (e.g. MPC5645S/PXD20) and ST SPC56 microcontrollers: e200 instruction set with VLE, a 16-entry TLB1 and an instruction cache controlled by L1CSR1. Co-authored-by: Claude Code <claude-code[bot]@users.noreply.github.com>
VLE instructions are 2-byte aligned. Branch targets were masked with ~3 in gen_goto_tb and rfi masked SRR0 the same way, which corrupted control flow to any halfword-aligned target. Mask with ~1 when VLE is enabled. Co-authored-by: Claude Code <claude-code[bot]@users.noreply.github.com>
Split gen_rlwimi/gen_rlwinm into helpers that take whether to honour the Rc bit. The VLE e_rlwimi/e_rlwinm forms reuse the classic translation but bit 0 selects the instruction, not Rc. Co-authored-by: Claude Code <claude-code[bot]@users.noreply.github.com>
Implement the 16-bit (se_*) and 32-bit (e_*) VLE instructions that were registered but aborted as unsupported: - compact register fields map to r0-r7 and r24-r31 (RX/RY/RZ) or r8-r23 (ARX/ARY); - SCI8, I16A, I16L, LI20, D8 and SD4 immediate/displacement forms; - e_b/e_bc/se_b/se_bc/se_blr/se_bctr with halfword displacements and CTR forms; - loads/stores including update forms and e_lmw/e_stmw; - se_rfi/se_rfci/se_rfdi/se_illegal/se_sc, with SRR0 pointing at the 16-bit instruction for program exceptions. A 16-bit instruction must not decode fields from the low halfword of the fetched word, which holds the next instruction; this is why se_add no longer reuses gen_op_arith_add. Co-authored-by: Claude Code <claude-code[bot]@users.noreply.github.com>
In VLE mode the classic X/XO-form opcode-31 instructions remain available (integer arithmetic and logic, indexed loads/stores, isel, mfcr/mtcrf, mfmsr/mtmsr, mfspr/mtspr, wrtee, cache and TLB management, mbar/msync). Register them in the VLE decoder, which uses a different split of the extended opcode. Co-authored-by: Claude Code <claude-code[bot]@users.noreply.github.com>
7 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Companion peripheral proposal: renode/renode-infrastructure#272
This draft contributes reusable PowerPC CPU changes only. It adds an
e200z4dcore definition, implements many previously aborting compact and extended VLE instruction handlers, and registers selected classic opcode-31 instructions in the VLE decoder. It contains no board platform, application image, capture, or host display transport.The series separates generally applicable fixes from core initialization and VLE work:
rfci,rfdi, andrfmci, rather than from the SPR number.mcrxrand update derived CPU state when MSR is written through either register API.Model boundaries and known limitations
mmubooke206_get_physical_addressstill has an identity-mapping fallback after unsuccessful translation/permission checks for portions of the address space. This series does not remove that fallback; therefore it does not provide strict translation-fault or access-protection enforcement across the address space.MMUCSR0is registered with generic read/write callbacks, not the available BookE206 invalidation-command callback. Do not infer working MMUCSR0 invalidation from register availability.tlib_is_vle_enabled()callback, not a newly implemented per-page MAS2[VLE] mechanism. Per-page endian/cache attribute enforcement is not added.se_rfmcistill explicitly aborts, andgen_se_bretains an unsupported-encoding guard. Build success onppc64.beis a compatibility/build check, not a claim of a 64-bit e200 core or comprehensive 64-bit VLE semantics.Validation
ppc.beandppc64.be: 20 successful builds, no warnings recorded by the build checker.git diff --checkon the CPU series passed.Runtime checks use the 32-bit big-endian backend. The broader unchecked conformance and CI items remain open; these tests do not turn the limitations above into supported features.
Contribution/process notes
Developed with AI assistance from ChatGPT (OpenAI Codex) and Claude (Anthropic). This disclosure does not substitute for human review or the validation above.
The checked-out Renode contribution guide requests an issue before a pull request, ticket-based branch naming, and a CLA. Please advise how to apply that process to this companion tlib series and the separate peripheral proposal. No issue number or signed-CLA status is asserted here. This is an early draft for maintainer feedback on scope, test placement and contribution process.