On Wed, 8 May 2024 at 15:13, Philippe Mathieu-Daudé <phi...@linaro.org> wrote:
>
> Expose the clock frequency via the QOM 'freq-hz' property,
> as it might be useful for QTests.
>
> HMP example:
>
>   $ qemu-system-mips -S -monitor stdio -M mipssim
>   (qemu) qom-get /machine/cpu-refclk freq-hz
>   12000000
>
> Inspired-by: Inès Varhol <ines.var...@telecom-paris.fr>
> Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>

So I have a couple of thoughts here:

(1) if this is intended for qtests, would exposing the period (i.e.
QOM equivalent of clock_get() rather than clock_get_hz()) be better?
A Hz figure has rounding so it's not as accurate.

(2) We should document this in clocks.rst; I guess we want to say
"only intended for use in qtests" (i.e. if you're part of QEMU
use the existing function interface, not this).

thanks
-- PMM

Reply via email to