Thanks to some remarkably fast work by our colleagues over on the anycpu forum (Dave, Ed and Richard) - we now have a port of their OPC6 cpu running on the BlackIce board.
We now have a soft cpu running on BlackIce, clocked at 25MHz that can execute code and run real programs.
There is a monitor program preloaded into RAM, and also a program to calculate Pi to a few digits.
This now gives us a repertoire of soft processors and machines that may be implemented on the BlackIce board. Elsewhere in this forum you will find Acorn Atom (6502 + BASIC) BBC Model B (6502 + BASIC), Jupiter Ace (Z80 with FORTH), Generic CP/M (Z80 with Microsoft BASIC).
The OPC6 offers an alternative to the vintage EDSAC processor that some forum members have been working on - and got running a couple of weeks ago.
There is also James Bowman's J1a Forth processor that has been ported to BlackIce.
With just a serial terminal we have interaction with another soft processor now a fairly comprehensive, but hardware efficient 16-bit register based machine.
The resources used in the ICE40 HX4K FPGA were as follows
IOs 50 / 107
GBs 0 / 8
GB_IOs 0 / 8
LCs 822 / 7680 (about 10.7%)
CARRY, DFF 0
DFF PASS 69
CARRY PASS 5
BRAMs 18 / 32
WARMBOOTs 0 / 1
PLLs 0 / 2
PIOs 39 / 107
PLBs 179 / 960
BRAMs 18 / 32
And the timing estimate: 24.38 ns (41.02 MHz)
Not only have the guys got it working - but Dave (Hoglet) has done some exceptional detective work on some aspects of our platform that were causing some trouble - highlighting a conflict between out PLL pins and a couple used for the external RAM databus. In addition - he has found the root cause of the issues that we were having with the dfu-util when trying to update firmware - Cheers Dave!
Note that you will need to upgrade the BlackIce firmware to version 0.3 - as it uses the CH340 UART-USB connection - direct to the FPGA - and needs the STM32 uart lines set both as input pins.
OPC6 is a fairly compact cpu - and this is the first time that it has been tried on a Lattice ICE 40 (previously Xilinx FPGA & CPLD).
It is described on the project pages here https://revaldinho.github.io/opc/ - and OPC6 is the sixth major evolution of the processor. It feature 16 registers, one of which is the PC - and a 3 bit instruction predicate, allowing conditional execution of all alu operations.
Here are some notes from Dave about the cpu implementation
The verilog is in my fork of the OPC github project:
The latest .pcf file is here:
Attached is the latest system.bin file (the bitstream file for the FPGA). - ( I have put this in my github repository https://github.com/monsonite/BackIce_FPGA - if anyone just want's to just load it up and play)
This uses the USB UART, so need to be used with IceBoot 0.3. Using with a earlier IceBoot may result is smoke!
You should be able to build this yourself (assuming you have a Linux machine with IceStorm tools installed):
- git clone -b blackice https://github.com/hoglet67/opc.git
- cd opc/system/blackice/opc6
- make clobber build
There is a simple Pi program included at address 0200.
To execute this, you type 0200g
We'd be happy to write any other hello world program you choose. We could also map some of the LEDs into I/O space so they could be flashed from a hello world program. Would that be of use?
The monitor is quite minimal, and not very user friendly.
The commands are:
- x - hex dump from address
- z - disassemble from address
- @ - set the current address
- s - single step instructions from current address
- , - write to the current address, which is auto incremented
# - toggle local echo
- r - register dump
- l - srecord loader (you can cut and paste srecords to load a new program)
,, are 16-bit hex values