Under the working title "LispmFPGA" I recently completed a first
milestone on the way to an autonomous, "bare metal" Lisp on a CPU
specifically designed to execute compiled Lisp code.
The system on a chip (SoC) comprises
- a Lisp adapted, stack oriented, microprogrammed 32 bit-CPU
(given the preliminary name of E01)
- a character oriented VGA controller
- an SRAM controller
- PS/2 keyboard controller
- serial input/output controller
- some bus logic
All this is implemented with Verilog HDL on a Xilinx Spartan 3 FPGA. The
FPGA board as used now provides in addition to the above features
1MB=256Kx32bit SRAM.
On the software side, there exists
- a compiler, written in Common Lisp, which translates a subset of
Common Lisp into the machine code of the E01-processor. This subset
shall be called Lisp-E01. The compiler-code itself uses mostly only
constructs from Lisp-E01.
- an instruction level emulator of the E01-processor written in Common
Lisp.
- a simulator of the full FPGA SoC including interrupts produced by key
presses and correct reaction to writes into the VGA-memory. This is
written in C++/Qt
- a VPI driven interface providing VGA output and key-input to a Verilog
testbed model of the SoC
- a system kernel written purely in Lisp-E01 providing
- the data types
cons, string,
array (1-dim),
symbol,
32bit-fixnum,
template, closure
and a basic set of manipulation functions
- a stop and copy garbage collector
- functions for keyboard input and elementary output
- building on the kernel: A simple text-editor application written in
Lisp-E01
Additional information (and some pictures) can be found at
www.aviduratas.de/lisp/lispmfpga/
Currently there is nearly no do***entation, but if, as a result of
this announcement, someone is becoming interested in this project, maybe
wi****ng to take part in the development, I will write up the necessary
do***entation.
Actually it would be very welcome if someone could take part in the
project, as in a few weeks I will have next to nil time anymore to drive
the project further.
If you ask for possible uses of such a project, the primary answer is
probably:
- educational purposes
including educating oneself (as I did) about Lisp, compiler and
interpreter construction, FPGAs, Verilog, computer architecture,
microprocessor design,
as well as maybe sometime writing an introductory text which provides
introduction to the above topics following the course of the LispmFPGA
project.
- a lisp programming toy
Additionally, as a system like the above (even with more RAM) can be
realized for about 100$, it might become a toy for Lisp enthusiasts and
a learning tool for young people who want to own and program a computer
they can understand and control completely, as was the PET 2001 or C64
in former times.
- a microcontroller programmable in Lisp(????)
This would make a complete overhaul of the CPU necessary, to get a more
compact opcode structure. Also the compiler had to be improved in terms
of time and space efficiency of the generated code. Currently
size(obj.code) ~ 1.8 size(source code)
holds, which is probably to large for embedded applications.
Anyone who is interested in the project is invited to mail me!
Greetings
Jürgen Böhm
--
Jürgen Böhm www.aviduratas.de
"At a time when so many scholars in the world are calculating, is it not
desirable that some, who can, dream ?" R. Thom


|