Skip to content

Commit 76d5e8f

Browse files
Add support for Arm Neoverse V2 (#194)
1 parent 959002f commit 76d5e8f

File tree

7 files changed

+40
-31
lines changed

7 files changed

+40
-31
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ LDFLAGS+= $(pkg-config --libs libcpuinfo)
272272
- [x] AMD-designed x86/x86-64 cores (up to Puma/Jaguar and Zen 2)
273273
- [ ] VIA-designed x86/x86-64 cores
274274
- [ ] Other x86 cores (DM&P, RDC, Transmeta, Cyrix, Rise)
275-
- [x] ARM-designed ARM cores (up to Cortex-A55, Cortex-A77, and Neoverse E1/V1/N2)
275+
- [x] ARM-designed ARM cores (up to Cortex-A55, Cortex-A77, and Neoverse E1/V1/N2/V2)
276276
- [x] Qualcomm-designed ARM cores (Scorpion, Krait, and Kryo)
277277
- [x] Nvidia-designed ARM cores (Denver and Carmel)
278278
- [x] Samsung-designed ARM cores (Exynos)

include/cpuinfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,8 @@ enum cpuinfo_uarch {
432432
cpuinfo_uarch_neoverse_v1 = 0x00300402,
433433
/** ARM Neoverse N2. */
434434
cpuinfo_uarch_neoverse_n2 = 0x00300403,
435+
/** ARM Neoverse V2. */
436+
cpuinfo_uarch_neoverse_v2 = 0x00300404,
435437

436438
/** ARM Cortex-X1. */
437439
cpuinfo_uarch_cortex_x1 = 0x00300501,

src/arm/cache.c

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,35 +1241,29 @@ void cpuinfo_arm_decode_cache(
12411241
case cpuinfo_uarch_neoverse_n1:
12421242
case cpuinfo_uarch_neoverse_v1:
12431243
case cpuinfo_uarch_neoverse_n2:
1244+
case cpuinfo_uarch_neoverse_v2:
12441245
{
1245-
/*
1246-
* ARM Neoverse-n1 Core Technical Reference Manual
1247-
* A6.1. About the L1 memory system
1248-
* The L1 memory system consists of separate instruction and data caches. Both have a fixed size of 64KB.
1249-
*
1250-
* A6.1.1 L1 instruction-side memory system
1251-
* The L1 instruction memory system has the following key features:
1252-
* - Virtually Indexed, Physically Tagged (VIPT), which behaves as a Physically Indexed,
1253-
* Physically Tagged (PIPT) 4-way set-associative L1 data cache.
1254-
* - Fixed cache line length of 64 bytes.
1255-
*
1256-
* A6.1.2 L1 data-side memory system
1257-
* The L1 data memory system has the following features:
1258-
* - Virtually Indexed, Physically Tagged (VIPT), which behaves as a Physically Indexed,
1259-
* Physically Tagged (PIPT) 4-way set-associative L1 data cache.
1260-
* - Fixed cache line length of 64 bytes.
1261-
* - Pseudo-LRU cache replacement policy.
1262-
*
1263-
* A7.1 About the L2 memory system
1264-
* The L2 memory subsystem consist of:
1265-
* - An 8-way set associative L2 cache with a configurable size of 256KB, 512KB, or 1024KB. Cache lines
1266-
* have a fixed length of 64 bytes.
1267-
* - Strictly inclusive with L1 data cache.
1268-
* - When configured with instruction cache hardware coherency, strictly inclusive with L1 instruction cache.
1269-
* - When configured without instruction cache hardware coherency, weakly inclusive with L1 instruction cache.
1270-
*/
1271-
1272-
const uint32_t min_l2_size_KB= 256;
1246+
/*
1247+
* The specifications here below are taken from the
1248+
* Arm Core Technical Reference Manuals for
1249+
* - Neoverse N1: https://developer.arm.com/documentation/100616/0401/?lang=en
1250+
* - Neoverse N2: https://developer.arm.com/documentation/102099/0003/?lang=en
1251+
* - Neoverse V1: https://developer.arm.com/documentation/101427/0102/?lang=en
1252+
* - Neoverse V2: https://developer.arm.com/documentation/102375/0002/?lang=en
1253+
*
1254+
* All four Arm architectures have L1 memory system with instruction and data caches,
1255+
* both of fixed size of 64KB. The instruction side memory system is 4-way set associative
1256+
* with a cache line length of 64 bytes. The data cache is also 4-way set associative with
1257+
* a cache line length of 64 bytes.
1258+
*
1259+
* The L2 memory system differs across the four Architectures in the minimum
1260+
* length of the L2 cache. Namely:
1261+
* - Arm Neoverse N1/N2/V1 have a L2 cache of configurable size of 256KB, 512KB, or 1024KB
1262+
* - Arm Neoverse V2 has a L2 cache of configurable size of 1MB or 2MB
1263+
* For all four architectures, the L2 cache is 8-way set associative
1264+
* For all other information, please refer to the technical manuals linked above
1265+
*/
1266+
const uint32_t min_l2_size_KB = uarch == cpuinfo_uarch_neoverse_v2 ? 1024 : 256;
12731267
const uint32_t min_l3_size_KB = 0;
12741268

12751269
*l1i = (struct cpuinfo_cache) {
@@ -1715,6 +1709,7 @@ uint32_t cpuinfo_arm_compute_max_cache_size(const struct cpuinfo_processor* proc
17151709
case cpuinfo_uarch_neoverse_n1:
17161710
case cpuinfo_uarch_neoverse_v1:
17171711
case cpuinfo_uarch_neoverse_n2:
1712+
case cpuinfo_uarch_neoverse_v2:
17181713
case cpuinfo_uarch_cortex_a75:
17191714
case cpuinfo_uarch_cortex_a76:
17201715
case cpuinfo_uarch_exynos_m4:

src/arm/linux/aarch32-isa.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
7979
* - Neoverse N1 cores
8080
* - Neoverse N2 cores
8181
* - Neoverse V1 cores
82+
* - Neoverse V2 cores
8283
*/
8384
if (chipset->series == cpuinfo_arm_chipset_series_samsung_exynos && chipset->model == 9810) {
8485
/* Only little cores of Exynos 9810 support FP16 & RDM */
@@ -100,6 +101,7 @@ void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
100101
case UINT32_C(0x4100D490): /* Neoverse N2 */
101102
case UINT32_C(0x4100D4D0): /* Cortex-A715 */
102103
case UINT32_C(0x4100D4E0): /* Cortex-X3 */
104+
case UINT32_C(0x4100D4F0): /* Neoverse V2 */
103105
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
104106
case UINT32_C(0x51008020): /* Kryo 385 Gold (Cortex-A75) */
105107
case UINT32_C(0x51008030): /* Kryo 385 Silver (Cortex-A55) */
@@ -130,6 +132,7 @@ void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
130132
* - Neoverse N1 cores
131133
* - Neoverse N2 cores
132134
* - Neoverse V1 cores
135+
* - Neoverse V2 cores
133136
*/
134137
if (chipset->series == cpuinfo_arm_chipset_series_spreadtrum_sc && chipset->model == 9863) {
135138
cpuinfo_log_warning("VDOT instructions disabled: cause occasional SIGILL on Spreadtrum SC9863A");
@@ -150,6 +153,7 @@ void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
150153
case UINT32_C(0x4100D490): /* Neoverse N2 */
151154
case UINT32_C(0x4100D4D0): /* Cortex-A715 */
152155
case UINT32_C(0x4100D4E0): /* Cortex-X3 */
156+
case UINT32_C(0x4100D4F0): /* Neoverse V2 */
153157
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
154158
case UINT32_C(0x51008040): /* Kryo 485 Gold (Cortex-A76) */
155159
case UINT32_C(0x51008050): /* Kryo 485 Silver (Cortex-A55) */

src/arm/linux/aarch64-isa.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
4343
* - Neoverse N1 cores
4444
* - Neoverse V1 cores
4545
* - Neoverse N2 cores
46+
* - Neoverse V2 cores
4647
*/
4748
if (chipset->series == cpuinfo_arm_chipset_series_samsung_exynos && chipset->model == 9810) {
4849
/* Exynos 9810 reports that it supports FP16 compute, but in fact only little cores do */
@@ -59,6 +60,7 @@ void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
5960
case UINT32_C(0x4100D0E0): /* Cortex-A76AE */
6061
case UINT32_C(0x4100D400): /* Neoverse V1 */
6162
case UINT32_C(0x4100D490): /* Neoverse N2 */
63+
case UINT32_C(0x4100D4F0): /* Neoverse V2 */
6264
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
6365
case UINT32_C(0x51008020): /* Kryo 385 Gold (Cortex-A75) */
6466
case UINT32_C(0x51008030): /* Kryo 385 Silver (Cortex-A55) */
@@ -100,6 +102,7 @@ void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
100102
case UINT32_C(0x4100D400): /* Neoverse V1 */
101103
case UINT32_C(0x4100D490): /* Neoverse N2 */
102104
case UINT32_C(0x4100D4A0): /* Neoverse E1 */
105+
case UINT32_C(0x4100D4F0): /* Neoverse V2 */
103106
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
104107
case UINT32_C(0x51008040): /* Kryo 485 Gold (Cortex-A76) */
105108
case UINT32_C(0x51008050): /* Kryo 485 Silver (Cortex-A55) */

src/arm/uarch.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void cpuinfo_arm_decode_vendor_uarch(
8989
case 0xD0E: /* Cortex-A76AE */
9090
*uarch = cpuinfo_uarch_cortex_a76;
9191
break;
92-
case 0xD40:
92+
case 0xD40: /* Neoverse V1 */
9393
*uarch = cpuinfo_uarch_neoverse_v1;
9494
break;
9595
case 0xD41: /* Cortex-A78 */
@@ -107,7 +107,7 @@ void cpuinfo_arm_decode_vendor_uarch(
107107
case 0xD48: /* Cortex-X2 */
108108
*uarch = cpuinfo_uarch_cortex_x2;
109109
break;
110-
case 0xD49:
110+
case 0xD49: /* Neoverse N2 */
111111
*uarch = cpuinfo_uarch_neoverse_n2;
112112
break;
113113
#if CPUINFO_ARCH_ARM64
@@ -121,6 +121,9 @@ void cpuinfo_arm_decode_vendor_uarch(
121121
case 0xD4E: /* Cortex-X3 */
122122
*uarch = cpuinfo_uarch_cortex_x3;
123123
break;
124+
case 0xD4F: /* Neoverse V2 */
125+
*uarch = cpuinfo_uarch_neoverse_v2;
126+
break;
124127
default:
125128
switch (midr_get_part(midr) >> 8) {
126129
#if CPUINFO_ARCH_ARM

tools/cpu-info.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ static const char* uarch_to_string(enum cpuinfo_uarch uarch) {
209209
return "Neoverse V1";
210210
case cpuinfo_uarch_neoverse_n2:
211211
return "Neoverse N2";
212+
case cpuinfo_uarch_neoverse_v2:
213+
return "Neoverse V2";
212214
case cpuinfo_uarch_scorpion:
213215
return "Scorpion";
214216
case cpuinfo_uarch_krait:

0 commit comments

Comments
 (0)