kmod's blog

16Jul/130

Building a Processor: The Plan

One of my current projects is to build a Python compiler -- nothing to show yet, but the project is going well.  In the course of doing it, I brought up the idea of "compiling" some of the Python to an FPGA instead of to machine code (or in the case of my compiler, LLVM bitcode).  I was dismissive of the practicality of the idea since I viewed FPGAs as these arcane tools that require extensive schooling, experience, and money to use.  One of my coworkers informed me that it's actually quite reasonable to get started with them, and pointed me at a academically-motivated development board that he suggested.

So I bought it, and for the past few weeks I've been playing with it and having a great time.  There's a lot of stuff that goes into using one, and I thought it'd be fun to write a series of blog posts about what I'm doing with it.  First of all, I thought it'd be great for me to practice writing and that it'd be fun to write the posts, but secondly I haven't seen a great, results-first introduction to digital design for people who are curious about what this world looks like.  There are certainly a huge number of great resources out there, but the ones I've seen take a bottom-up approach that prioritizes technical soundness over showing you what you can do with that knowledge.  There's nothing wrong with this approach and I think it makes a lot of sense for books and university classes, but having tried the opposite strategy myself, I can say it's way more exciting to dive in and produce things that actually *do things* from the beginning, and work our way top-down to build things that enable more and more interesting functionality.

So that means that I'm not aiming to write a comprehensive introduction to electronics, digital design, processor design, or fpga usage; I've listed some resources below that provide much of the foundation that I won't be getting into.  These resources do a far better job than I could of explaining what flip flops and multiplexers are, or what the difference is between combinatorial and sequential design, and my goal is more to provide an example of how this can all be put together into something useful.

  • MIT FPGA lab on MIT OpenCourseWare -- perhaps I'm biased, but when I want to learn a subject for the first time, I usually turn to OCW to see if there's a relevant class.  6.111, or Introductory Digital Systems Laboratory, has a lot of really good material and I found it invaluable for learning about FPGAs + digital design.  In the same vein, I'm sure there are many other university courses out there that are also very good, such as CMU's 18-545.
  • Embedded Micro tutorials -- I haven't looked at these myself, but these seem like a good set of problem-oriented tutorials.

Except for the first few posts, I'm writing each post as I build the actual elements, which means:

  • I'm figuring this out as I go, and I'm not going to get things right the first time, so take what I say with a grain of salt.
  • You can follow along with exactly what I'm doing on my github.
  • I'll be editing the posts pretty frequently as I learn more, and I won't necessarily list the edits that I make.

 

Right now my goal is to build a simple processor (perhaps better called a SoC, but I just refer to it as a processor), both to learn what's involved, and to give me a base to use to get the peripherals working.  After having a basic system, I'm thinking about building a rudimentary "graphics card" using the USB+VGA ports, and then attempt to build a Python coprocessor, ie a specially-designed chip that can execute Python code.

Without further ado, here is the list of posts, either written or planned:

So first up: getting started.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.