This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

6678TSCL问题

void calc_cycle_measure_overhead()

{

    unsigned int cycle_cold, cycle_warm;

    cycle_cold= TSCL; 

    cycle_cold = TSC_getDelay(cycle_cold);

    cycle_warm= TSCL;

    cycle_warm = TSC_getDelay(cycle_warm);

    cycle_measure_overhead = (cycle_cold + cycle_warm)/2;

}

#define TSC_getDelay(startTSC) ((unsigned int)((0xFFFFFFFFl+TSCL)- (unsigned long long)startTSC)+ 1)

#define TSC_count_cycle_from(startTSC) (TSC_getDelay(startTSC)- cycle_measure_overhead)

 问题:

1. cycle_measure_overhead = (cycle_cold + cycle_warm)/2;为什么要求一个均值?

2. #define TSC_getDelay(startTSC) ((unsigned int)((0xFFFFFFFFl+TSCL)- (unsigned long long)startTSC)+ 1)为什么要写成这种形式,不是直接用TSCL