So far, I've gotten advice on clocking at lower frequencies (generate
1-of-N clock enables) and I've read and understood (?) about unwanted
latches. I've gotten my Nexys2 counting, multiplexing the display,
debouncing buttons, simple stuff like that. So what I'm interested in
is something along the lines of the top N bits of advice for
beginners. These can be as simple as a single sentence ("Always
do..." or "If this than that"), I can probably take it from there. Or
pointers to good articles on the net. I'd really appreciate tapping
into the collective knowledge here.
As for any knowledge transfer, it's unwise to seek one-size-fits-all
solutions. I am pretty certain that if you could put together a
two-page Top FPGA Desiderata sheet that was genuinely useful to a
wide audience, someone would have already done it; I'm not
aware of anything that fits the bill.
Your specific situation (s/w guy with good hardware experience
but little exposure to FPGAs and HDLs) is fairly unusual, but
we've had a few such popping up here in the past and, like you,
they generally seem to get the hang of things faster than most.
Many of the guidelines you'll find for HDL design are unduly
prescriptive and limiting, partly because there's a sense that
traditional digital designers aren't ready to exploit the
full power of HDLs that software people often try to use
instinctively. Other guidelines are aimed at dyed-in-the-wool
software people who wouldn't know a clock edge if you tried to
cut them with it. I would not wish to insult your intelligence
with either of these flavours of cookbook.
Every time I write any HDL code, I'm making use of a large
body of experience, wisdom, tricks and pitfall-avoidance
techniques that I've accumulated over half a lifetime of
real do-it-in-anger work. Much of that is stuff I've
learnt from others; some is stuff I've invented for myself
because of frustration with the standard solutions. Despite
having been a teacher and trainer for a large part of that
half-a-lifetime, I still don't know any good way to capture
that accumulated know-how in a short document.
So I'd instead urge you to go on using your own insight,
which is clearly pretty reliable, and keep coming back
here or to any other forum you trust. Treat textbooks
with the circumspection they mostly deserve, and be even
more cautious of web-based information which is often
motivated by vanity or commercial interests. A couple
of comments on your solution to your problem, from an
experienced reviewer, are likely to be more valuable to
you than any amount of staring at a cheat-sheet of
guidelines. You seem already to have bought in to
the really fundamental stuff (be synchronous; be
aware of the hardware your code implies; be aware
that you're writing code, so all the usual good
sense about software applies equally to HDL code).
My best shot at guidance that might be useful to you:
SIMULATE AND SYNTHESISE early and often. Review the
results of both processes and be sure you understand
how they relate to your original design intent. Be
on the lookout for synthesis results that look bloated
or wasteful of hardware - they probably indicate that
you wrote a software-like description without thinking
of the hardware consequences. Be on the lookout for
unexpected or flaky behaviour in simulation, and be
sure you understand the reasons before moving on -
errors are much easier and cheaper to fix if you
fix them early in the development cycle.
In other words, keep your brain engaged. That's all.
Good luck and happy designing,