[Oberon] Boot procedure FPGA Oberon
paulreed at paddedcell.com
Thu Jan 23 16:10:08 CET 2014
Dear Herr Greim,
> I have just seen that Ni[k]laus Wirth has totally revi[s]ed some chapters
> of the documentation (my browser cache has cheated me).
> Also the boot procedure is now different, its now using the RS-232
> The Verilog files on his web site seems to be still the old ones. B[u]t I
> will watch the web site, waiting for further news...
As the book says, the RS232 interface was used extensively by Prof. Wirth
as the system was developed.
The bootloader for the Oberon system will vary, depend on what hardware is
actually attached. It is compiled using the "RISC0" mode of the compiler,
triggered by an asterisk after the keyword MODULE, which generates a
single self-contained instruction stream for inclusion directly in the
The ../prom.mem file, intended to be placed in the project directory
itself (the source files are by convention placed in a subdirectory src/
of the project directory, hence the path prefix) is a text file which
simply contains the opcodes generated by the compiler, in hex, 8 digits,
one opcode per line. The "initial $readmemh" reads these opcodes into the
mem array as the hardware is being synthesised.
If you want to have fun and explore the RISC without attaching any
external hardware (this is how I have introduced the RISC to the students
at ETH in the System Construction course), you may find it easier first to
build the Oberon-0 compiler from Prof. Wirth's Compiler Construction
section of his home page.
Indeed, the first few programs I wrote for the RISC computer, to test the
peripheral hardware I was designing (like the display), were in Oberon-0;
and the first bootloader was Oberon-0 too; we only later switched to using
the full Oberon compiler with its "RISC0" mode.
For example, the following Oberon-0 program will sequence the LEDs on the
ledAdr = -60;
x, y, z: INTEGER;
BEGIN z := 0;
PUT(ledAdr, z); x := 1000;
REPEAT y := 1000;
REPEAT y := y-1 UNTIL y = 0;
x := x-1
UNTIL x = 0;
z := z+1
The Oberon-0 compiler will compile the above to produce something like the
below, which you can put into your prom.mem file (which must be
zero-filled to the size of the array):
More information about the Oberon