Graphics Module
A cat and mouse game would be nothing, of course, without a visual representation of a cat and a mouse. Our FPGA had capabilities for VGA output, and as VGA timing is somewhat complex, we started out using demo code that created bars of color on the screen. We then modified that code to create first a stripe of color, then a square, then two squares, then two overlapping squares (just to make sure it would work), then a square with a stripe specified pixel-by-pixel (this time incorporating code from a previous Computer Architecture class project, Hardware Sprites), then a smiley face, and finally a cat and mouse. The graphics module positions each image using inequalities based on the image's position (which it receives, in x- and y-coordinates, as an input from the top-level module) and size, which we calculate ouselves and hard-code into the program.

In order to define the graphics with a VGA signal, we needed to set the red, green, and blue signal for each pixel. Because it would be tedious, time consuming, and error-prone to define each pixel ourselves, we used a python script that generated verilog code instead. The script takes two inputs: a picture saved as a 16-color bitmap, and either "r", "g", or "b", depending on whether you want to generate the code for the red, green, or blue signal. The script itself starts with a matrix containing a value from 0-15 for each pixel that represents the color of that pixel. This matrix is converted into a string of values from 0-7, as we were able to obtain 8 colors given the possible combinations of red, green, and blue. From here the verilog code, consisting of strings of binary values, is generated, turning on or off the red, green, or blue signal for each pixel. We can therefore put any picture that can be saved as a 16-color bitmap into our program.

Resources
http://embedded.olin.edu/xilinx_docs/
In particular, we used this demo as a starting point: http://embedded.olin.edu/xilinx_docs/projects/bitvga-s3.php
http://ca.olin.edu/2005/fpga_sprites/results.htm
http://www.epanorama.net/documents/pc/vga_timing.html
http://en.wikipedia.org/wiki/VGA