Skip to content

Commit

Permalink
add basic support for Elkhart Lake and Jasper Lake
Browse files Browse the repository at this point in the history
addresses issue #387
addresses issue #830

Change-Id: Id0f89c8a80e6c8513d156a0f930eaf5d750c3354
  • Loading branch information
rdementi committed Sep 26, 2024
1 parent 65b07c8 commit 53aab34
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/cpucounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,8 @@ void PCM::initCStateSupportTables()
case MTL:
case LNL:
case SNOWRIDGE:
case ELKHART_LAKE:
case JASPER_LAKE:
PCM_CSTATE_ARRAY(pkgCStateMsr, PCM_PARAM_PROTECT({0, 0, 0x3F8, 0, 0x3F9, 0, 0x3FA, 0, 0, 0, 0 }) );
case NEHALEM_EP:
case NEHALEM:
Expand Down Expand Up @@ -801,6 +803,8 @@ void PCM::initCStateSupportTables()
case MTL:
case LNL:
case SNOWRIDGE:
case ELKHART_LAKE:
case JASPER_LAKE:
case ICX:
case SPR:
case EMR:
Expand Down Expand Up @@ -1649,6 +1653,8 @@ bool PCM::detectNominalFrequency()
|| cpu_family_model == DENVERTON
|| useSKLPath()
|| cpu_family_model == SNOWRIDGE
|| cpu_family_model == ELKHART_LAKE
|| cpu_family_model == JASPER_LAKE
|| cpu_family_model == KNL
|| cpu_family_model == ADL
|| cpu_family_model == RPL
Expand Down Expand Up @@ -3243,6 +3249,8 @@ bool PCM::isCPUModelSupported(const int model_)
|| model_ == WESTMERE_EX
|| isAtom(model_)
|| model_ == SNOWRIDGE
|| model_ == ELKHART_LAKE
|| model_ == JASPER_LAKE
|| model_ == CLARKDALE
|| model_ == SANDY_BRIDGE
|| model_ == JAKETOWN
Expand Down Expand Up @@ -3549,6 +3557,8 @@ PCM::ErrorCode PCM::program(const PCM::ProgramMode mode_, const void * parameter
core_gen_counter_num_used = 4;
break;
case SNOWRIDGE:
case ELKHART_LAKE:
case JASPER_LAKE:
LLCArchEventInit(coreEventDesc);
coreEventDesc[2].event_number = SKL_MEM_LOAD_RETIRED_L2_MISS_EVTNR;
coreEventDesc[2].umask_value = SKL_MEM_LOAD_RETIRED_L2_MISS_UMASK;
Expand Down Expand Up @@ -4824,6 +4834,10 @@ const char * PCM::getUArchCodename(const int32 cpu_family_model_param) const
return "Denverton";
case SNOWRIDGE:
return "Snowridge";
case ELKHART_LAKE:
return "Elkhart Lake";
case JASPER_LAKE:
return "Jasper Lake";
case NEHALEM_EP:
case NEHALEM:
return "Nehalem/Nehalem-EP";
Expand Down
10 changes: 10 additions & 0 deletions src/cpucounters.h
Original file line number Diff line number Diff line change
Expand Up @@ -1856,6 +1856,8 @@ class PCM_API PCM
GEMINI_LAKE = PCM_CPU_FAMILY_MODEL(6, 122),
DENVERTON = PCM_CPU_FAMILY_MODEL(6, 95),
SNOWRIDGE = PCM_CPU_FAMILY_MODEL(6, 134),
ELKHART_LAKE = PCM_CPU_FAMILY_MODEL(6, 150),
JASPER_LAKE = PCM_CPU_FAMILY_MODEL(6, 156),
CLARKDALE = PCM_CPU_FAMILY_MODEL(6, 37),
WESTMERE_EP = PCM_CPU_FAMILY_MODEL(6, 44),
NEHALEM_EX = PCM_CPU_FAMILY_MODEL(6, 46),
Expand Down Expand Up @@ -2122,6 +2124,8 @@ class PCM_API PCM
case LNL:
return 12;
case SNOWRIDGE:
case ELKHART_LAKE:
case JASPER_LAKE:
return 4;
case DENVERTON:
return 3;
Expand Down Expand Up @@ -2451,6 +2455,8 @@ class PCM_API PCM
|| cpu_family_model == PCM::GEMINI_LAKE
|| cpu_family_model == PCM::DENVERTON
|| cpu_family_model == PCM::SNOWRIDGE
|| cpu_family_model == PCM::ELKHART_LAKE
|| cpu_family_model == PCM::JASPER_LAKE
|| cpu_family_model == PCM::HASWELLX
|| cpu_family_model == PCM::BROADWELL
|| cpu_family_model == PCM::BDX_DE
Expand Down Expand Up @@ -4270,6 +4276,8 @@ uint64 getL2CacheMisses(const CounterStateType & before, const CounterStateType
const auto cpu_family_model = pcm->getCPUFamilyModel();
if (pcm->useSkylakeEvents()
|| cpu_family_model == PCM::SNOWRIDGE
|| cpu_family_model == PCM::ELKHART_LAKE
|| cpu_family_model == PCM::JASPER_LAKE
|| cpu_family_model == PCM::SRF
|| cpu_family_model == PCM::ADL
|| cpu_family_model == PCM::RPL
Expand Down Expand Up @@ -4382,6 +4390,8 @@ uint64 getL3CacheHitsSnoop(const CounterStateType & before, const CounterStateTy
if (!pcm->isL3CacheHitsSnoopAvailable()) return 0;
const auto cpu_family_model = pcm->getCPUFamilyModel();
if (cpu_family_model == PCM::SNOWRIDGE
|| cpu_family_model == PCM::ELKHART_LAKE
|| cpu_family_model == PCM::JASPER_LAKE
|| cpu_family_model == PCM::SRF
|| cpu_family_model == PCM::ADL
|| cpu_family_model == PCM::RPL
Expand Down

0 comments on commit 53aab34

Please sign in to comment.