Electronic – Where to start when considering making a GPU

gpu

I saw this video the other day and it got me thinking about how to go about and design something like the GPU. Where would you begin? I'm more just interested in reading about how they work and not making one out of TTL(yet anyway).

I know this sounds like a 'how do you make a programming language' question but any starting points would be good as I have no idea where to start looking.

Best Answer

That's kinda like going to your collage final exam for science class and having this as your question: Describe the universe. Be brief, yet concise. There is no way possible to answer that one in any practical way-- so I'll answer a different question.

What are the kinds of things I need to know before attempting to design a GPU?

In a rough chronological order, they are:

  1. Either VHDL or Verilog.
  2. FPGA's (useful area to play with writing digital logic).
  3. Basic data-path stuff, like FIFO's.
  4. Bus interfaces, like PCIe and DDR2/3 interfacing
  5. Binary implementations of math functions, including floating point, etc.
  6. CPU design.
  7. Video interfacing standards.
  8. High speed analog stuff (the analog side of high speed digital)
  9. PLL's and other semi-advanced clocking stuff.
  10. PCB design of high speed circuits.
  11. Low voltage, high current DC/DC converter design.
  12. Lots and lots of software stuff.
  13. And finally, ASIC or other custom chip type design.

I will also dare say that you won't be making this kind of thing out of TTL logic chips. I doubt that you could get a reasonable DDR2/3 memory interface working with normal TTL chips. Using a big FPGA would be much easier (but not easy).

Going up to step 6 will probably be "good enough to quench your intellectual thirst". That could also be done within a reasonable amount of time-- about a year-- to set as a short-ish term goal.

EDIT: If all you want to do is spit out a video signal then it's relatively easy. It is, in essence, a chunk of memory that is shifted out to a display at 60-ish Hz. The devil's in the details, but here's a rough outline of how to do this:

Start with some dual port RAM. It doesn't have to be true dual port ram, just some RAM that a CPU can read/write and that your video circuit can read. The size and speed of this RAM will depend on what kind of display you're driving. I personally would use DDR2 SDRAM connected up to the memory interface of a Xilinx Spartan-6 FPGA. Their "memory interface generator" core (MIG) makes it easy to turn this into a dual-port RAM.

Next, design a circuit that will control how this RAM is read and spit this data out a simple bus. Normally you just read the RAM sequentially. The "simple bus" really is just that. It's some bits with the pixel value on it-- and that's it. This circuit will need to do two more things: it will have to go back to the beginning of RAM every video frame and it will have to "pause" the output during the horizontal/vertical retrace periods.

Thirdly: make a circuit that will output the video control signals (HSync, Vsync, etc.) as well as tell the previous circuit when to pause and restart. These circuits are actually fairly easy to do. Finding the appropriate video standard is harder, imho.

And Finally: Connect the control signals and video pixel data bus to "something". That could be a small color LCD. It could be to a video DAC for outputting a VGA compatible signal. There are NTSC/PAL encoders that would take these signals. Etc.

If the resolution is really small you might get away with using the internal RAM of the FPGA instead of an external DDR2 SDRAM. I should warn you that if DDR2 SDRAM is used then you'll probably require a FIFO and some other stuff-- but that too isn't terribly difficult. But with DDR2 SDRAM you can support fairly high resolution displays. You can also find FPGA development boards with integrated VGA DAC's and other forms of video outputs.