FPGA GPU
I am building a GPU in Verilog on an iCE40UP5K FPGA, on an iCESugar v1.5 board. The tools are open source: yosys, nextpnr and icepack. I simulate in Icarus Verilog with Python scripts.
Built so far:
- A 16 bit ALU.
- An 8 register file with 2 read ports and 1 write port.
- A CPU fetch and decode stage.
- A shader core and framebuffer. In simulation they draw a 320 by 240 Romanian flag in 2 bit colour.
Only the pixels that changed since the last frame are recomputed. The chip has very few logic cells, so this keeps the cost down.
A dedicated accelerator computes the Life grid. The GPU displays it. Real GPUs work this way, with fixed function units next to programmable cores. VGA output is not built yet.
Evolving Game of Life
Every cell carries its own rulebook. The rulebook is 18 bits. There is one bit for each situation: the cell is dead or alive, with 0 to 8 live neighbours. Conway's rules are one value out of 262,144 possible rules.
This is artificial life on custom hardware. The circuit is fixed and the genome data evolves. It is not evolvable hardware, where the circuit itself changes.
It runs on the real chip:
- 128 by 128 cells.
- 18 bit genome per cell.
- 8% of the logic cells (465 of 5,280).
- 0 mismatches against a reference model.
- I tested the Verilog against a reference model on Conway's rules and on HighLife. Both gave 0 mismatches. On the board, a uniform Conway genome matched the simulation exactly.
- The first version held the grid in flip flops and used 61% of the logic cells. Moving the grid into memory gave four times the cells for 9%.
Next is mutation, then the statistics. I will measure two things: how much variation is left in the genomes, and whether the variation sits inside regions or between them (F_ST). I will compute it at many region sizes and compare against a shuffled baseline. There are no results yet on whether the rules converge or split.