As FPGAs work their way into the hobbyist/maker community, I'm guessing a lot of you are trying to learn VHDL and Verilog. (You can try to use schematics, but the Xilinx editor is pretty poor.) Which language you choose is up to you, but I'll only talk about VHDL in this post. There's general agreement that if you know one, it's easy to learn the other.
There's no shortage of VHDL books (around 100 on Amazon) or online tutorials (Google lists 278,000 but I haven't checked them all), so there's no need for me to waste my energy doing another. Instead, what I will do is tell you how to use the existing books & tutorials to learn the use of VHDL in synthesizing logic for FPGAs.
Most online tutorials give you a smattering of VHDL examples that introduce you to about 30% of the language that you need for logic synthesis. (Many of these are written by university instructors trying to get their introductory logic design class up to speed on VHDL.) You can go pretty far with these if you can find examples to use as templates for your own designs. Just google "VHDL tutorial" and you're bound to find something you like in the first few pages of results.
Eventually you're going to need some of the less-obvious features of the language, especially when you want to generalize your designs to make them easier for others to use. For a good, general and (most importantly) concise discussion of VHDL, I like this 54-page appendix from an early edition of Fundamentals of Digital Logic with VHDL Design by Brown & Vranesic (I think). It probably gives you 75% of what you need for doing logic design with VHDL.
Ultimately, though, you'll find your way to Ashenden's The Designer's Guide to VHDL. Aside from reading the actual language specification (please don't do that!), The Designer's Guide is the most complete reference on VHDL. But the current edition weighs in at 3.8 pounds and almost 1,000 pages. That's a lot to go through and it's really not necessary because much of the book discusses language features used for system modeling and simulation, not logic synthesis. (That was the original intent for VHDL; logic synthesis was tacked on later.) So here are my suggestions on what to read in The Designer's Guide if all you want to do is synthesize logic for FPGAs:
Once you're at this point, you know pretty much all you need to describe logic designs for synthesis into FPGAs with VHDL, but not if you want to do it efficiently. For that, you need to read the 176-page Synthesis and Simulation Design Guide written by Xilinx. But don't worry: all you really need to read is chapter 5 about coding VHDL for FPGAs (still, that's about 70 pages). You'll get a whole list of things to avoid that are inefficient or, even worse, not synthesizable at all, as well as tips for how to write things that are efficiently synthesizable into the structures within the FPGA (like block RAMs).
And while you're reading the Synthesis Guide, do the following: build small VHDL projects, synthesize them, and then look at the results using the View RTL Schematic and View Technology Schematic tools available in the Xilinx ISE Project Navigator. Doing this will develop your gut feeling of how your VHDL maps into the FPGA and how small changes to your code can make big changes in how much logic is used. This is the hardware equivalent of looking at the assembly code that's output by a software compiler.
In the end, after going through all this, will you be good at writing synthesizable VHDL? If you already had experience at designing digital logic and had some idea of the internal structure of FPGAs, then I think the answer is yes. If not, then I'm not sure. I know that I continually fall back on my basic knowledge of digital circuits to interpret what the VHDL I'm writing will do. I don't know how you would write VHDL without that mental framework. However, I've heard some say that you can write programs without knowing how a computer works, so maybe there is some hope for doing the same with VHDL. Possibly it will evolve like the programming of embedded microcontrollers: tight, efficient code was of utmost importance when they first appeared with their small RAMs and ROMs, but then less expertise was required when larger memories allowed the use of higher-level languages. It may be that, even today, FPGAs are large enough that you don't have to worry too much about how efficiently you use them. I guess you'll find out.
Comments
New Comment