Game of Life on the FPGA

For my first post I will talk about the end project of my previous module. I'm studying Computer Sciences at the University of Twente, and our previous module was Computer Systems. Formally speaking we worked on it for about 6 weeks with a group of 4 students. However, informally speaking we mostly spent the last 2 weeks on it. Things weren't really clear enough to actually make something earlier.

The group consisted of 2 Computer Science (me and Olaf) and 2 Electrical engineering students (Hans and Tim). The only requirement of the project was to let the Raspberry Pi and DE1-SoC perform some sort of task together. We chose to implement the Game of Life. The general idea was to let the DE1-SoC's FPGA do the heavy lifting (calculating the generations) and let the Pi worry about visualization of the Game of Life and controlling the FPGA.

Check out a video of it working in the browser here:

The actual Pi and FPGA are not visible (altough maybe on the left side you can spot them once or twice) but most of the work doesn't happen on the laptop. What happens is that you first send an initial field from the browser to the Pi, which in turn sends it to the FPGA. The FPGA then starts generating generations based on that initial field. The Pi hosts a webserver which the webpage can query to receive new generations. Communication between browser and Pi consists of HTTP Get requests. Communication between the FPGA en the Pi is done over the Pi's GPIO pins.

It's kinda funny because the FPGA can calculate the next Game of Life generation in just a few clock cycles, but sending it to the Pi takes so much longer. We actually had to make an artificial clock signal of 10 kHz because otherwise the Pi would freeze due to all the interrupts (note: the FPGA has four 50 MHz cores!). I think in the end we managed to get a generations per second of about 3, with a field of 60 by 60 cells. This is kind of disappointing but writing (and implementing!) our own protocol in Linux userland over GPIO turned out to be harder than expected.

All in all it turned out to be a fun project with a neat end result.

P.s.: Please don't mind my voice at the end. Brrr.


Comments powered by Disqus