|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
|
|
Optimal HDL Coding Styles for Programmable Logic Design
By Suhel Dhanani, Sr. Product Marketing Engineer, Altera Corporation (sdhanani@altera.com)
1.0 Introduction
The obvious benefits provided by a HDL based design flow are higher designer productivity, design portability and a self-documenting design flow. Higher designer productivity is crucial when designing for programmable logic, whose biggest advantage over traditional gate-array devices is faster time-to-market and design flexibility. However from a designer's perspective, quality-of-results is also crucial. The design HAS to achieve the required speed and fit in the target PLD. These goals are achievable through optimal utilization of synthesis.
The programmable logic synthesis software available today, generally takes advantage of the unique features of different programmable logic architectures. But it is also true, that small changes in the HDL coding style (without making it specific to any one PLD vendor) can result in significant improvement in speed and area optimization when targeting PLDs. This article describes some of these optimal HDL coding techniques.
2.0 Optimal HDL Coding Styles
2.1 Using the IF - THEN Construct in VHDL
If the output signals are mutually exclusive the use of ELSEIF statement causes O3 to be dependent on all the states. In most synthesis tools the output O3 is decoded as
Instead if the same code is written as
Most synthesis tools will now remove the priority encoding and decode the output O3 as
2.2 State Machine Coding Styles
This is important to consider when implementing state machines. When targeting a state machine design in a register-rich programmable logic architecture, one-hot encoding is much more efficient in terms of area optimization than binary encoding.
One-hot encoding for state machines uses one register bit per state. This encoding technique uses significantly fewer combinatorial resources than binary encoding, while increasing the number of registers required. However if the designer is targeting a look-up table based PLD in which registers are abundant, one-hot encoding for state machines utilizes fewer look-up tables and provides shorter register-to-register delays than binary encoding.
3.0 Instantiation vs. Inferring Functions
DesignWare functions are technology independent building blocks provided by Synopsys. Synopsys provides additional information on DesignWare at http://www.synopsys.com/products/designware.
The LPM standard was proposed in 1990 as a means to enable efficient mapping of digital designs into divergent technologies such as PLDs, gate arrays, and standard cells. Preliminary versions of the standard appeared in 1991 and again in 1992. The standard was accepted as an Electronic Industries Association (EIA) Interim standard in April 1993 as an adjunct standard to the Electronic Design Interface Format (EDIF). More information on the LPM functions is available at http://www.edif.org/lpmweb.
To demonstrate, let's look at a 32-bit loadable, enabled, up/down counter that is inferred and one that is instantiated.
Inferred Counter
The inferred counter gives satisfactory results. However instead if this counter is instantiated using either a Synopsys DesignWare counter or a LPM_COUNTER there could be considerable improvement in area utilization and registered performance.
Instantiated DesignWare Counter
4.0 Conclusion
Home | Product of the Week | Tech Note | AppReview | Vendor Tools | Feedback
|
|||||||||||||||||||||||||||||||||
|
Copyright © 2003 ChipCenter-QuestLink About ChipCenter-Questlink |
||||||||||||||||||||||||||||||||||