X32: Free 32 bit FPGA Softcore
The X32 is an experimental 32-bit soft processor core and
associated compiler tool chain for low-cost FPGAs
(such as the 400K gates Xilinx XC3S400).
The core includes an array of peripheral devices such as
UARTs, PWM generators, timers, etc. providing a
flexible, reconfigurable microcontroller architecture.
The primary motivation for the X32 is the need for
a free and simplesoft core that allows students
to program FPGAs in embedded (ANSI) C in some of our course labs.
Rather than use an existing processor architecture,
our independence of legacy issues allows us to
rethink the entire C-to-FPGA concept.
Instead of using a legacy core with some 90's or even
80's instruction set architecture, and retargeting
an ANSI C compiler to this legacy ISA, we develop the core
completely top-down by
choosing an ISA that is at the same high level
as the intermediate RTL level within the compiler,
with the core simply being a hardware
interpreter of this ISA written in an HDL.
Although clearly a performance price is to
be paid, both the compiler backend
and soft core development effort can be kept at a minimum.
In fact, the entire soft core and the compiler
(including assembler, linker) has been
realized within 5 months in terms of merely one MS project
(built by
Sijmen Woutersen).
The approach is based on the LCC ANSI C compiler's intermediate
byte code which is executed by the X32, which essentially constitutes
a byte code interpreter written in VHDL.
The X32 is currently configured for use on a Xilinx Spartan-3
Starter Board
(fitted with a 400k gates XC3S400 FPGA from Digilent Inc. USA)
and comes with an array of devices such as button/switch/LED/SSD interfaces,
UARTs (RS232), PWM generators, timers, clocks, I/O extension interfaces,
pulse width readers, and application-specific devices such as
a decoder compatible with Maxon DC motors to build servo systems.
The tool chain consists of the usual tools
- C compiler (the cross compiler based on LCC)
- Simulator (runs compiled code on host machine)
- Run-time system (libs + loader on FPGA to upload and run)
- Real-time OS (currently we have ported uC/OS-II to X32)
- Debugger (runs code on FPGA under supervision by host machine)
The X32 is currently used in the following three TU Delft projects
- the model helicopter embedded control application that we
use in one of our labs (TU Delft course
in4073)
- the DC electrical motor/encoder control application that
we use in another lab (TU Delft course
in2305-ii)
- a robot control demo application at Delft Center for Systems Control (DCSC)
Publications
- Sijmen Woutersen, "X32 Design (MSc Thesis)", Nov 2006
pdf download
- Sijmen Woutersen, "X32 Programmer's Manual", Nov 2006
pdf download
- Mark Dufour, "Running uC/OS on the X32",
pdf download
- Mark Dufour, "X32 Source-level Debugger",
pdf download
- Sijmen Woutersen, "Building a C Processor",
Research Assignment Report, Dec. 2005.
pdf download
People
- Mark Dufour (Teaching Assistent): Real-Time OS, lab applications,
debugger, miscellaneous
- Arjan J.C. van Gemund (Professor): project leader
- Tom Janssen (MS student): heli controller design (PIC + FPGA/X32/uCOS)
- Sijmen Woutersen (MS student): X32 softcore, C compiler,
simulator
Software Downloads
NOTE: All X32-related software is free software;
you can redistribute it and/or modify it
under terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version. Our software is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Note: refer to the
X32 Programmer's Manual
for installation instructions.
- X32 C tools (Jan 25, 2007)
(x32-tools.tgz, contains ANSI C compiler,
assembler, linker, libs, and various upload/debugging utilities,
must always be installed first)
- X32 source (Jan 25, 2007)
(x32.tgz, contains VHDL sources
to configure/compile your own X32 setup, i.e., X32 CPU + various peripherals,
in order to compile the X32 you need Xilinx ISE Webpack 8.3 or higher,
plus you need to install the X32 C tools first, since the X32 bootloader
is written in C and needs to be compiled to VHDL first
using the above X32 tool chain)
- X32 binaries (Jan 25, 2007)
(x32-binaries.tgz,
contains X32 bit files and libs for the X32 configuration as used
in the TU Delft courses in2305 and in4073,
meant for students that don't want
to compile the X32 themselves; just flash the bitfile in your
FPGA and it turns into the X32 microcontroller, either
configured for the in2305 course, or the in4073 course)
- (patch file for uC/OS port to the X32, to be made available)
(in2305 students have the uC/OS source code as part of their text book,
for the source code of uC/OS please refer
to the uC/OS web site)
-
X32 example programs
(x32_projects.tgz,
contains simple progs, progs with interrupts, progs that also use uC/OS)
Important Feedback
Apart from Delft students, other people have shown interest.
In particular, the following
feedback received from the
University of Dortmund points out
some minor problems that one may encounter using our makefiles
on other platforms.
X32 Version History
| Release date |
Changes |
| Jan 25, 2007 |
BUGFIX: Interpreter memory protection removed which caused ucos to crash |
|
BUGFIX: RS232 bautrate generator fix for lower bautrates |
|
FEATURE: Modified X32 loader software for X32 debugger |
|
FEATURE: Compiler warning on using functions without prototypes |
| Dec 13, 2006 |
WARNING: binary compatibility with older versions is broken in this release, please recompile all software! |
|
BUGFIX: several small fixes in the linker and interpreter applications |
|
FEATURE: several small X32 code/performance improvements |
|
FEATURE: overflow detection for 8/16-bit arithmetic operations added |
| Oct 25, 2006 |
BUGFIX: multiplier would sometimes falsely detect overflow |
| Sept 1, 2006 |
Initial release |