Author: Craig Maiman – Principal RTL Design Consultant
Welcome to the RTL Design Success series — Part 9 of 9
1. Synthesis
RTL by itself isn’t useful until you run it through synthesis and because of that, you want to code in such a way that plays to the strengths of the synthesis engine.
I’ll just give only a little bit of advice for synthesis as there is no shortage of documentation and papers on coding for synthesis from the major tool vendors and others.
One of the more important pieces of advice I can impart is that you want to code your state machines in such a way that it is recognized as such – meaning, don’t be tempted to hard-code state encodings or use one-hot encoding. Modern synthesis engines have specific and sophisticated optimization algorithms just for state machines and will only use them if your code is in a format that matches the expectations of the tool. You really don’t want to leave these optimizations on the floor, and you’d be hard pressed to do better than them hand-coding at a low-level. Also consider any inline directives that might be available in the synthesis tool.
Part of that is to code your state machines as distinct processes without lots of other random logic mixed in – I’m a fan of keeping processes reasonably simple so that synthesis can do its best work in recognizing RTL structures (this is obviously a judgement call as to what “simple” means).
An excellent paper that goes into depth on state machine coding and synthesis is here.
Also, related to the above is to keep your datapaths distinct from the control logic for the same reason – synthesis engines have datapath-oriented optimization algorithms, so let the tool do the work.
2. Conclusion
Successful design to production requires a commitment to a top-down systematic approach from requirements, through detailed specification, clean design, verification and finally taking your design through the tools of your target technology. Being obsessed with getting it right from the very beginning and at every step along the way will make a successful end result a given.