Development tools for the TMS340x0

Texas Instruments' TMS34010 and its successor, the TMS34020 are 32-bit CISC microprocessors which contain a specialised on-board RISC machine for performing graphics operations.  TI call them "Graphics System Processors".

An interesting feature of the GSP architecture is that it is bit-addressable.  That is, a 32 bit address refers to a particular bit in memory.  This give the GSP a 512 mbyte address space. Apart from a few oddball opcodes which implicitly access eight bits, all memory access instructions also reference one of the GSP's two field size registers.  The contents af a five-bit FSR specifies the number of bits which are to be accessed by this instruction.

As the 34010 has a 16-bit external bus, a 32-bit read could require as many as three memory reads.  A single-cycle on-board barrel shifter is used to align all these operations.

The compilers assume that FS0 is always set to 5  and that FS1 is set to 4.  These are used for 32-bit and 16-bit accesses, respectively.

In practice, I found that these features weren't very useful.

GCC/G++ v2.5.8 for the TMS34010  (download)

A port of GCC to the TMS34010.  This may be useful for one of two reasons:
 
  1. Developing TMS340x0 software (unlikely) or
  2. Porting GCC to another bit-addressable architecture.
GCC is simpy not set up to cope with architectures where the fundamental unit of storage is not an eight-bit byte.  Basically, wherever anything is to be added to a pointer, the addend must be multiplied by eight.  GCC assumes that the following is true in many places, even up at the lexical parser level:
char *ptr;
int i;
(int)(ptr + i) == ((int)ptr + i);
whereas for the GSP the expression would be:
(int)(ptr + i) == ((int)ptr + i * 8);


If you are porting a modern GCC to an architecture which has a peculiar basic unit size then download the above tarball and grep for the strings "AKPM", "34010" and "GSP".  These will identify the places where I changed the compiler.  Identify the corresponding locations within your current compiler and apply the appropriate changes.
 

This compiler also has a new keyword: interrupt:

void interrupt my_isr(void)
{
    do_things();
}

The interrupt keyword causes the function to save all machine state, so a machine vector can point straight at it.  The implementation is horrid - don't go there.
 

TMS34010 binary utilities (download)

This download includes an assembler, a linker, strip, nm, disassembler, binary downloader, pc-to-linenumber converter, size and a couple of font utilities.

It also happens to include a 34010 realtime kernel and an almost-complete video game.

Unfortunately I have permanently misplaced the actual compiler driver (the program which execs the preprocessor, compiler, linker, etc).  This should be pretty easy to replace with some gcc spec writing, a shell script or simply some makefile wizardry.
 

TMS34010 Emulator

MAME is an emulator for the TMS34010. It runs on PCs.  It lives at  http://www.mame.net/download.html
 


AKPM Home

Andrew Morton, 14 October 2000