Software Tuning, Performance Optimization & Platform Monitoring
Discussion around monitoring and software tuning methodologies, Performance Monitoring Unit (PMU) of Intel microprocessors, and platform monitoring
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

## TSC Frequency Computation on Haswell Microarchitecture

Beginner
251 Views

Hi all,

According to the Intel Specifications Volume 3 section 14.5.5, the average frequency formula is:

``Favg = (TSC frequency) * (delta(IA32_APERF)/delta(IA32_MPERF))``

There are two methods to calculate the TSC frequency:

1) The first method is based on the value of MSR_PLATFORM_INFO[15:8] (register address is CEH). The output of the command rdmsr 0xCE is 80838f3011800. Then,  MSR_PLATFORM_INFO[15:8] = 18 (24 in decimal). So, the TSC frequency = 24* 100 = 2400 MHz

2) Another method to determine the processor base frequency based on the following formula ( Intel Specifications Volume 3 section 18.18.3):

`` Nominal TSC frequency = (CPUID.15H.ECX[31:0] * CPUID.15H.EBX[31:0] ) / (CPUID.15H.EAX[31:0])``

Then, the output of the command cpuid -r -l 0x15 is:

``  0x00000015 0x00:  eax=0x00000007  ebx=0x00000340  ecx=0x00000340  edx=0x00000000``

eax = 7 (hexa) = 7 (decimal)

ebx = 340 (hexa) = 832 (decimal)

ecx = 340 (hexa) = 832 (decimal)

Indeed, the nominal TSC frequency = (832 * 832) / 7 = 98889.14

----------------------------------------

Each method gives a different value of TSC frequency  (very important gap). Can you help me to know which value to consider?

Best regards,