Speccery / icy99

TI-99/4A FPGA implementation for the Icestorm toolchain
15 stars 5 forks source link

icy99

TI-99/4A FPGA implementation for the Icestorm toolchain. Primary target board currently the ULX3S FPGA board. Tested with the version 3.0.3 of the board with the ECP5 85F FPGA chip.

2023-11-28 Updated for new toolchain

Wow it has been a long time. I had received reports that the code no longer works with new versions of the oss-cad-suite toolchain. No wonder, as I haven't worked on the project for way too long. The project now works with the 2023-11-18 release which I used during debugging.

After several evenings of debugging, it now works with ULX3S. I had to disable SDRAM, since the primitive IFS1P3BX is no longer there and not recognized by nextpnr-ecp5 anymore. I need to check what replaced it to get the SDRAM interface working again.

In addition to disabling SDRAM, to simplify debugging, I disabled TIPI support too. That probably was the culprit for non-SDRAM not working anymore, since the db_in selection mux no longer worked properly, as the signal tipi_ioreg_en was constantly low and disabled access to ROM or RAM. In the debugging process I extended the tracebuffer from 36 to 72 bits wide, and that enabled me to see what was wrong and fix it.

Only tested with ULX3S 85F. The current version uses a lot of block RAMs on the ULX3S since SDRAM is not used. I have not tried the BlackIce II version in long time either.

2020-11-27 TIPI support added

The pin mapping currently between ULX3S and TIPI is (refer to top_ulx3s.v):

TIPI ULX3S comment
GPIO_6 GP20
GPIO_13 GP21
GPIO_19 GP22
GPIO_16 GP23
GPIO_21 GP24
GPIO_20 GP26 (output from ULX3S, DIN)
GPIO_26 GP25 (output from ULX3S, RESET)

2020-11-20 Audio and LCD support

2020-10-27 Sprite fixes etc (tested only on ULX3S)

2020-10-16 ULX3S Supports loading with ESP32

2020-10-15 SDRAM support and 80 column output

2020-07-14 A couple of changes

Tested these changes with ULX3S and Blackice-II boards.

Initial commit 2020-06-15

I will add documentation once I have a bit more time. The software stucture is a bit of a mess. I am moving the files into this github repository from my own repository, please let me know if some files are missing.

The system here is a verilog port from my existing EP994A VHDL version of the TI-99/4A. The main difference between this version is that a unified memory architecture (UMA) model is supported, allowing this core to run even on the Blackice-II board, with the modest ICE40HX4K FPGA. This FPGA does not have enough block RAM to support the video system memory on-chip. Thus, thanks to UMA, the external 256K x 16bit memory is used for both CPU RAM, ROM, GROM and VDP RAM memories.

The archictecture runs at 25MHz, the performance is around 7x of the original TI-99/4A. My initial goal with the EP994 was to build a very fast TI-99/4A implementation. Due to this the core has never been cycle accurate. I may accurate this later.

The repository does not include ROM files. The necessary ROM files are:

create-mem-from-bin.py is a Python 3 program which will generate Verilog memory initialization files from binary files.

The design targets the following FPGA boards: Board top module make target
ULX3S top_ulx3s.v ti994a_ulx3s.bit
Blackice-II top_blackice2.v next9900.bin
Flea Ohm top_flea.v flea_ohm.bit

Thus, for example to build the version for flea_ohm board:

make flea_ohm.bit

The ULX3S and Flea Ohm versions of this system embed the TI-99/4A ROMS as FGPA block RAMs. For the BlackIce-II board this is not possible, as the internal block RAM capacity is too small. For that system (and also the others) the ROMs can be initilized with the MEMLOADER program. This is a Windows program enabling the memories to be initialized over a serial port. I believe I have documented some of this in the EP994A. I will add the memloader source code to this repository later as well.

I have used a mixed computer setup for development: a windows box running Windows Subsystem for Linux as the main development environment to run Icestorm (yosys, nextpnr), a Mac for some of the development with the same toolchain. Windows is required currently to run MEMLOADER.