Study on embedded CPUs to be used in the WR node

Attached at the bottom of this page is a summary of available open source CPUs. For comparison, the NIOS commercial CPU is also included. An even longer list obtained from http://silicone.homelinux.org/category/electronics/open-source-cpu/ is also attached.

In my (Wesley's) opinion, there are really only four candidates:
  • LEON3 -- from ESA (used in their spacecraft)
  • latticemico32 -- from Lattice (FPGA manufacturer)
  • openrisc -- the open hardware "flagship" CPU
  • ZPU -- a pet research/teaching project
The other options can quickly be eliminated based on one of:
  1. incomplete project
  2. dead developer community
  3. incomplete development environment
    1. inability to attach to running CPU
    2. inability to debug running programs
    3. missing instruction simulator (ie: no verification)
For a ball-park comparison of their sizes with features toggled off (x depends on the FPGA):
  • openrisc and leon3 -- 3x size
  • latticemico32 -- 2x size
  • ZPU -- 1x size

I would further eliminate the openrisc as it has comparable complexity to the LEON3, but is less mature.

Both LEON3 and latticemico32 are heavily tested and deployed in production systems.

Summary of experience working with the "big three":

LEON3

The LEON3 comes as part of a IP core library called grlib. grlib is based around the AMBA bus and includes several useful peripherals that can be attached:
  • SD/DDR/DDR2-RAM controllers
  • SRAM and flash controller
  • JTAG bus master (can disassemble, inspect, and modify memory via the bus)
  • UART, ethernet, VGA, IDE device drivers + controllers
The development environment is very easy to work with:
  • grmon (must be bought) can attach via JTAG to the AMBA bus to pause the CPU to:
    • inspect registers
    • inspect memory
    • inspect instruction trace history
    • set hardware-assisted break-points and traps
    • disassemble memory
    • trace the UART output
      • The usefulness of this particular feature can not be overstated!
      • It lets you watch linux boot messages and login to the running system
      • With no operating system, it captures 'printf' statements from the running program
  • gdb supports the CPU
    • it can attach via grmon+JTAG to debug the operating system or single-program software (if no operating system)
    • it can be run inside linux on the softcore to debug 'user-space' applications
  • it comes with a gcc toolchain targetting RTEMS
    • building a single-program (no OS) is very easy
    • RTEMS drivers for UART/etc are already included
    • it can be remotely debugged via grmon+JTAG
    • hello world is approximately 92kB
      • this includes device drivers/etc
  • it comes with a buildroot setup for compiling a linux kerenl + userspace
    • gcc toolchain for this target comes from buildroot

Latticemico23

I have not yet moved beyond synthesizing it for complexity/speed comparison.

ZPU

I have not yet moved beyond synthesizing it for complexity/speed comparison.

softcores.ods - Open Office summary of Soft CPUs (17.4 kB) Wesley W. Terpstra, 2010-12-15 10:15

softcores.xls - Microsoft Excel summary of Soft CPUs (102 kB) Wesley W. Terpstra, 2010-12-15 10:15

OpenCpuStudySummary.ods (26.8 kB) Wesley W. Terpstra, 2010-12-20 14:31

OpenCpuStudySummary.xls (145 kB) Wesley W. Terpstra, 2010-12-20 14:31