This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH, FT32] gdb and sim support


> > +/*
> > + * FT32 is a Harvard architecture: RAM and code occupy
> > + * different address spaces.
> > + *
> > + * sim and gdb model FT32 memory by adding 0x800000 to RAM
> > + * addresses. This means that sim/gdb can treat all addresses
> > + * similarly.
> > + *
> > + * The address space looks like:
> > + *
> > + *    00000   start of code memory
> > + *    3ffff   end of code memory
> > + *   800000   start of RAM
> > + *   80ffff   end of RAM
> > + */
>
> do they actually occupy different address spaces ?  that is to say, if you put
> address 0 into a register and try to do a data load/store, does it throw an
> exception ?  or is it transparently routed to 800000 ?

At the hardware level, there are two things that have address 0: a piece
of RAM and an instruction. The CPU uses different instructions to
read RAM and instruction memory.

> Blackfin cpus are described as Harvard because it has on-chip memory that can
> only be accessed either as insn or as data, but it's a unified memory map.  for
> example, if you were to execute (jump to) 0xffa00000, it'd work, but if you
> tried to do a load/store with 0xffa00000, the hardware would throw an exception.
> if you were to execute (jump to) 0xff800000, the hardware would throw an
> exception, but you could do a load/store just fine.

FT32 is closer to the AVR. Both memory spaces start at address zero.

> i'm not sure gdb or the sim generally support processors with overlapping
> memory.  i.e. a $pc of 0 is completely different from a $r0 (data register) with
> the address of 0.

I believe that offsetting RAM at 800000 is the same way the AVR gdb port works.

The FT32 gdb uses the same approach. We generate a link map that declares 
the RAM at address 800000. Then GDB can use a single pointer to represent
either an instruction or a RAM address.  FT32's gdb interface understands
that bit 23 of an address distinguishes betweeen instruction and RAM.

This all seems to work quite well, and of course following the same 
model in the simulator has made the gdb-sim interface quite straightforward.

> i tried to grab some datasheets from ftdichip.com, but (1) couldn't seem to find
> anything on the architecture (just datasheets for specific parts which covered
> more system devices than the ISA/core) and (2) it's crazy slow to download from.

I will mention this to the people at FTDI. The FT900 (which contains
the FT32 is still new).

--
James Bowman
FTDI Open Source Liaison


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]