This changes how we compute the variance. We want an unbiased variance
when reasoning about a sample.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Paulo suggested that we could short-circuit the search for a good
divider if we find a 0 deviation of the DCO frequency from the central
frequency.
Out of the 373 test frequencies, 34 hit that fast path.
Suggested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Paulo noticed that, because we were only comparing positive deviations
with positive deviations and negative deviations with negative
deviations, we weren't actually always using the absolute minimal
deviation at all.
This improves the average deviation across all tested frequencies (373):
before: average deviation: 215.13
after: average deviation: 194.47
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Follow Paulo's comment on the corresponding kernel patch.
This means we also have to move the break when we have cycled through
the even dividers as well.
This improves the number of even dividers used across the tested
frequencies (373) (at the expense of a slightly worse average deviation,
but "even dividers take precedence over a lower deviation".
before:
even/odd dividers: 338/35
average deviation: 206.52
after:
even/odd dividers: 363/10
average deviation: 215.13
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
It's interesting to watch the effect of some algorithm tweaks on the
average deviation between the central freq and the dco freq. A metric
we'd like to minimize.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
We might as well verify that we have a semblance of all being in order
by making sure the DCO frequency is within the expected bounds.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
I had various problems (infinite loops, unable to compute dividers for
certain frequencies) after implementing a BSpec update. Much easier to
debug that in userspace.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>