Soft_Processors
A soft processor is an FPGA implementation of a CPU, or more accurately of an Instruction Set Architecture (ISA).
A variety of ISAs have been implemented on BlackIce including OPC, Z80, 6502 and RISC-V.
The Z80 and 6502 implementations are described in the Retro Computing chapter below.
There is a family of soft processors known as Open Page Code (OPC). They implement a family of simple ISAs that can be implemented on one page of computer printout paper. The OPC6 variant is available on BlackIce but has not yet been ported to BlackIce II.
There is a professional open source ISA called Risc-V. It is well supported by gnu tool chains and can be considered as an open source alternative to the ARM family of ISAs.
This book will concentrate on the picor32 implementation of Risc-V, written by Clifford Wolf.
There are other RISC-V implementations that have been ported to BlackIce II, including icicle. Icicle uses the full 64-bit Risc-V toolchain. The newlib version is recommended.
Implementation of a soft processor
One of the simplest instructions set ever used for a computer, was the instruction set of the Manchester Baby computer. It had just six instructions:
There were just 32 words of 32-but data in the first implementation of the BABy, otherwise known as the Small Scale Experimental Machine.
Here is a BlackIce implementation of the Baby:
The 32x32bit RAM is implemented using a BRAM memory module. More information on this is in the Memory chapter.
The Baby ordered bits from least significant first. This implementation does not stick to that convention, but is otherwise a fairly accurate emulation of the Baby.
This is a disassembly of an example program. The program is loaded from the hex file lines.hex.
This program multiplies the numbers in lines 29 and 30 leaving the result in line 31 and the accumulator.
Here is a video of the led panel version of this program:
System on a chip (SoC)
A SoC is a soft processor, plus implementation of associated hardware, to produce a complete system on a chip or in our case on an FPGA chip. The hardware that is implemented as part of a SoC typically includes SPI and I2C implementations, GPIO access including LEDs, buttons, switches etc., a UART, PWM or I2S for audio output, and typically other input and output devices such as VGA monitors, LED panels, 7-segment displays, and PS/2 keyboards or mice. Access to such hardware modules is usually via a memory-mapped API.
A GNU (or other) toolchain is used to build an image file for the CPU to execute, and there needs to be some way that this can be loaded. It may be by UART, by reading from the SD card, via SPI from the STM32, or over the RPi header.
Typically, some form of configuration is required to say which hardware modules a particular instance of the SoC requires and which pins they are connected to.
Clifford Wolf produced a SoC, or more accurately, a SoC genedrator, for the icoBoard, called icoSoC. This has been modified and renamed BlackSoC to run on the BlackIce II. The next chapter describes BlackSoC.
Last updated