top | item 8664173

FPGA Programming: Where to Begin? (2012)

85 points| nkurz | 11 years ago |741mhz.com | reply

25 comments

order
[+] zw123456|11 years ago|reply
This is a really good "getting started" article. But I would add a couple more pointers for anyone out there who is interested in getting started with FPGA programming. First, it is not programming. It really is hardware description. I did a lot of the things they said in the article but the thing that helped me the most was first, getting a board (I started with the Terasic DE0 but there are a lot of good cheap ones out there, you don't need to spend a lot of money). I started out using the Altera Quartus II development software because it has a facility in it that allows you to draw a schematic diagram of standard gates and flip flops and it will then generate the equivalent HDL code. What that did for me is "learn by example" and helped me bridge the gap from real hardware to the Hardware Description Language.
[+] gallamine|11 years ago|reply
I second this. it is not programming. Jettison all ideas you have about how a program normally runs.
[+] aleksanb|11 years ago|reply
Me and a group of friends at NTNU spent the last three months implementing self-designed and working GPU from scratch in VHDL on a Xilinx Spartan 6 FPGA. At the same time as this, we also implemented fully working multi-cycle and pipelined MIPS CPUs for the same FPGA.

All of us came from software backgrounds, never having touched any hardware description language.

To get started I'd recommend reading Computer organization and design by Patterson and Hennessy (http://www.amazon.com/Computer-Organization-Design-Fifth-Edi...).

For the VHDL part, all we had available was this small basic VHDL compendium (not sure if I can redistribute it), open source github repositories from friends and classmates, as well as the always helpful vhdlguru.blogspot.com

So i'll reccomend following one of the open lecture series posted above :)

[+] sliekasbekelniu|11 years ago|reply
Would you mind making this effort open-source for a possibility to build completely open-source computer? The Novena laptop had all things except GPU because there is no open source GPU which would have all the schematics available. Some guy from Germany, I think, is also working on open-source design GPU on FPGA.
[+] kubov|11 years ago|reply
Verilator[0] can compile Verilog (which, in my opinion, is more friendly than VHDL) to C++ classes code. This is great tool for someone who don't want to spend money on hardware or use vendor specific tools. After compiling top-level module to C++ class, we can use it in code as a regular object.

[0] http://www.veripool.org/wiki/verilator

[+] jamieiles|11 years ago|reply
Verilator is an excellent tool, definitely recommended. I've been using it myself on a project and I have seen simulation times for tests drop from 22 seconds with Icarus down to 0.5 seconds with Verilator. Being able to easily call C code or DPI is a big win for testability.
[+] VLM|11 years ago|reply
There's at least 3 paths. Top down, like article recommends, your first project is lines of VHDL code. Bottom up where you learn gates and work your way up where your first project is feeding two switches on a dev board thru a single xor gate and light an LED with the gate output. Systems integrator is also a valid path where you go to opencores and pull a soft core CPU (ranging from totally proprietary all the way up to GPL) and start with a dumb peripheral and make it smarter.
[+] tankenmate|11 years ago|reply
The other thing to note about hardware, in comparison to software, is that it is inherently "parallel"; i.e. electrons will flow if they can, if a logic gate is set to switch it will, you can't make it "wait" to switch until you want it to. This is why clocking is important, it makes sure that things happen in a synchronised fashion; without it it's a bit like an orchestra playing with no conductor and/or beat, a mess.
[+] bra-ket|11 years ago|reply
before getting to FPGA is helps to understand computer architecture and digital design 101, this book is a great intro with examples in verilog/hdl: http://www.amazon.com/Digital-Design-Computer-Architecture-E...

as a side benefit I learned MIPS assembly from this book which is very helpful in understanding assembly languages for other architectures, and assembly snippets in Knuth's TAOCP

[+] pveierland|11 years ago|reply
I found fpga4fun.com to be a great resource when starting out. It has short and practical examples for learning how to program in an HDL. It's pretty cool when you see that you can write something like an Ethernet interface [0].

[0] http://www.fpga4fun.com/10BASE-T.html

[+] emcrazyone|11 years ago|reply
I was about to mention this site too. I think that site is awesome. I found it a few years ago. The guy does a very nice job not only with FPGAs but also interfacing with current technologies like PCIx bus to create ethernet and acquisition boards for PCs. He also gets into windows device drivers to get the cards up in windows.
[+] tscherno|11 years ago|reply
Someone has a link to an similar writeup for DSP programming?
[+] CamperBob2|11 years ago|reply
dspguide.com is good, also anything by Rick Lyons. Most of the other textbooks people tend to cite are excessively math-heavy and abstract in nature, or just plain not very good.

You wouldn't want to learn DSP on dedicated hardware at this point. Look into software-defined radio as a gateway to DSP development on native CPUs.