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

 



Forgot your password?
typodupeerror
×
Hardware Build

Learn FPGAs With a $25 Board and Open Source Tools 93

An anonymous reader writes: Hackaday has a 3 part tutorial with videos of using open source tools with a cheap ($25) FPGA board. The board isn't very powerful, but this could be the 'gateway drug' to FPGAs for people who don't want to spend hundreds of dollars and install 100s of megabytes of software and license keys just to get their feet wet. The videos are particularly good--like watching them over their shoulder. As far as I know, this is the only totally open source FPGA toolchain out there.
This discussion has been archived. No new comments can be posted.

Learn FPGAs With a $25 Board and Open Source Tools

Comments Filter:
  • these analogies have to have a point, don't they?
  • truth is... (Score:5, Interesting)

    by hjf ( 703092 ) on Thursday August 27, 2015 @06:20PM (#50405861) Homepage

    truth is... you don't need a board to "get your feet wet".

    You only need a simulator. A deep understanding of combinatorial and sequential logic, an idea, and a plan. Simulate, simulate and simulate. After a few hundred cycles of simulation, if you didn't get bored, you can go ahead and get the FPGA and start fiddling with the electrical part.

    Thats why the Spartan-3 Starter Kit I bought 10 years ago is in its box.

    • Re: (Score:3, Funny)

      by Anonymous Coward

      Amused to hear that I'm not the only one. I bought a Spartan 3 kit six years ago dreaming of all the cool things I'm going to do with it... It was pulled out of the box once, and I programmed it once to blink LEDs. It's been in the box ever since. Having kids have something to do with that, I guess. Once they're out of the house, I'm sure I'll pull it out again.

      • My Xula-2 [xess.com] board just arrived and I hope it does not meet the same fate as yours. I also have a papilo board that is gathering dust and a DE0 nano somewhere (at least I had a little more success with that - the Altera toolchain seemed more tractible but equally huge).

        I have had a hard time getting started. I have no doubt that an open source toolchain will be a great step forward in lowering that barrier and I'll probably have a play with that in good time, I especially liked the idea of playing with the j1a

        • Re:truth is... (Score:5, Insightful)

          by Slugster ( 635830 ) on Thursday August 27, 2015 @08:22PM (#50406483)

          ... I have no doubt that an open source toolchain will be a great step forward in lowering that barrier ..

          Yea, because open-source software is famous for having well-designed, easy-to-use comprehensive instructions. ;>)

          After building a few things with atmel-chip Arduino boards in the last couple years I gave in to my curiosity and bought a couple cheaper CLPD and FPGA boards. On electronics forums there's always people moaning "oh god not another arduino user" and whining how "there's so many other boards that are faster/have more cores/ect ect/why are you still using atmel shit". I ended up choosing Altera-chip boards, for no particular reason. Lower-end Altera or Xlinix boards can be had for $10-$15 from the orient-direct sites. A USB JTAG programmer costs another $5, if one wasn't included. The cost isn't the problem here.

          Part of the problem (as I see it) is the complexity of using the programming toolchains, yes. The boards seem to work, but I haven't actually gotten mine to 'do' anything yet.... I have not gone through the available Altera tutorials however.

          But another part of it is that most people are hard-pressed to think up anything that would require an FPGA, so there's not a lot of incentive to learn. Myself included.
          Most of the projects that most people build with Arduinos probably have the atmel processor sitting there idle most of the time. If an Uno isn't fast enough, the Mega is twice as fast as the Uno. And then the Due (with an ARM chip) is ~5x or more times faster than the Mega, depending on what your program does... And there are other ARM boards that are faster/have more cores than the Arduino Due.... so there are a lot of other easier-to-use options for a 'faster' board, if an Uno or Mega just can't handle the task.

          So I think that FPGA's aren't going to advanced into the hobbyist market any time soon. At least. no more than they already are.
          The concepts of FPGAs and CLPD's intrigues me, but currently it's a lot of hassle to learn just to gain processor speed that most projects I can imagine simply don't require.

          • by JanneM ( 7445 )

            Yea, because open-source software is famous for having well-designed, easy-to-use comprehensive instructions. ;>)

            It often sucks, certainly. But there is one compelling advantage, in the case of unusual stuff such as this. The developers themselves are happy to talk about and answer questions around their tools. And open source tools tend to attract hobbyists that do things for fun, and are happy talking about what they do, and not just commercial developers that won't publicly say a word.

            So with open sou

          • by thsths ( 31372 )

            > Yea, because open-source software is famous for having well-designed, easy-to-use comprehensive instructions. ;>)

            You forgot to mention that great UI and UX.

            The difficulty with FPGA is that the primitives are really primitive. It seems simple, but the lack of any kind of abstraction means that you have more freedom in programming, and much more freedom in your tool chain.

          • If an Uno isn't fast enough, the Mega is twice as fast as the Uno

            It is? They both run at 16 MHz according to the specs. The Mega gives more IO options and more storage and more hardware timers. I don't think you get more speed. For speed, I rather like the Teensy [pjrc.com], which has true analog output too (not just PWM pins)

            • If PWM isn't a true 'analog' output, what is? I can think of no better or simpler way to implement a DAC - with a lower level of error and greater precision - than PWM through a low pass filter. Or does this board simply hide those details from you - I admittedly am not up to date with these hobbyist boards.
              • True, I guess it depends in what dimension you're defining "analog". With PWM it's really temporal, via the duty cycle. Once you've gone through a DAC, it's in the voltage domain. I was thinking of the voltage domain: the Teensy has a built-in DAQ so you have the option of an analog voltage.
          • by AmiMoJo ( 196126 )

            If you want to do more with microcontroller projects just program the Atmel on your Arduino directly, i.e. not using the Arduino IDE. That thing is the reason why people deride the Arduino platform so much - it's built to be really easy to use, at the expense of performance. In fact it isn't even very optimized for basic stuff like DigitalWrite(), that gets used a lot.

            For FPGA projects, you are really looking at two categories.

            1. FPGA with a CPU core and a little bit of extra logic on the side to do some sp

          • by tlhIngan ( 30335 )

            After building a few things with atmel-chip Arduino boards in the last couple years I gave in to my curiosity and bought a couple cheaper CLPD and FPGA boards. On electronics forums there's always people moaning "oh god not another arduino user" and whining how "there's so many other boards that are faster/have more cores/ect ect/why are you still using atmel shit". I ended up choosing Altera-chip boards, for no particular reason. Lower-end Altera or Xlinix boards can be had for $10-$15 from the orient-dire

    • Re:truth is... (Score:5, Insightful)

      by Austerity Empowers ( 669817 ) on Thursday August 27, 2015 @07:08PM (#50406115)

      I won't argue that's a good idea if you don't know some HDL or how to use the tools, or even have a good idea for a project. But there are a few reasons to actually use a real FPGA, and particularly a real toolchain:

      - Not all HDL code synthesizes. Great designs get ruined when they meet an actual synthesizer that doesn't understand the construct you are using. This can be heartbreaking sometimes.
      - You may want to use tri-state logic internally in your design. Never do this. Even when using tri-state buffer features, use a wrapper module. Xilinx, Altera and various design libraries often do this differently because of the large variety of buffers, most of which aren't interesting to you for the blinky light. Just save yourself some trouble here.
      - Complex buffers (DDR, serdes) have a lot of detail that everyone implements a bit differently. You want real hardware to make sure these work properly, and you may need to implement extra circuits to handle the implementation detail. Or, and this is fun, sometimes the vendor has limitations that will break your heart (particularly on low end FPGAs)
      - Not all code that simulates well actually runs well. The list of gotchas is near infinite, but ignoring buffer complexity the best ones are reset conditions (xilinx has no POR, it all initializes to 0 unless otherwise specified, and that is fine if you implement a clean reset ckt), setup/hold violations from external interfaces, and everybodies favorite: bus doesn't quite work the way you think it should and the way you coded the BFM.
      - You can do squirrely things that you shouldn't really do at all, like double edge triggered flipflops, or latches. Technically this goes in "doesn't synthesize", but sometimes it will and will do funky things that a simulator won't pick up on.

      There's value in messing around and $25 is compelling, but don't buy the $600 PCIe kit until you know what you want to do and already have a good design and have done your homework.

      • All good advice. I would add that you don't need an actual device to run synthesis, you can get versions of the quartus and xilinx tools from their website and run your design through it. Check the synthesis logs for warnings, and check your timing reports. Don't try to implement a huge logic cloud between clocks, but you can do a surprising amount. The timing reports will tell what's possible for a particular device and when you need to break your logic up more.

        LEARN state machines!

        Understand what th

    • You only need a simulator. A deep understanding of combinatorial and sequential logic, an idea, and a plan.

      You know who else has a plan? The Cylons.

    • by Anonymous Coward

      "BUT it worked in simulation" This is the most common mantra I hear when it all goes to shit. As the guy that develops the test software and BSPs for these things after the electrical engineers have done their design and programming (simulation cough, cough), I can tell you that just because it works in simulation, doesn't mean it's gonna work in the real world.

    • truth is... you don't need a board to "get your feet wet".

      You only need a simulator.

      Presumably you have already played with the simulator by the time you get the itch to try something real.

  • by Anonymous Coward on Thursday August 27, 2015 @06:25PM (#50405891)

    ... the more they stay the same.

    During my time in college nearly a decade ago, I experimented a lot with libre toolchains like iVerilog and the like, which were very useful for putting together high quality code that could be dumped into some poorly designed Xilinx toolchain (with a few workarounds for the bugs in Xilinx's junk software).

    I cannot believe that nearly a decade later, this cheap FPGA is as far as we've come.

    It's been a lost decade; everything—including smartphones, tablets, increasingly laptops and desktops, FPGAs, etc.—has been completely locked down and walled off from the innovative play of passionate hackers. What a waste of time.

    • The last decade we have gained MASSIVELY in efficiency and cost. IM typing this on an Intel NUC I picked up at retail for $129, $10 of RAM, $25 keyboard with touchpad and $5 class 10 SD card. All running a free OS that recognized all the hardware and automatically installed it including Bluetooth and WiFi. Lost decade, give me a break.
      • by msauve ( 701917 )
        ...and all of that has made FPGAs more accessible to the average Joe how, exactly?
        • How else do you get to the vendor website to order the FPGA and communicate with others? Do you expect him to actually leave his room and socialize with others sharing a similar interest?

          (not attacking op, read above with a dash of humor)

        • ...and all of that has made FPGAs more accessible to the average Joe how, exactly?

          It hasn't. The advances in cheap computers mean that things which used to require custom logic to be fast can be solved by just wasting CPU power instead.

    • Then you need to pay more attention...

      The FREE Vivado Webpack gives you access to chips up to Artix 200T, Kintex 160T and Zynq 7030.
      Those are bigger devices than any tinkerer or beginner ever has time to fill. Most 65nm FPGAs are smaller.

  • Why Verilog and not VHDL?

    (actually that's a good interview filter question too)

    • Re:Verilog (Score:4, Insightful)

      by StandardCell ( 589682 ) on Thursday August 27, 2015 @07:47PM (#50406331)
      I think VHDL is better than Verilog to learn HDLs for two main reasons:

      1. VHDL is based on ADA, which is a concurrent systems language that is verbose and relatively easy to read versus Verilog's C-based syntax that is more terse, which leads me to...
      2. Verilog, being C-based, can reinforce procedural language thinking rather than concurrent system thinking where inherent timing-independent parallelism is the norm in an HDL (e.g. multiple clock domains, or even *shudder* asynchronous feedback).

      That said, VHDL has its own problems, such as its relative lack of use in the workplace like the United States, packages and library dependency being a bit clunky, and lack of efficiency in some situations versus Verilog where equivalent Verilog is just less typing and IMO much easier to read a netlist for a standard-cell design.

      For a $25 package, it's really hard to go wrong with this and I hope it will take off. I only wish there were better tools to reinforce the principles of timing and design pipelining, especially a tool for static timing analysis. Then again, I suspect nobody was expecting to get a copy of Synopsys PrimeTime with this package either!
      • I'm not the expert, but VHDL adds the strong typing. A lot of people disparage strong typing and any other "annoyance" features but it really helps in the long run to point out possible problems as early as possible. Tediousness is not a bad thing. Plus as you say there's a bigger break from procedural languages.

        I think there's some parallel here in American vs European preference with the C versus Pascal/Modula/Ada preferences.

        That's why I think it's possibly a good question for interviews, not in order

      • If you know procedural coding, VHDL is a stronger break in syntax and can help you think in terms of hardware.

        BUT there are some weird issues with support of the latest VHDL standards from a lot of vendors which SUCKS. VHDL 2008 is still not fully supported, UGH.

    • Verilog is used more stateside, VHDL more in Europe.

    • When I were a kid, we were told "a picture is worth 1,000 words".

      After more than 30 years experience of FPGAs, I can say with complete confidence, a well drawn schematic is worth 2GB of VHDL. But learn from DEC PDP11 schematics and not from British Standard compliant ones.

  • fpga4fun (Score:4, Informative)

    by TeknoHog ( 164938 ) on Thursday August 27, 2015 @07:23PM (#50406201) Homepage Journal

    I didn't read the summary or the article, but I see these comments about overwhelming toolchains. To me, the important bit is understanding some general concepts (it helps to have some electronics experience first) and the language (Verilog is probably easier than VHDL). Fpga4fun [fpga4fun.com] and its tutorials were a great introduction to these.

    For those of you who think FPGAs are a waste of time compared to small/fast/low-power CPUs, there are plenty of reasons to learn them anyway. The key idea is that you design your own circuit, instead of running your code on someone else's CPU design. If you have any electronics background, you'll appreciate the idea of basically writing your circuits in code, instead of the painstaking and error-prone manual assembly. It really bridges the gap between software and hardware in many ways.

    One interesting side effect to me is that FPGAs helped me write and understand parallel code better. In an FPGA, you often write genuinely parallel circuitry, and you need extra care and thought to make it work at all. That kind of thinking will carry over to your software projects too.

White dwarf seeks red giant for binary relationship.

Working...