
FPGA Programming: Where to Begin? (2012) - nkurz
http://741mhz.com/fpga-where-to-begin/
======
zw123456
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.

~~~
whatisapancake
I started with a Digilent Basys2[0], it could be a slightly cheaper
alternative to the Terasic DE0. It uses a Xilinx chip, has a free
design/development software called ISE Webpack, which also has schematic
diagram support.

[0]
[http://www.digilentinc.com/Products/Detail.cfm?Prod=BASYS2&N...](http://www.digilentinc.com/Products/Detail.cfm?Prod=BASYS2&NavTop=2&NavSub=649&CFID=6817248&CFTOKEN=d903db33c49f3ae4-4DE798C4-5056-0201-022EA49E4C31ABE5)

~~~
sklogic
One may also want to take a look at Logi-Pi:
[http://www.element14.com/LOGI](http://www.element14.com/LOGI)

~~~
edwintorok
That is interesting, I haven't looked at it in detail yet but what does it use
to create the .bit files or is the entire toolchain open source?

~~~
sklogic
Unfortunately, it still relies on the same Xilinx ISE (webpack is sufficient),
so, it's not possible to cook bitfiles on the Pi itself. But the board itself
is nice, easily programmable via SPI, has a decent Spartan6 LX9.

------
drhodes
There's a lecture series for Cornell's ECE5760 on youtube titled:
"Microcontroller and system-on-chip construction using Verilog and Altera
FPGA." There are 28 lectures

[https://www.youtube.com/playlist?list=PL2BA78454E71FF0E5](https://www.youtube.com/playlist?list=PL2BA78454E71FF0E5)

[http://people.ece.cornell.edu/land/courses/ece5760/](http://people.ece.cornell.edu/land/courses/ece5760/)

------
aleksanb
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...](http://www.amazon.com/Computer-Organization-Design-Fifth-
Edition/dp/0124077269/)).

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
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
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](http://www.veripool.org/wiki/verilator)

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

------
dangerboysteve
How about a Dummies book :)
[http://design.altera.com/New2FPGAeBook](http://design.altera.com/New2FPGAeBook)

------
MaysonL
Also, Niklaus Wirth weighs in with Lola-2, his logic description language,
with a compiler to translate it to Verilog. Also, source for a working RISC
computer. All in service of Project Oberon, 2013 edition:

[http://www.inf.ethz.ch/personal/wirth/ProjectOberon/index.ht...](http://www.inf.ethz.ch/personal/wirth/ProjectOberon/index.html)

[http://www.inf.ethz.ch/personal/wirth/Lola/index.html](http://www.inf.ethz.ch/personal/wirth/Lola/index.html)

------
bra-ket
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...](http://www.amazon.com/Digital-Design-Computer-Architecture-
Edition/dp/0123944244)

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
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](http://www.fpga4fun.com/10BASE-T.html)

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

------
jesuslop
In practical terms, the answer would be "Introducing the Spartan 3E FPGA and
VHDL" by Mike Field freely available.

~~~
jcr
It's available on the github repo of the author

[https://github.com/hamsternz/IntroToSpartanFPGABook/blob/mas...](https://github.com/hamsternz/IntroToSpartanFPGABook/blob/master/IntroToSpartanFPGABook.pdf?raw=true)

------
tscherno
Someone has a link to an similar writeup for DSP programming?

~~~
gshrikant
I can't say about programming DSP processors but for learning DSP concepts, I
wholeheartedly recommend this:
[http://www.dspguide.com/](http://www.dspguide.com/)

~~~
dmpk2k
Wholeheartedly seconding this. That book is a low-key gem.

I tried many introductory DSP books. That was the only one that stuck.

