Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Hardware Hacking Build

Suggestions For Learning FPGA Development At Home? 185

Doug writes "I've recently been inspired to take up amateur electronics, specifically with FPGAs. I have an understanding of the basics, plus a solid programming background. From my research so far I've concluded that I should start with a simple FPGA development board and a couple of books on Verilog and/or VHDL and go from there. I found this Ask Slashdot discussion on Verilog vs VHDL very useful, but it focuses more on the development language rather than hardware. I'd be very interested in hearing peoples' recommendations for an entry-level kit that is simple, flexible, and affordable (sub-£200), and preferably Linux-friendly, and indeed any other wise words that experienced FPGA developers (professional or amateur) might have for a novice just starting out in the world of circuit design."
This discussion has been archived. No new comments can be posted.

Suggestions For Learning FPGA Development At Home?

Comments Filter:
  • advice (Score:5, Informative)

    by seanadams.com ( 463190 ) * on Tuesday July 14, 2009 @12:52PM (#28692833) Homepage

    Unless you are very experienced designing with TTL chips, you won't get far in HDL without first getting good coverage of logic theory. My experience may be a little dated as it was 10 years ago that I started learning programmable logic, but at the time I enjoyed the first edition of Fundamentals of Digital Logic with VHDL Design. Not that logic theory has changed, but newer books might come with better examples or easier to use software. What I liked about that book was that it covered the theory in a very complete way while introducing the vhdl concepts at a manageable pace.

    As far as development tools, they're overwhelmingly Windows based. You may have to run a VM so that you can use the most common tools (eg Xilinx WebPACK) until you're up to speed, then try a linux solution later. There are lots of hardware trainers out there - it's really not that important which one you use initially, although if whatever books you're reading have a recommended one, use that.

    Your experience in the software world will help you somewhat, but be prepared for a vastly steeper learning curve than picking up a new programming language. There are not a lot of engineers who go very deep on both the software and hardware/logic sides - if you do you will end up with some valuable skills indeed. good luck!

  • My Advice (Score:5, Informative)

    by AKAImBatman ( 238306 ) * <akaimbatman@gmaYEATSil.com minus poet> on Tuesday July 14, 2009 @12:54PM (#28692861) Homepage Journal

    Hardware: I highly recommend the Spartan Starter Kits [xilinx.com]. They're dirt cheap, well supported by the industry, and come with a good toolkit. There's not much more you need to know other than you'll probably want a serial cable in addition to the JTAG cable the kit ships with.

    I'll grant you that the fabric isn't very large by today's standards, but it's still enough space to learn about the hardware. By the time you outgrow the fabric, you should have a good idea of what size hardware you want. In fact, your next board may even be a custom design based on a bus like wishbone. ;-)

    Software: The Xilinx stuff (pronounced "Zy-Links") comes with a full toolkit for VHDL/Verilog development including an IDE, place and route tools, and software to reconfigure the FPGA. It's all quite slick and easy for a beginner to use.

    Language: The most common route taken by new hardware developers is to learn Verilog. They do this because it's similar to C and that makes them comfortable. THIS IS A BAD IDEA. I can't count how many hardware designers swear up a storm when they see a Verilog project with loops and other software constructs stuck into them. See, the comfort and familarity of C makes new hardware developers forget that the hardware is a fixed layout. There is no for loops or control logic as you think of it. It all ends up flattening to hardware. If you write regular software constructs, you'll end up with the least efficient circuit possible.

    From this perspective, learning VHDL is better because you won't have that comfort and familiarity that might tempt you into creating poor circuits.

    I actually recommend doing some JHDL [jhdl.org] code for a while. It's lower level than VHDL, but that's a good thing. You have to think about every wire connection and how it all links up. When you're done, you can easily step through your circuit and see how it plays out in hardware. Even better, you learn how to properly use software constructs like loops to create a large number of static hardware objects. This will make your code better without falling in the trap of trying to write software.

    That's my 2 cents anyway. Good luck! :-)

  • by Rythan ( 1412023 ) on Tuesday July 14, 2009 @12:58PM (#28692905)
    I'd suggest Avnet Part # AES-SP3A-EVAL400-G, it's $49, and comes with everything you need for VHDL or Verilog...
  • by nweaver ( 113078 ) on Tuesday July 14, 2009 @01:00PM (#28692937) Homepage

    Xilinx: http://www.xilinx.com/products/devkits/HW-SPAR3AN-SK-UNI-G.htm [xilinx.com]

    Altera: http://www.altera.com/products/devkits/altera/kit-cyc3-starter.html [altera.com]

    Both are very mainline FPGAs, both have full devkits, references designs, include the tools, linux support on Xilinx at least (not sure on Altera), and are both at your price point.

  • Re:My Advice (Score:5, Informative)

    by Anonymous Coward on Tuesday July 14, 2009 @01:03PM (#28692999)

    I'm a hardware and software designer and while VHDL and Verilog are different, I would say it doesn't really matter which you start with (VHDL makes you be more careful in your design, Verilog is more often used in industry).

    I was one of the developers on JHDL and I would stick with the standard tools. Trying to explain to a potential employer why you know JHDL and not verilog or VHDL is kind of depressing. JHDL's last release was 2 years ago and I'm not sure if it is an active project any more. That said, the interaction with the simulation of circuits provides a nice graphical interface if that is something you are interested in.

    The Xilinx Spartans are great (and cheap) to start on and there are a bunch of people using their WebPack software with Linux (http://lug.wsu.edu/node/383)

  • Re:advice (Score:5, Informative)

    by gregoryb ( 306233 ) on Tuesday July 14, 2009 @01:05PM (#28693029) Homepage

    As far as development tools, they're overwhelmingly Windows based.

    The majority of Xilinx' tools are available in Linux versions. I actually really prefer the Linux versions as using them from command line is far easier under Linux than under Windows (provided you want to script your process instead of using the GUI, probably not as useful for someone just getting started). Also, AFAIK, the larger Xilinx FPGAs require the *nix tools for a guaranteed Map/PAR due to memory limits, etc. You can use the Win32 version, but once utilization gets high enough, the Win32 versions may not be able to completely PAR the design.

    -gb

  • by TehBlahhh ( 947819 ) on Tuesday July 14, 2009 @01:07PM (#28693049)
    1. Get a (the) Spartan-3 starter board. It's got the 500 variant of the Spartan-3 on it which is big enough to implement even small processors. The board also has some very limited VGA output, and a heap of other things that makes it fun to work with (Serial I/F, etc). The manual for this board is one of the better ones for beginners, as well. I broke my own teeth on this board. It's 149 US schmucks from digilent.

    2. Get Xilinx's free tool suite; its nicely compatible with that board. Free download from the web. Heck, you can even download and play with it without the / any board (but then you don't, of course, get the blinkenlights.) You can however try out and simulate designs before going to FPGA, and thus figure out why the (redacted) it doesn't (redacted) work. Simulations are your main way of verifying your design once you're past 20-odd gates.

    3. Learn the HDL of your choice. Read the books. One warning only: it is NOT a programming language - the entire model in your head about how software works needs to be replaced. Case statements are king. Productivity with HDL's are generally way lower than software; don't be surprised by this.

    4. Do points 1 through 3 in reverse order. Having a shiny 150 schmucker board won't help anything if you still have to spend two weeks grokking HDL's.

    HTH.
  • VHDL (Score:3, Informative)

    by skeeto ( 1138903 ) on Tuesday July 14, 2009 @01:13PM (#28693161)

    For VHDL itself, I learned that with GHDL [ghdl.free.fr] (VHDL front-end to gcc, though it hasn't been updated in a year now) and GTKWave [sourceforge.net] for viewing the waves. Throw in make for a build system, and it was all I needed to design and implement (VHDL only, that is) a simple microprocessor.

    That's a start anyway.

  • by fpgaprogrammer ( 1086859 ) on Tuesday July 14, 2009 @01:15PM (#28693181) Homepage

    If you're tired of all the VHDL and Verilog nuances, try CtoVerilog.com

    Learn how to use core generator and a simulator before you even buy a board. you only need a board when you actually want to have hardware.

  • Re:advice (Score:4, Informative)

    by snakegriffin ( 1597867 ) on Tuesday July 14, 2009 @01:25PM (#28693325)
    I would also add that VHDL/Verilog are *not* programming languages, in the sense that you are creating programs to compile and run on a system. They are Hardware Description Languages that you use to describe a functional piece of hardware. Thinking about HDL as a programming language will only get you crossed up, especially if you are new to the hardware design world.
  • Re:advice (Score:4, Informative)

    by gambit3 ( 463693 ) on Tuesday July 14, 2009 @01:25PM (#28693329) Homepage Journal

    I second the recommendation for the FOLD book.
    I used it in college (also about 15 years ago), and I loved it so much I ended up buying an updated version when I ran across it at a Half-Price books recently.

    If you've never done logic design, it will take you from the basics on.

  • by scriber ( 89211 ) on Tuesday July 14, 2009 @01:25PM (#28693339) Homepage

    Now that Xilinx has released new chips, the old ones are pretty cheap. A Spartan-3A evaluation board is less than US $200. These have VGA, PS/2, RS-232, a character LCD, a rotary encoder, LEDs, switches, and a bunch of extra connectors. The main problems are that the DDR2 RAM is *difficult* to use without a proprietary core, and the FPGA doesn't have access to the USB link.

    Digilent Inc sells Spartan-3E boards for less than US $100. These have an easier-to-use DRAM and provide access to the USB port (though I think the official driver is windows-only, there seem to be solutions for using it on Linux).

    Xilinx's ISE runs natively on Linux (RHEL, last time I checked). With a little searching, it was easy to figure out how to get it to work on Ubuntu, including the USB JTAG interface on the eval boards.

    I haven't found a great book for learning this stuff. Pedroni's _Circuit Design with VHDL_ is okay, but it's not particularly deep and doesn't cover the FPGA development process at all. I had to study the Xilinx tutorials to get things working.

    Writing HDL code superficially seems like normal programming, but it's not. Think of it as a way to translate your already-completed design into a form the computer understands. If you don't do the up-front design, it will be hard to fix through refactoring. The simulators just aren't up to the task. Restrict yourself to a single edge of a single clock, and things will be much easier.

  • a n00b's FPGA advice (Score:3, Informative)

    by wangahrah ( 898109 ) on Tuesday July 14, 2009 @01:34PM (#28693483) Homepage
    As many have stated, both Xilinx are Altera can be good routes. Note that while they Altera tools support Linux, their freebie Web edition does not, and the full kit is more than you'd want to spend. Any Xilinx starter kit should be fine for tooling around. I'm not sure your experience level, so I'll go with the basics...

    I'm a young n00b in the FPGA world (two years design experience out of college now), so my experiences are pretty recent. I've got an EE degree, and would say first of all, get a firm grasp of logic design. Do you know what a flip flop actually is? Are you familiar with things like setup and hold time? If not, start out with a lot of reading. Horowitz and Hill's "The Art of Electronics" is a good standard...there's a lot of analog stuff that's "less relevant" to you, but there's a good section on digital design that's a great start.

    One of my young programmer colleagues was looking over some of my code, and seemed to think it was pretty easy...the syntax seemed pretty straightforward, he liked the idea of combinatorial logic being so easy to implement, etc. He started tinkering himself, and VERY quickly realized that it was much more complex than he thought when issues of timing were thrown in. A fundamental knowledge of how signals are propagating through the device is key. It's not just PROGRAMMING, you're programming the actual hardware (or making fancy lookup tables, whatever. Get off my back!).

    As designs get more complicated, you'll need to learn how to use some tools to analyze timings. Altera has Timequest, not sure what Xilinx uses. In college, I managed to get away with the bare minimum of analysis, but I consider this to be a flaw in my education...to do things right, you should do proper timing analysis.

    I have an Altera starter kit I dink around with myself when I'm not at work, and it's definitely worth the time to learn the basics if you're an eternal tinkerer. Finally, the best advice I can give you...don't forget to use VIM as your editor, or you're just setting yourself up for failure.
  • by bconway ( 63464 ) on Tuesday July 14, 2009 @01:35PM (#28693501) Homepage

    Hardhack isn't a tag, it's a category. It stands for Hardware Hacking and is included by default. Try mousing over the story icon.

  • link (Score:3, Informative)

    by rhythmx ( 744978 ) on Tuesday July 14, 2009 @01:52PM (#28693741) Homepage Journal

    This is a great site with a good bit of introductory information. I implemented their LED flasher tutorials when I was playing with my Xylinx Spartan board. fpga4fun.com [fpga4fun.com]

  • Re:My Advice (Score:2, Informative)

    by Anonymous Coward on Tuesday July 14, 2009 @02:02PM (#28693869)

    Following up on above:

    I'm not sure what the current conversion rate is, but this is the board that I use in an academic setting:
    http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,400,453&Prod=XUPV2P ($299.99 USD for academic customers, so you may need to ask a prof to help you out with this). The FPGA is roughly four or five years old now, but the next-generation Virtex-5 XUPV5 board will set you back $750. There are plenty of resources for beginner-to-intermediate designs -- I've seen this board implement two MPEG-4 decoders running simultaneously.

    To answer your question about being *nix-friendly -- I've used the Xilinx tools under CentOS/RHEL, Debian/Ubuntu and Solaris with no problems (admittedly, these were the commercial version of the tools but I'm told the WebPack is pretty decent as well). Also, this particular FPGA has a PPC405 embedded into the FPGA fabric, and there are several linux flavors that have been ported to run on it -- so, you can actually run linux on the FPGA itself. What's more linux-friendly than that? :)

    One thing you may wish to keep in mind -- I tell students that for many first-time designs, you should be spending ~90% of your time parked behind the simulator tool, ~5% checking that the synthesis/implementations tools built the circuit you were actually trying to describe, and the rest of the time validating your design on the actual hardware (I've even taken the evil step of withholding FPGA board from people until they can demonstrate their designs have a chance of working through simulation). It's not the most fulfilling approach, but chances are your board will be idle for much of the day while you write or simulate HDL anyways. I believe the Xilinx tools include a stripped-down version of the ModelSIM simulator tool that is useful for simulating smaller designs.

    And I'm not touching the VHDL/Verilog issue with a 10-foot pole except to say:
    - The language is a tool that you use to describe the hardware that you wish to build. I personally avoid the 'features' that are available in one HDL but not the other so that I can easily switch between the two languages if I need to.
    - Writing test-benches is much easier in Verilog from my experience
    - Learn whatever your prospective employer uses! ;)

    Good luck!

  • by DeadCatX2 ( 950953 ) on Tuesday July 14, 2009 @02:05PM (#28693903) Journal

    I agree entirely with the parent; go with a Xilinx Spartan 3 board. They're cheap, relatively powerful, and Xilinx offers the ISE WebPack for free. It comes with a ton of tools, which you can use to generate cores for doing things like FIR filters and FFTs, or looking at the low-level implementation of your hardware, or programming devices.

    Don't forget to get a JTAG cable. They're very useful for downloading designs into the board. These will cost a little extra, but you might be able to get them with the dev board.

    LEARN TO LOVE THE DOCUMENTATION! This is VERY, VERY important. Xilinx has a TON of documentation and application notes that describe everything about their chips, and I cannot stress how important it is to read as much documentation as possible.

    The docs for XST (the Xilinx synthesizer that takes HLD code and turns it into netlists) describe the design flow, which is important because you need to know how to constrain your design, and what the inputs are for various stages of the design flow and how they connect (synth, translate, map, place, route, downloading into the Flash memory or directly into the FPGA, etc).

    The data sheets for the FPGAs describe the awesome wealth of features, which for Spartan 3-era chips include: dual-port 2k block RAMs, single-cycle 18x18 block multipliers, Digital Clock Managers, Digitally Controlled Impedance, Partial Reconfiguration, and so on. Some other FPGAs (specifically some Virtex models) are even more wild, with on-die "hard processors" surrounded by the FPGA fabric.

    In fact, you should go get the data sheets for every part on the Spartan 3 board - the memory chips, the LCD, all of it. If you're going to design with FPGAs, then datasheets should be as precious to you as the One Ring was to Gollum.

    You should also try to learn what the FPGA fabric looks like. Common logic blocks, slices, flip flops, interconnect, global clock resources, where the DCMs and BRAMs are, the layout of an I/O pad, and so on.

    When it comes to studying, I suggest looking for some tips on coding style for the language you end up choosing. You should also study things like combinatorial and sequential logic, finite state machines, datapath and control. You might even do well to read a book about microprocessor architecture design, because there is a lot of overlap. In fact, some books work together with FPGA dev boards, so you can build your own processor from scratch and add features (make it pipelined, add branch prediction and hazard protection, and so on).

    You could also explore this "soft processor" development by using pre-packaged soft cores, like PicoBlaze or MicroBlaze. You can put all kinds of processors together, even asymmetrically, using smaller ones for small tasks and bigger ones for big tasks. This might help if you're stuck in the software design flow mindset.

  • Recommendations (Score:4, Informative)

    by Ditiris ( 689306 ) on Tuesday July 14, 2009 @02:13PM (#28694025)
    I write FPGA code for a living, more in VHDL than Verilog, and more for Xilinx than Altera.

    I would actually recommend that you don't buy a board at first. You can pick one out so you can decide on a vendor's chip, that's fine, but simulate everything, because that's what HDL design is all about. Both vendors offer a free version of their toolset and there's a free simulator with each of those. Or you can download ModelSim Starter edition. I wouldn't call either one Linux friendly.

    As far as the board goes, I would recommend one of Altera's Nios II Embedded Dev Kits [altera.com]. I feel that although Altera has a slightly steeper learning curve than Xilinx, they also have a nicer overall package than what Xilinx is currently offering. I'm speaking from the point of embedding a soft processor though, if that doesn't interest you, then either of the cheap Altera Cyclone or Xilinx Spartan kits will get the job done.

    This is the only book you need on VHDL: The Designer's Guide to VHDL by Peter Ashenden [amazon.com].

    I haven't found a Verilog book of similar quality.

    Buy several books on Verification and testbench writing. That's where the real work comes in, and it's significantly more work than whatever circuit design you're doing. Spend the time to learn how to write self-checking testbenches.

    Read over the Synthesis guides for whatever vendor's board you choose. Understand how the constructs you use affect synthesis. There's a wealth of information in the Xilinx and Altera online documentation. There's also a lot of really of good snippets of code which are themselves useful but also typically contrast less and more effective constructs for synthesis.

    And finally, I will echo the caution that HDL is not a programming language, it is a design language. If you do not have a fundamental grasp of circuits, logic design, and computer architecture, I would recommend you pursue those topics first.
  • by hpa ( 7948 ) on Tuesday July 14, 2009 @02:14PM (#28694051) Homepage

    It is a little old, but the price is excellent... $150 for the general public, and $120 for students. Even though there are cheaper boards on the market, I have found that the combination of features at a low price has been pretty unbeatable, and it is also available from a lot of distributors.

    Now, in the interest of full disclosure, I have been focused heavily on retrocomputing projects... they're a lot of fun.

  • by kpainter ( 901021 ) on Tuesday July 14, 2009 @02:34PM (#28694333)

    3. Learn the HDL of your choice. Read the books. One warning only: it is NOT a programming language

    Agreed. Here is another tip that I resisted to the very end but turns out to be very useful. Only change one variable per process. Think of each process roughly like a D Flip-Flop. You need a reset, a clock, data in with logic and an output. You end up with a lot of processes but the chances of having something synthesizable are a whole lot better.

  • Re:advice (Score:1, Informative)

    by Anonymous Coward on Tuesday July 14, 2009 @03:33PM (#28694995)

    The last time I tried Xilinx, it was buggy as hell even on Windows (their main native development platform.) Nothing is more frustrating than to have a corrupted project file that builds just fine until you try to feed it a test waveform and you find for some reason your project fails to simulate at all. You start over again and rebuild your project exactly the same way and it (maybe) works the second (or third) time. I hope they fixed a lot of the problems. Xilinx was NOT ready for prime time when I tried it a year or two ago.

  • Re:advice (Score:2, Informative)

    by Anonymous Coward on Tuesday July 14, 2009 @06:45PM (#28697555)

    Other way around, at least with version 11.1, WebPack only supports 32-bit Windows but supports 32 and 64 bit Linux (though Xilinx only supports RHEL and SUSE Enterprise). I actually just purchased a USB Dongle node locked license only to find out after the fact that they only support the USB Dongle on Windows.

  • Re:My Advice (Score:2, Informative)

    by pem ( 1013437 ) on Tuesday July 14, 2009 @07:02PM (#28697695)

    This is probably a bit of a troll, but I'll bite anyway.

    1) Until version 11.1 (earlier this year), Xilinx software was never protected by ANYTHING. (Well, you had to enter a serial number, but the FAE would probably give you one).

    2) Xilinx software never expires -- the 1 year gets you updates, but you can still keep using it after that.

    3) At version 11.1, Xilinx started using FlexLM licensing. While I am not a fan, it has not proved all that difficult. Now, I have to admit that I haven't tried licensing the free Webpack under 11.1 (only the full-up paid-for release), so don't know whether there are issues with multiple machines, but older versions of webpack (such as 9.2, a very good version) work fine on all the currently supported parts, and there are no problems with downloading them to multiple machines.

    So, only with the very latest release, which isn't really necessary for the parts that Webpack currently supports, might you have to worry about licensing in any significant fashion. You write like this has been the case all along, so this leads to the next question:

    4) EVERY TIME I look at altera, the licensing puts me off. Have they significantly changed it? Why do you think it's better? If memory serves, they've been using FlexLM for a very long time (which Xilinx just started to do earlier this year).

  • by John Miles ( 108215 ) on Tuesday July 14, 2009 @11:07PM (#28699569) Homepage Journal

    For a newbie, CtoVerilog.com is the mother of all bad ideas. Verilog is not isomorphic to C. Being able to represent a few trivial C loops as Verilog code will not help you learn what's going on under the hood, and it will not help you get the fundamental aspects of your design up and running.

    Also, much of what's done in HDL is gluing other chips together. If you try to use CtoVerilog to make a high-speed USB chip talk to an ADC, the results will be amusing at best. If you find yourself wanting to use C in an HDL design, consider either falling back to a conventional microcontroller or using a software core to run it.

  • by tzanger ( 1575 ) on Wednesday July 15, 2009 @12:20AM (#28700037) Homepage

    Spartan 6 is anaemic? What are you trying to build? I am working with a Raggedstone Spartan IIIe card (the mini-can); it's US$150 and I'm developing PCI hardware with it. That's hardly anaemic. There's lots of fun to be had with smaller devices as well.

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...