On 7 September 2017 at 17:30, Sergey Smolov <smo...@ispras.ru> wrote:
> I'm running MIPS assembler programs on QEMU. I need to log some events that
> happen through emulation (writes to some registers, for example). When an
> event happens, I need to print not only the event-related information, but
> an "emulation cycle number" also. This number should be an integer
> increasing value that is similar to real hardware clock.
>
> How to implement this in QEMU? May QEMU timers be helpful in solving such a
> problem?

You can use cpu_get_ticks(), though if we're not in icount mode
you may find it doesn't behave quite as helpfully as you might like
(in that case it roughly tracks host hardware cycles.)

thanks
-- PMM

Reply via email to