From 2b1a01ee6ccda9f046b1ceb13c90ee0635473959 Mon Sep 17 00:00:00 2001 From: Akash Bagdia Date: Fri, 9 May 2014 18:58:46 -0400 Subject: cpu, arm: Allow the specification of a socket field Allow the specification of a socket ID for every core that is reflected in the MPIDR field in ARM systems. This allows studying multi-socket / cluster systems with ARM CPUs. --- src/arch/arm/utility.cc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/arch/arm') diff --git a/src/arch/arm/utility.cc b/src/arch/arm/utility.cc index d5b062621..ae84391e9 100644 --- a/src/arch/arm/utility.cc +++ b/src/arch/arm/utility.cc @@ -195,13 +195,26 @@ longDescFormatInUse(ThreadContext *tc) uint32_t getMPIDR(ArmSystem *arm_sys, ThreadContext *tc) { + // Multiprocessor Affinity Register MPIDR from Cortex(tm)-A15 Technical + // Reference Manual + // + // bit 31 - Multi-processor extensions available + // bit 30 - Uni-processor system + // bit 24 - Multi-threaded cores + // bit 11-8 - Cluster ID + // bit 1-0 - CPU ID + // + // We deliberately extend both the Cluster ID and CPU ID fields to allow + // for simulation of larger systems + assert((0 <= tc->cpuId()) && (tc->cpuId() < 256)); + assert((0 <= tc->socketId()) && (tc->socketId() < 65536)); if (arm_sys->multiProc) { return 0x80000000 | // multiprocessor extensions available - tc->cpuId(); + tc->cpuId() | tc->socketId() << 8; } else { return 0x80000000 | // multiprocessor extensions available 0x40000000 | // in up system - tc->cpuId(); + tc->cpuId() | tc->socketId() << 8; } } -- cgit v1.2.3