simulavr-devel
[Top][All Lists]
Advanced

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

[Simulavr-devel] Re: follow up on return from interrupt


From: Theodore A. Roth
Subject: [Simulavr-devel] Re: follow up on return from interrupt
Date: Tue, 2 Dec 2003 13:24:46 -0800 (PST)


On Tue, 2 Dec 2003, Keith Gudger wrote:

> Ted:
>
> I checked it out, and it works as advertised.  I can't say for sure that
> it doesn't break something else, but it should not.

Ok, thanks. I'll go ahead and commit it then.

>
> Do you have any ideas about my previous problem of why I get an I/O read
> before simulavr even gets attached?  Here's the output:
>
> ./simulavr -g -d atmega128
>
> Simulating a atmega128 device.
>
> MESSAGE: file decoder.c: line 3517: generating opcode lookup_table
>
> Enter 9 bits of hex data to read into the uart at address 0x002c:
>
>
> This happens before the gdb client has done "target remote :1212".  It
> only happens with the UART in I/O space - the UART1 in RAM space does not
> get its read routine called.
>
> The 'C' code that is getting called:
>
> static uint8_t uart_read( VDevice *dev, int addr )
> {
>     UART_T *uart = (UART_T *)dev;
>     UARTIntr_T *uart_t;
>     int  offset  = addr - vdev_get_base(dev);
>
>     uart_t = (UARTIntr_T *)avr_core_get_vdev_by_name(
>                              (AvrCore *)vdev_get_core((VDevice *)uart),
>                                uart->int_name );
>
>     if ( offset == UART_UDR_ADDR )
>     {
>         uart_t->usr &= ~mask_RXC ; /* clear RXC bit in USR */
>         return uart->udr_rx = uart_port_rd( addr );
>     }
> ...
>
> Any ideas as to why this gets called when the vdev gets instantiated?
> Thanks.

Nothing strikes me as obvious. I'll try to dig into it tonight (too
busy at work right now).

You might try running the sim in gdb. Set a break in the func that's
getting called early and look at the backtrace when you hit the break.
That should give you the call chain and you may see what's going on.

Ted Roth




reply via email to

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