Slashdot Mirror


Suggestions For Learning FPGA Development At Home?

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."

15 of 185 comments (clear)

  1. advice by seanadams.com · · Score: 5, Informative

    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!

    1. Re:advice by gregoryb · · Score: 4, Informative

      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

    2. Re:advice by Anonymous Coward · · Score: 4, Insightful

      Sure, after you learn the way things work and know what you're doing you need to design at a higher level of abstraction, but not when you're brand new to the field. The classes I took that forced me to construct low level logic in painstaking detail, draw Karnaugh maps, and know the difference between Mealy and Moore was invaluable to being able to bypass all that and think at a higher level of abstraction. You have to have a foundation to build on.

    3. Re:advice by snakegriffin · · Score: 4, Informative

      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.

  2. My Advice by AKAImBatman · · Score: 5, Informative

    Hardware: I highly recommend the Spartan Starter Kits. 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 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! :-)

    1. Re:My Advice by Anonymous Coward · · Score: 5, Informative

      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)

    2. Re:My Advice by negro_monolito · · Score: 5, Interesting

      Go here: http://www.digilentinc.com

      Buy the Nexy2 board for about $70. It has: 8-bit vga, 1 serial p., 8-seg disp., some flash mem., and a bunch of switches and leds. Uses Spartan3e chip, and comes with a nice case and USB programming cable. Programming software (adept) only works in Win., but you can get a linux programmer if needed. The Xilinx ISE or EDK stuff works in either windows or linux. Bonus: gvim works as an editor in ISE :)

      It basically comes with everything you need and should keep you occupied for several months; it's what we use at my university to introduce students to FPGAs in the lab. Feel free to contact me for more info.

  3. Xilinx by hjf · · Score: 5, Interesting

    Use Xilinx's FPGA Starter Kit. I bought the old version 5 years ago, and it also came with a CPLD dev kit. The dev tools run on linux too. It was something like $99 IIRC. It's made by Digilent. Last time I checked they had a better board for an extra $50 with an LCD display and 64MB SDRAM.

    Otherwise, check fpga4fun.com . They use a tiny FPGA board, which reminds me of the Arduino: it has everything you need and nothing more.

  4. Xilinx Spartan 3AN or Altera Cyclone III by nweaver · · Score: 4, Informative

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

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

    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.

    --
    Test your net with Netalyzr
  5. What I did - and recommend by TehBlahhh · · Score: 5, Informative

    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.

    1. Re:What I did - and recommend by DeadCatX2 · · Score: 4, Informative

      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.

      --
      :(){ :|:& };:
  6. Re:What MORON keeps tagging articles as HARDHACK? by bconway · · Score: 4, Informative

    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.

    --
    Interested in open source engine management for your Subaru?
  7. Re:What MORON keeps tagging articles as HARDHACK? by Anonymous Coward · · Score: 4, Insightful

    Actually, FPGAs are much more similar to hardware than they are to traditional software. Even though the configuration is volatile on most SRAM-based FPGAs, the "software" does not describe a set of procedural steps to perform as software does for microprocessors.

    Rather, an FPGA configuration (personality), describes how the internal gates, storage elements, and interconnect is switched. This makes a configured FPGA almost indiscernible from an ASIC in function.

    An FPGA isn't software loaded to "mimic" the functionality of an IC, it is software loaded to "describe" the functionality of the IC.

    This is why VHDL and Verilog aren't strictly software programming languages. Rather, they are hardware description languages. Although they can be executed by software simulators in a fashion similar to software, they really describe hardware either behaviorally (procedurally or event-based) or structurally (netlist).

  8. Recommendations by Ditiris · · Score: 4, Informative

    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. 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.

    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.

  9. Re:Don't buy a board and CtoVerilog.com by John+Miles · · Score: 4, Informative

    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.

    --
    Dahlmann tightly grips the knife, which he may have no idea how to use, and steps out into the plain.