simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] Clock cycles


From: Theodore A. Roth
Subject: Re: [Simulavr-devel] Clock cycles
Date: Wed, 30 Jul 2003 11:57:20 -0700 (PDT)


On Wed, 30 Jul 2003, eban wrote:

> Hi everybody,
>
> Here's the patch that I promised.
> What was missing was only to create it using diff.
> I hope that you find it useful.
>
> It seems that:
>  *the first instruction doesn't increase the
> instruction count (but increases the clock cycles
> correctly)

This likes like it is because you are not display the insn count at
the same time that you increment it. See avr_core_CK_incr().

>
>  *if you are using avr-gdb, after a breakpoint the
> instruction count is increased by 2 instead of 1 (but
> the clock cycles are increased correctly)

I think this is an artifact of how the BREAK insn is used to denote a
breakpoint. When a breakpoint is set, the insn at the breakpoint is
replaced with a BREAK insn, then when code is run, the BREAK insn is
seen and the old insn is replaced and executed after the break. Thus,
the extra increment of the insn counter.

You might be able to catch this by checking the returned result of the
opi->func() call. If it is a BREAK and there is a match in the
breakpoint list, then don't increment the insn counter. If no match is
found, then you need to increment the insn counter since BREAK is a
valid insn and acts as a NOP on devices that don't handle it.

Ted Roth




reply via email to

[Prev in Thread] Current Thread [Next in Thread]