Software Tuning, Performance Optimization & Platform Monitoring
Discussion regarding monitoring and software tuning methodologies, Performance Monitoring Unit (PMU) of Intel microprocessors, and platform updating.

the time of reading HPET main counter register

RHuan64
Beginner
799 Views

Hi, Master

    I have used following method to measure the diff time of reading HPET timer register twice in sequence, the value cnt64_11 and cnt64_22 will return the current count number of HPET main counter, and the frequency of HPET main counter is 24MHz, the HPET is a PCH device, and the memory address map space is FED00000h - FED0010F,

    cnt64_1 = *(volatile UINT64 *)(HpetMainCounterRegAddr);

    cnt64_2 = *(volatile UINT64 *)(HpetMainCounterRegAddr);

(we have lock the interrupt and task reschedule, and exclude they impact the test)

so we could get the diff time of reading HPET timer register twice in sequence with following computing method,(unit: ns)

       diff_time (ns) =  (cnt64_22 - cnt64_11) * (1/24MHz) * 1000,000,000

   With the test case we have test several Intel boards, and get the diff_time are very different as following,

   On a Nehalem micro-Arch board, the diff_time is about 1000ns

   On a Broadwell micro-Arch board, the diff_time is about 400ns

   On a KabyLake micro-Arch board, the diff_time is about 4500ns

 

    And I also use TSC to measure the time of reading HPET timer counter register one time as following, the measure result time is same as above first test results

    readTscCount_1;     /* read TSC count */

    cnt64 = *(volatile UINT64 *)(HpetMainCounterRegAddr);

    readTscCount_2;    /* read TSC count */

 

    So according to above test results, I have following questions,

  •     If Intel have the performance test of reading HPET timer counter? if we could get the performance test results from Intel?
  •     How long time is it reasonable/correct to read the HPET timer counter registers one time?
  •     why the time of reading HPET timer counter registers one time is so different on several Intel boards?

Thanks

0 Kudos
0 Replies
Reply