So you wanna learn FPGAs…

FPGAs are the bee’s knees. Instead of programming a chip by telling it what to do, FPGAs allow you to tell a chip what to be. Like everything though, a new skill set is needed to fully exploit the power of FPGAs. [Mike Field] decided to give back to the internet community at large and put up a crash course in FPGA design.

Right now, [Mike] has a couple of modules up that include subjects like binary math, busses, counting, and of course setting up the FPGA hardware. The recommended hardware is the Papilio One, although the Digilent Nexys2 is what [Mike] has been using so far.

We’ve seen a ton of awesome stuff that uses FPGAs, like the emulated Mac Plus, breaking HDCP, and an Ocarina of Time. [Mike]‘s tutorials look like a great starting point for some FPGA work. [Mike] is also looking for some feedback on his tutorials, so if you’ve got an idea of what he should cover be sure to drop him a line.

EDIT: The server was running on an FPGA and we can’t find a cache anywhere. If you’ve found a mirror, send a message. Apparently Amazon’s EC2 runs on an FPGA.

Comments

  1. Alex Rossie says:

    Wish I had something like this when I started out. I used books, found some great ones along the way.
    Here’s my top 3 :)

    Contemporary Logic Design Randy H. Katz

    Digital Logic Design Principles

    Computer Organisation & Design Patterson and Hennesy

    But the BEST way to grind FPGA is to combine “Contemporary Logic Design” with the TI TTL logic book which you can get form the TI store for 10cents (including shipping) means you have plenty of circuits to implement both gate level and behvaiourally…

  2. samuirai says:

    Awesome!
    I’m a software guy but started with FPGAs a few months ago. It’s so difficult to learn everything from google and with no tutorials. I wish I had this earlier, but I will read all your Modules :D Please keep motivated to create more Modules.
    I have a Nexys3 Board :)
    Thank you very much, keep going

  3. Sheldon says:

    Having a read on the opening page:
    “I’ll see if I can get a mention on Hack-a-day and get some feedback”
    tick :-)

    My two-pence worth of feedback woud have been to show people Verilog rather than VHDL. Yes, can be more fast-and-loose with verilog but it reads more like a software language (System Verilog is even closer but, from my experience in the industry, not as widely supported for synthesis). I was taught VHDL at uni over 6months but picked up more than enough verilog in a few days myself to now use it professionally, plus it’s what a large chunk of the design IP is sold in.

    Either way, from the few tutorials I looked at (I think the site is being HaDed), [Mike] should keep up the good work. The more people dabbling in this area the better, we need more practiced engineers!

  4. N0LKK says:

    While I would only be a consumer of the tutorial, and highly unlikely I would ever use FPGA, my initial thought was I hope Mike created a wiki. Then enough his wiki came up in the other browser tab to show is was a wiki. The text that the browser shows the link urls is so small I missed it was a wiki. Can only wish that the wiki isn’t available to view, is that there are many people fleshing out the content of it. Hopefully enough of them are good technical writers to make it an easier study.

  5. raged says:

    looks like the site runs on a FPGA :)

  6. NatureTM says:

    I chose to learn Verilog over VHDL as I was told it would likely be the most widely used HDL in the future. For now, it seems most example projects I see are still written in VHDL. I hope I made the right choice!

  7. Matthew Wiebe says:

    Site still down as of 5:45pm PST on Dec 30.

  8. Mike Field says:

    Thanks all for the support & kind words.

    Please email through any edits or qns, and yes, I’ve kicked my poor little $0.01 Amazon EC2 instance around a bit to get MySQL back up and running.

    I guess you get what you pay for! :-)

  9. BobC says:

    I’d like to recommend using the CyberCortex board (http://fabuloussilicon.com/index.php?main_page=product_info&products_id=185).

    This board provides a large FPGA and lots of on-board peripherals, including an FTDI serial/JTAG USB interface, along with a set of Arduino-compatible headers. It also includes some pre-configured cores and development tools to quickly get folks up-and-running.

  10. marcus says:

    I am going to learn FPGA in 2012!!

    Regards,

  11. nmeans73 says:

    This is a cool post considering I just finished an advanced digital design course. We used the Nexys2 for the class and it is a great learning platform for FPGAs.

    I understand this tutorial is supposed to be about helping programmers get into using fpga’s but I would suggest talking about drawing a design out on paper first because using an hdl is not like programming and drawing a schematic really helps.

    I would also suggest talking about muxes and their uses because they are a pretty important basic building block and are really helpful if you want to be able to display multiple outputs to the LED’s / 7-segment displays.

  12. BobC says:

    I would also suggest becoming aware of some emerging alternatives to the Verilog/VHDL duopoly:

    1. MyHDL: http://www.myhdl.org/doku.php/start

    This Python-based package lets you do HDL in Python! While its synthesis capabilities are still evolving, its most important features are a) the ability to use the full power of Python in testbenches (especially Numpy), and b) cosimulation (mixing MyHDL and VHDL and Verilog) within a Python context.

    2. Migen: http://permalink.gmane.org/gmane.comp.python.myhdl/2229

    This is a new Python-based tool that already provides great combinatorial and sequential synthesis capabilities, and is being used in the Milkymist project (http://milkymist.org/wp/).

    My hope is that MyHDL and Migen will one day find a way to merge.

  13. someonecool says:

    Why oh why would you use VHDL instead of verilog. :(

    Most of the cores on opencores are verilog for example, and IMHO, verilog is “easier” for a beginner to wrap their head around. Also, it is less demanding of syntax than VHDL, MUCH less.

  14. david says:

    I think VHDL should be the starting point, since it helps force you to think in terms of hardware design instead of software. The similarity of Verilog to C in syntax leads to sloppier un-synthesizable code for begginners from a software background. I think this is similar to the idea behind Pascal – a language that forces structured programming. I personally find VHDL to be far more readable than Verilog. Readability is far more important for large designs, especially when debugging or maintaining it years later, especially if you are not the original author.

  15. M4CGYV3R says:

    I think the Papillo One was an suggestion for a more powerful board for those looking for solder-peripherals. The one he suggests for beginners is the the Digilent Basys2.

    He specifically recommends it because “a lot of the projects focus on the eight slide switches and eight LEDs.”

  16. S1cK says:

    does anybody know where i can get fpga tutorials using basys2 board? i have that board for a while now, but don’t find any tutorial using this board. thanks in advance

    • Mike Field says:

      I’m got a Basys2 on the way, and will be using it as the reference platform for the course.

      Any other Xilinx based dev board should be suitable too, but you might not have enough switches, leds, seven-segs or whatever to implement all projects.

  17. FPGAs are so neat. I’ve got a bunch of dev boards, and so I decided I wasn’t going to get anymore until I actually made more than one project with each of them (most of the boards were free), but I’m starting a big project, and especially now that theyve come down in cost so much, it seems like a great way to prototype something that I will later implement with discrete logic chips.

  18. Eirinn says:

    Been messing around with an arduino for a few years.

    So, why FPGA? :)

  19. Jack Gassett says:

    Hello Eirinn,

    I’m the guy who designed the Papilio FPGA board and have been following this thread waiting for a question where I could add some value. :)

    Here’s my take on why to get into FPGA’s. First of all, the Arduino is the perfect solution in many cases. If a microcontroller like the Arduino can solve the problem that you are working on then it is the best solution. Micros are the most cost effective solution to many, many problems and the Arduinos are great micros.

    Inevitably, you are going to run into something that you just can’t do with a micro. FPGA’s are the answer to that problem, they can do or become pretty much ANYTHING. A HackaDay reader explained FGPA’s like this:

    With micros you tell them what to DO, with FPGA’s you tell them what to BE. Being able to tell an FPGA what to BE means you can do pretty much anything you can imagine.

    Most people hear FPGA and they are instantly turned away because of the perception that they are hard to deal with. It is true that there is a fairly steep learning curve with VHDL. But the Papilio project is an Open Source project that is all about making FPGA technology usable for people who don’t know VHDL.

    There are tons of Open Source VHDL and Verilog projects out there that implement everything you can imagine, just look at http://opencores.com. Writing these types of cores is best left to HDL experts, but learning enough VHDL to be able to connect and use these cores is within the reach of anyone… Think about learning enough VHDL that you can treat these cores as chips on a circuit board, instead of soldering the chips to a microcontroller on a board you connect them inside the FPGA with VHDL.

    Getting back to the concept of telling an FPGA what to BE. If I put together a bunch of cores from OpenCores that tell the FPGA to BE something I can then share it with other people by providing a bit file. Think of the Papilio as a hardware platform to share FPGA designs with people. We already have some very cool designs that are shared:

    – We have a bit file that tells the Papilio to BE an Arduino clone. As an end user all you have to do to run Arduino sketches on the Papilio is download our special version of the Arduino IDE.
    – We have a bit file that tells the Papilio to BE a 32 channel 200Mhz Logic Analyzer.
    – We have bit files that tell the Papilio to BE classic arcade motherboards like Pac-man, Frogger, and Galaxian.

    With a common hardware platform like the Papilio it makes it so end users simply load the bit files to the hardware to make the FPGA BE what other people are sharing.

    And of course, since everything is open source, if the bit file does not do something you need it to do then you can download the VHDL source and start hacking away to add new cores that you might need. :)

    It’s all pretty exciting stuff to get involved with.

    Jack.

    • Eirinn says:

      Thank you Jack – very informative reply!

      I’m guessing that it’s a versatile computer board then? Chosen cores are emulated and run with chosen code? AKA. computing abilities with broken out digital, analog and computer-like IO ports?
      So a mix between standard micros and a computer motherboard?

      What are its limits? I’m guessing one would not simply install win7 or ubuntu on an fpga :) As i understand it’s mostly used for games/video, sound, emulation of roms, information processing and so on.

      I have no idea about what VHDL or or VeriLog is about sadly, but i’m guessing its a syntax?

      • Jack Gassett says:

        Eirinn,

        Think of an FPGA as a rewritable circuit board. The FPGA is like a sea of interconnected transistors.

        VHDL is a hardware description language (HDL) that is used to describe what digital logic the transistors should implement and how they should be connected. HDL’s are used to describe how most chips that are in our electronics operate. So that AVR chip that is in the Arduino was defined using a HDL like VHDL or Verilog. But with a chip like the AVR the design is manufactured like audio CD’s are. So an FPGA is like a rewritable CD that you can change what it does using an HDL.

        An FPGA is not really a versatile computer board, it can be, but is really more of a blank canvas. With the right HDL code you can turn it into a System On Chip design that would have a soft processor and whatever peripherals you would need; like USB, VGA, and uSD. If you have SRAM memory you can even run linux, but there is no solution I know of that runs ubuntu or win7. An FPGA System on a Chip design is not going to be very powerful… It will be more along the lines of a first generation Pentium running at 100Mhz then a modern motherboard that can run Win7.

        An FPGA is also not an emulator, in the case of running classic arcade games like Pac-man we recreate all of the chips in the Pac-man motherboard inside the FPGA. So it is an actual hardware recreation of the Pac-man motherboard instead of emulation.

        Well, I hope this is more helpful then confusing. I went into a little deeper explanation…

        Jack.

      • Eirinn says:

        Thank you Jack,

        The only part missing from your first post was whether the systems were emulated or not which you answered in this post. I find both posts highly informative!
        Regarding the computer motherboard analogy; I only used i to understand the limits of an FPGA. To me, when finding out about new platforms, it is critical to know what’s possible using said platform.

        Many questions have been answered and it does sound very intriguing.

        When i’ve prototyped something using the arduino i take the chip and use it stand alone with a crystal and a few caps. This makes me able to create a project cheaply and reliably. How would one go about doing something similar with an FPGA? Would one have to be an EE to do it? :)

      • Mike Field says:

        Hi Elrinn,

        Where are the limits?

        I’ve got ucLinux up and running on a US$79 dev board (see
        http://hamsterworks.co.nz/mediawiki/index.php/UClinux/Buidling_for_the_Terasic_DE0-nano_on_Fedora_14 if you want a quick overview of the process) – I’m too cheep to pay for a license the NIOS II processor core that has a MMU and allows a full Linux distro. On a mid range FPGA you might get 200MHz out of a soft CPU core (based on numbers from http://en.wikipedia.org/wiki/MicroBlaze).

        Because you can build custom logic I’ve had my 4 year-old US$150 board render fractals about as fast as a single core of my AMD CPU in my laptop – using less than 2W.

        I’m redesigning my fractal view application to run on a current US$200 board and will speed it up 400% – 8 billion operations per second – as it runs twice as fast and has twice as many multipliers.

        On the top-of-the-range FPGA I would be looking at 40 billion ops…

      • Mike Field says:

        Oh – only just read your reply. Once your design is up and running if you aren’t an EE you could use something like http://www.xess.com/prods/prod048.php.

        It’s like an Arduino Nano but with an FPGA rather than an ATmega on it – with appropriate headers it could be mounted onto a custom PCB and for high value / small runs could be cheaper than designing a board.

      • Eirinn says:

        Thanks Mike,

        I know that something as complex as an fpga can’t really be “pulled out and soldered” like a single micro and something like this may be a viable option.

  20. ultrasounder says:

    Just found this Extremely informative, Open-Source VHDL book(PDF alert- 2.6MB) at the Free range factory website and the price is right(Free as in Beer). If there are other cash strapped newbies out-there with a resolution to start hacking FPGAs, go give it a try. You can even download the Latex files and edit the content to add Your inputs if that makes sense.

    http://www.freerangefactory.org/dl/free_range_vhdl.pdf

  21. Tom says:
  22. whitesites says:

    bitcoin mining here I come : )

  23. Jason says:

    I have found another board that is suitable for fpga learning. It has Xilinx zynq that combines CPU & FPGA and already written examples of code. http://www.kickstarter.com/projects/652945597/red-pitaya-open-instruments-for-everyone

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,598 other followers