Scott Rogowski
smr2167
Embedded Systems
Spring 2011
Lab 3

So, despite this lab taking a solid 24 hours, there doesn't seem to be much to say.  Everything works perfectly, first off.  Next, I suppose that everything can be summed up by two files that really do anything.  The rest, as far as I remember, are just wrappers and top levels.

de2_vga_raster.vhd: 
The VGA controller. This file, other than the provided VGA_ ports, also contains a standard Avalon slave read/write/chipselect/etc. interface.  First off, the clock rate for most of the fuctions in this file is halved to 25MHz.  When the CPU writes to the VGA controller, the top bit of the writedata bus is chopped off and used to specify horizontal (0) or vertical (1).  Then, the rest of the bus is used to specify the magnitude of the horizontal or vertical postion.  The actual pixels of the circle are calculated in a process, a little while later, called CircleGen.  At every clock tick (and therefore every pixel) the absolute pythagorean distance between that pixel and the current center is calculated.  If this is less than the circle radius, this point is inside the circleand white will be drawn.

hello_world.c:
Yea, I didn't change the name.  The whole thing is implemented in a few dozen lines of code including the preprocessor, comments, and debugging prints.  Basically, two counters, i and j, for horizontal and vertical, are used.  Initially, both increment.  When one counter hits the end of the screen, that counter decrements.  Every increment or decrement, the position is written via IOWR_16DIRECT(VGA_BASE, 0, i or j) where j (vertical) gets a 1 in its most significant spot. Then, the processor sleeps for a few thousand microseconds.

All in all, this is probably the longest it has ever taken me to write about 100 lines of code.
