simulavr-devel
[Top][All Lists]
Advanced

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

Re: [Simulavr-devel] anacomp getting reserved access messages


From: Joerg Wunsch
Subject: Re: [Simulavr-devel] anacomp getting reserved access messages
Date: Thu, 26 Mar 2009 21:15:25 +0100
User-agent: Mutt/1.5.11

As Joel Sherrill wrote:

> 0x3d - 0x3e should allow writes but a read does not
> have to return the value previously written?

0x3d is SPL, and is always implemented, accept on devices with a
hardware stack which we can ignore as they are all obsolete now (like
the venerable AT90S1200, but there have also been a couple of early
ATtiny devices).  They cannot be handled by the compiler frontend
either (only assembler and linker).

0x3e SPH, and is only implemented on devices that can address SRAM
beyond 0xFF.  As the classic AVR core maps the CPU registers into SRAM
addresses 0 through 0x1f, and IO registers to 0x20 through at least
0x5f, this only applies to AVRs with 128 (or less) bytes of SRAM.

> Or is it acceptable to mirror back the value written.

As SPH is a reserved register on those devices, anything is
acceptable: return 0, or just behave as a real register, and mirror
the value back.  Actually, the compiler-generated code will never have
a reason to modify anything on its value on those devices, so it will
always write back the value read before (probably 0).

> And this should be the behaviour on all current models
> supported:
> 
>  at90s4433
>  at90s8515
>  atmega48
>  atmega128

Out of those, only the AT90S4433 features SRAM addresses that cannot
exceed 0xFF, so it doesn't implement SPH.  The other three AVRs do
implement a real SPH register which is also to be taken into account
when accessing the stack.

> >(I
> >know VMlab always complains about it, it can be a little annoying.)

> I don't like warnings or hints of errors.

Technically, it's GCC which is on error here, but the error has proven
to be benign for 10 years now.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

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