09-14-2025, 06:41 AM
(This post was last modified: 09-14-2025, 08:22 AM by Stuart McLachlan.)
Couldn't work out why replacing the macro with the function didn't work. Finally realised that I had to change /10^15 to *10^3 to get the correct values!
Took a bit of time to work out that the issue was the macro substitution messing up the order of operations in the calculation.
The macro is not replacing CPUBaseFreq with the VALUE of 3.5*10^9, it is replacing it with the STRING 3.5*10^9 in the source code, which resulted in a difference order of calculation and a vastly different magnitude of the result.
So qTime/CPUBaseFreq
became
qTime/3.5*10^9
which is not the same as
qTime/(3.5*10^9)
(I guess the 10^15 was derived by trial and error since it has no logical basis when dividing tix by hertz
)
Took a bit of time to work out that the issue was the macro substitution messing up the order of operations in the calculation.
The macro is not replacing CPUBaseFreq with the VALUE of 3.5*10^9, it is replacing it with the STRING 3.5*10^9 in the source code, which resulted in a difference order of calculation and a vastly different magnitude of the result.
So qTime/CPUBaseFreq
became
qTime/3.5*10^9
which is not the same as
qTime/(3.5*10^9)
(I guess the 10^15 was derived by trial and error since it has no logical basis when dividing tix by hertz
