Skip to content

Add PPE42 (PowerPC Embedded) architecture support - #396

Open
Manideep-Bhupalam wants to merge 1 commit into
intel:mainfrom
Manideep-Bhupalam:properppe42
Open

Manideep-Bhupalam wants to merge 1 commit into
intel:mainfrom
Manideep-Bhupalam:properppe42

Conversation

@Manideep-Bhupalam

Copy link
Copy Markdown

No description provided.

@Wenzel
Wenzel requested a balanced review from Copilot October 28, 2026 09:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

7 open issues
What changed in this PR

Adds PPE42 (PowerPC Embedded) architecture support, including Simics-side tracing/decoding and a C/C++ harness header for emitting PPE42-compatible magic instructions.

Changes:

  • Introduce a new PPE42 architecture module with instruction classification and compare extraction.
  • Extend architecture selection and start/write logic to support physical-address-only and big-endian targets.
  • Add PPE42 harness headers and normalize SBE-range magic numbers to TSFFS standard magic numbers.
File Description
src/​lib.rs Normalizes SBE magic-number range to TSFFS standard magic numbers before dispatch.
src/​arch/​ppe42.rs Adds PPE42 ArchitectureOperations + PPE42 instruction decoder/disassembler for tracing.
src/​arch/​mod.rs Wires PPE42 into arch selection and adds physical-address + big-endian handling in shared routines.
harness/​tsffs.h Attempts to include a PPE42-specific harness header under PPC defines.
harness/​tsffs-gcc-ppe42.h Adds PPE42 magic-instruction macros and TSFFS harness macros for PowerPC/PPE42.

Review effort: Lite

Comment thread harness/tsffs-gcc-ppe42.h
Comment on lines +36 to +43
#define __ppe42_magic(n) \
__asm__ __volatile__("rlwimi %0,%0,0,%1,%2" \
: \
: "i" (((n) >> 8) & 0x1f), \
"i" (((n) >> 4) & 0xf), \
"i" ((((n) >> 0) & 0xf) | 16) \
: )

Comment thread harness/tsffs-gcc-ppe42.h
Comment on lines +52 to +59
#define __ppe42_magic_extended1(n, arg0) \
__asm__ __volatile__("mr 10, %0; rlwimi %1,%1,0,%2,%3" \
: \
: "r"(arg0), \
"i" (((n) >> 8) & 0x1f), \
"i" (((n) >> 4) & 0xf), \
"i" ((((n) >> 0) & 0xf) | 16) \
: "r10")
Comment thread harness/tsffs.h
Comment on lines 2589 to 2594
#endif // TSFFS_H
#elif defined(__PPC__) || defined(__ppc__) || defined(__powerpc__) || defined(_ARCH_PPC)
#include "tsffs-gcc-ppe42.h"
#else
#error "Unsupported platform!"
#endif
Comment thread src/arch/mod.rs
Comment on lines +537 to +541
let addr_size = if let Some(width) = Self::POINTER_WIDTH_OVERRIDE {
width as usize
} else {
self.processor_info_v2().get_logical_address_width()? as usize / u8::BITS as usize
};
Comment thread src/arch/mod.rs
Comment on lines +553 to +568
let len_bytes = if Self::BYTE_ORDER_BIG_ENDIAN {
testcase
.len()
.to_be_bytes()
.iter()
.skip(usize::BITS as usize / u8::BITS as usize - addr_size)
.copied()
.collect::<Vec<u8>>()
} else {
testcase
.len()
.to_le_bytes()
.iter()
.take(addr_size)
.copied()
.collect::<Vec<u8>>()
Comment thread src/arch/ppe42.rs
Comment on lines +212 to +227
let address = self
.processor_info_v2
.logical_to_physical(a, Access::Sim_Access_Read)?;
Ok(CmpValue::U64(read_phys_memory(
self.cpu,
address.address,
size_of::<u64>() as i32,
)?))
}
CmpValue::U32(a) => {
let address = self
.processor_info_v2
.logical_to_physical(a as u64, Access::Sim_Access_Read)?;
Ok(CmpValue::U32(read_phys_memory(
self.cpu,
address.address,
Comment thread src/lib.rs
Comment on lines +618 to +625
// Normalize SBE magic numbers (8010-8015 range) to standard range (1-5)
// SBE uses magic numbers in range 8000-8190, TSFFS uses 8010-8015
// 8011-8015 map to 1-5 (start/stop)
let normalized_magic = if magic_number >= 8010 && magic_number <= 8015 {
magic_number - 8010
} else {
magic_number
};
@Wenzel

Wenzel commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Hi @Manideep-Bhupalam
thanks for this PR 👍

Can you add at least a minimal description ?

Launched CI + Copilot, please take care of any failing test / copilot review.

Thanks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants