/*! \page zen3 AMD® Zen3 (Ryzen, Epyc)

# Available performance monitors for the AMD® Zen3 microarchitecture

- \ref ZEN3_PMC "General-purpose counters"
- \ref ZEN3_POWER_CORE "CPU core energy counters"
- \ref ZEN3_CPMC "L3 cache general-purpose counters"
- \ref ZEN3_POWER_SOCKET "Socket energy counters"
- \ref ZEN3_DATA_FABRIC "Data Fabric counters"

\anchor ZEN3_PMC

## General-purpose counters

The AMD® Zen3 microarchitecture provides 6 general-purpose counters consisting of a config and a counter register.

### Counter and events

Counter name | Event name
--- | ---
PMC0 | *
PMC1 | *
PMC2 | *
PMC3 | *
PMC4 | *
PMC5 | *

### Available Options

Option | Argument | Description | Comment
--- | --- | --- | ---
edgedetect | N | Set bit 18 in config register |
kernel | N | Set bit 17 in config register |
threshold | 7 bit hex value | Set bits 24-31 in config register |
invert | N | Set bit 23 in config register |

# Counters available for one hardware thread per CPU core

\anchor ZEN3_POWER_CORE

## Power counters

The AMD® Zen3 microarchitecture provides measurements of the current power consumption through the RAPL interface.

### Counter and events

Counter name | Event name
--- | ---
PWR0 | RAPL_CORE_ENERGY

There are more energy counters but only one for each socket (\ref ZEN3_POWER_SOCKET)

# Counters available for one hardware thread per shared L3 cache

\anchor ZEN3_CPMC

## L3 general-purpose counters

The AMD® Zen3 microarchitecture provides 6 general-purpose counters for measuring L3 cache events. They consist of a config and a counter register.

### Counter and events

Counter name | Event name
--- | ---
CPMC0 | *
CPMC1 | *
CPMC2 | *
CPMC3 | *
CPMC4 | *
CPMC5 | *

### Available Options

Option | Argument | Description | Comment
--- | --- | --- | ---
tid | 8 bit hex value | Set bits 56-63 in config register | Define which CPU thread should be counted. Bits: 0 = Core0-Thread0, 1 = Core0-Thread1, 2 = Core1-Thread0, 3 = Core1-Thread1, ... Default are all threads
cid | 3 bit hex value | Set bits 42-45 in config register | Selects which core should be counted. If not specified, the all-cores flag (bit 47) is set
slice | 4 bit hex value | Set bits 48-51 in config register | Selects which L3 slice should be counted. If not specified, the all-slices flag (bit 46) is set

# Counters available for one hardware thread per socket

\anchor ZEN3_POWER_SOCKET

## Power counters

The AMD® Zen3 microarchitecture provides measurements of the current power consumption through the RAPL interface.

### Counter and events

Counter name | Event name
--- | ---
PWR1 | RAPL_PKG_ENERGY

There are more energy counters for each CPU core (\ref ZEN3_POWER_CORE)

\anchor ZEN3_DATA_FABRIC

## Data Fabric counters

The AMD® Zen3 microarchitecture provides additional Uncore counters for the so-called Data Fabric. It is currently unclear whether the units are socket- or NUMA node-specific.

### Counter and events

Counter name | Event name
--- | ---
DFC0 | *
DFC1 | *
DFC2 | *
DFC3 | *