Port-vax archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: SIMH CPU-idleing support
Matthew Mondor <mm_lists%pulsar-zone.net@localhost> wrote:
> On Thu, 18 Nov 2010 07:52:15 +0100 (CET)
> Peter Svensson <petersv%psv.nu@localhost> wrote:
>
>> SIMH detects the idle loop by detecting the number of cycles spent at a
>> specified IPL. I think. It can be adjusted (the SET IDLE NETBSD sets the
>> idle detector to wait for 1000 instructions at IPL 1 (ipl_mask=0x02)).
>
> This is also the impression that I got reading the related SIMH code.
My reading is that cpu_idle_wait (= 1000) is how many cycles to skip,
doing nothing instead of (presumably) doing a busy loop, burning host
cpu cycles.
> If SIMH can be adjusted for NetBSD-5 that'd still be great though, it's
> worth looking into.
Relevant portion of NetBSD 4 "idle" looked like this:
mtpr $1,$PR_IPL # IPL cannot be 0 because we are
# running on the interrupt stack
# and may get interrupts
1: tstl _C_LABEL(sched_whichqs) # Anything ready to run?
beql 1b # no, run the idle loop again.
but now we have idle_loop() written in C (sys/kern_idle.c), run at
spl0. It calls cpu_idle() to do cpu specific power-saving, which
native VAX doesn't have, so it's a no-op macro. Since idle loop is
not at IPL 0, not 1, simh idle loop detection heuristic doesn't work.
Instead of whacking idle loop to look again like somthing that simh
heuristic can detect, may be we can invent an "idle" instruction, that
is side-effect free on real hw, but which simh can detect and treat as
a request to sleep until next interrupt?
-uwe
Home |
Main Index |
Thread Index |
Old Index