UC Berkeley CS150

Checkpoint 4: Frame Buffer & Line Engine

Introduction

Please Note: This checkpoint is now extra credit. You may only receive extra credit for completing it once you have done all of the other checkpoints.

For this checkpoint you will be implementing a frame buffer and some simple graphics acceleration in the form of a line drawing engine.

The skeleton files for this checkpoint can be found in the extracredit branch of the skeleton repository.

DVI

The DVI module wraps up all of the low level details of producing video and provides a simple ready/valid interface for passing a 24-bit pixel (8 bits for each of red green and blue) at a time to the video hardware. Pixels must be supplied the cycle the DVI module is ready for them or there may be video errors. The module has been instantiatied for you in the skeleton and should be fairly self-explanatory.

Frame Buffer

In order to actually have pixels to supply to the DVI module you need to implement a frame buffer. The only place you will have enough memory to do this is in the DRAM. You will need to designate a range of DRAM addresses to reserve for the frame buffer. There are a variety of memory layouts you could choose for the frame buffer, but we recommend using one word per pixel (wasting 8 bits) and storing pixels in row-major order. The latency for doing a DRAM read is too long to read pixels out one at a time, so you will need a way to buffer pixel data coming out of the DRAM going in to the DVI module (probably with a FIFO). Finally, you need to make sure you have a way for the CPU to bypass the data cache when doing write to the frame buffer or you will get artificats.

Line Engine

Your line engine should implement Bresenham's line drawing algorithm. The CPU will provide coordinates for the end points of the line and a color to draw the line in. The memory-map interface for the line engine is shown below.

Name Address Direction Description
LEControl 0x80000030 Read 1 if the line engine is ready to draw a new line, 0 otherwise.
LEColor 0x80000034 Write The color of the line.
LEX1 0x80000040 Write X coordinate of the first end point.
LEY1 0x80000044 Write Y coordinate of the first end point.
LEX2 0x80000048 Write X coordinate of the second end point.
LEY2 0x8000004c Write Y coordinate of the second end point.
LEX1Trigger 0x80000050 Write Triggering version of LEX1.
LEY1Trigger 0x80000054 Write Triggering version of LEY1.
LEX2Trigger 0x80000058 Write Triggering version of LEX2.
LEY2Trigger 0x8000005c Write Triggering version of LEY2.

Most of these should be fairly self explanatory. The triggering versions of the coordinate ports both update the coordinate and cause the line engine to begin drawing a new line.

Checkoff

You will need to be able to demonstrate that your design is capable of doign hardware accelerated line drawing. A simple demo is sufficient, but feel free to get creative!