Académique Documents
Professionnel Documents
Culture Documents
Techniques
Part 1
NOTES
Basic HDL Coding Techniques - 2 2008 Xilinx, Inc. All Rights Reserved
NOTES
Remember, you can download a printable PDF version of this module from the FTP site
noted here.
Note: The guidelines in this module are not specific to any particular synthesis
tool or Xilinx FPGA family
Basic HDL Coding Techniques - 3 2008 Xilinx, Inc. All Rights Reserved
NOTES
By the completion of this module, you will be able to list at least two uses for the
Architecture Wizard, identify two features of the Floorplan Editor, and create quality pin
assignments for your Xilinx FPGA.
Basic HDL Coding Techniques - 4 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 5 2008 Xilinx, Inc. All Rights Reserved
NOTES
Applying full and correct constraints refers to applying constraints for all clocks in the
design. Additionally, false paths and multicycle paths should be correctly constrained, as
should the I/O.
The timing closure flow chart was created to help achieve breakthrough performance.
Basic HDL Coding Techniques - 6 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 7 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 8 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 9 2008 Xilinx, Inc. All Rights Reserved
NOTES
Instantiation: Directly referencing a library primitive or macro in your HDL.
Inference: Writing a Register Transfer Level (RTL) description of circuit behavior that the
synthesis tool converts into library primitives.
Why instantiate?
Instantiation is useful when you cannot infer the component. For example, inferring the
DCM component of the Virtex-II FPGA is not possible; hence, instantiating the DCM
block is the only way to use it.
Basic HDL Coding Techniques - 10 2008 Xilinx, Inc. All Rights Reserved
NOTES
Appendix C contains information for specific synthesis tools. (The appendixes are not
included in the printed workbook, but are available via
ftp://ftp.xilinx.com/pub/documentation/education/fpga23000-9-rev1-xlnx_lab_files.zip.)
Basic HDL Coding Techniques - 11 2008 Xilinx, Inc. All Rights Reserved
NOTES
Block
Block
Fewer synthesis IBUF _SSTL2_I
OBUF _GTL
constraints and
attributes to pass on
Keeping most of the
attributes and constraints in the Xilinx User Constraints File (UCF) keeps it simpleone file
contains critical information
Create a separate hierarchical block for instantiating these resources
Above the top-level block, create a Xilinx wrapper with instantiations specific to Xilinx
Instead use VHDL configuration statements or put wrappers around each instantiation
This maintains hierarchy and makes it easy to swap instantiations
Basic HDL Coding Techniques - 12 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 13 2008 Xilinx, Inc. All Rights Reserved
NOTES
To access hierarchy control:
Synplify software: SCOPE Constraints Editor
Synplify also has an additional setting: Maintain hierarchy but allow optimization. This
setting allows combinatorial logic to be optimized while maintaining hierarchy in the netlist
(setting in Synplify is firm).
Precision software: After compiling the design, right-click Modules in the Design Hierarchy
window and select Preserve Hierarchy or Flatten Hierarchy.
XST: Turn on the Advanced Property Display level in the Edit Preferences dialog box.
Then look under Properties for the Synthesize process Synthesis Options tab Keep
Hierarchy.
Basic HDL Coding Techniques - 14 2008 Xilinx, Inc. All Rights Reserved
NOTES
Registering outputs of each leaf-level block is part of the synchronous design techniques
methodology. Registering the output boundaries helps because you know the delays from
one block to the next. That is, the delays are not variable based on combinatorial outputs.
Logic cannot be optimized across a registered boundary. Therefore, if you do register
outputs, you know the delay is minimized from one hierarchical or functional block to the
next and you also know that no logic optimization can occur across hierarchical domains.
In addition to the benefits listed above, preserving hierarchy has the added benefit of
limiting name changes to registersthus, the element names used in a UCF will generally
not change. If you flatten the design, the register and element names and hierarchical path
and references in a flattened design can change from one iteration to the next. In this case,
maintaining the UCF can be quite a burden.
However, preserving hierarchy can prevent register balancing (retiming) and register
duplication. Nevertheless, the benefits of preserving hierarchy generally outweigh the
benefits of flattening except when you have combinatorial outputs.
And in general, preserve hierarchy for large designs. For smaller designs, preserve the
hierarchy if you registered leaf-level outputs; otherwise, you might consider flattening the
design. If you flatten the design, remember the extra burdens of name changes (UCF and
static timing analysis) from one iteration to the next and the limits on floorplanning.
Basic HDL Coding Techniques - 15 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 16 2008 Xilinx, Inc. All Rights Reserved
NOTES
do_e 0
0
do_c 1 0
do_b 1 0 oput
do_a 1
IF (crit_sig) THEN oput <= do_d ; cond_c do_d 1
cond_b
ELSIF cond_a THEN oput <= do_a; cond_a
crit_sig
ELSIF cond_b THEN oput <= do_b;
ELSIF cond_c THEN oput <= do_c;
ELSE oput <= do_e;
END IF;
Basic HDL Coding Techniques - 17 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 18 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 19 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 20 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 21 2008 Xilinx, Inc. All Rights Reserved
NOTES
This synthesized to (3) LUTs and (2) Mux F5 with only 3 logic level delay (1 Lut + 2 F5).
Basic HDL Coding Techniques - 22 2008 Xilinx, Inc. All Rights Reserved
NOTES
This implementation synthesizes to (8) LUTs and (1) mux F5. The worst case path includes
(2) LUTs and (1) mux F5. This is a slower implementation than the binary version (previous
slide) but try this as a 20-to-1 mux. Then you will see significant performance improvement
over
Basic the Coding
HDL OHE. Techniques www.xilinx.com 22
1-877-XLX-CLAS
Other Basic Performance Tips
Basic HDL Coding Techniques - 23 2008 Xilinx, Inc. All Rights Reserved
NOTES
Avoiding inadvertent latch inference can easily be accomplished with default assignments.
Ken Chapman
Basic HDL Coding Techniques - 24 2008 Xilinx, Inc. All Rights Reserved (Xilinx UK) 2003
NOTES
The Spartan devices have been designed with the idea that synchronous design techniques
should be used. Synchronous design techniques will also help the software tools and lead to
higher performance implementations in lower speed grade (lower cost) devices.
All the challenging silicon design problems of balanced (near zero skew) clock trees and
synchronous elements have already been solved by Xilinx when it manufactures the devices.
Because the clock networks exist, and every block can (or has to) be synchronous, make the
most of the device and design synchronously.
Basic HDL Coding Techniques - 25 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 26 2008 Xilinx, Inc. All Rights Reserved
NOTES
VHDL Verilog
FF_AR_CE: process(ENABLE,CLK) always @(posedge CLOCK)
begin if (ENABLE)
if (CLKevent and CLK = 1) then Q = D_IN;
if (ENABLE = 1) then
Q <= D_IN;
end if;
end if;
end process
Basic HDL Coding Techniques - 27 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 28 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 29 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 30 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 31 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 32 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 33 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 34 2008 Xilinx, Inc. All Rights Reserved
NOTES
Basic HDL Coding Techniques - 35 2008 Xilinx, Inc. All Rights Reserved
NOTES
Remember, you can download a printable PDF version of this module from the FTP site
noted here. Note that this module is also included in the appendix of the workbook for the
Designing for Performance course.
Basic HDL Coding Techniques - 36 2008 Xilinx, Inc. All Rights Reserved
NOTES
Please give us your feedback on this module. Simply follow the instructions you see here.
Finally, thanks for listening to this recorded e-Learning on the Architecture Wizard and the
Floorplan Editor. I hope you found this worthwhile. My name is Frank Nelson. I look
forward to meeting you in the Fundamentals of FPGA Design course
Xilinx does not assume any liability arising out of the application or use of the Design; nor does Xilinx convey any license under its patents, copyrights, or any
rights of others. You are responsible for obtaining any rights you may require for your use or implementation of the Design. Xilinx reserves the right to make
changes, at any time, to the Design as deemed desirable in the sole discretion of Xilinx. Xilinx assumes no obligation to correct any errors contained herein or
to advise you of any correction if such be made. Xilinx will not assume any liability for the accuracy or correctness of any engineering or technical support or
assistance provided to you in connection with the Design.
THE DESIGN IS PROVIDED AS IS" WITH ALL FAULTS, AND THE ENTIRE RISK AS TO ITS FUNCTION AND IMPLEMENTATION IS WITH
YOU. YOU ACKNOWLEDGE AND AGREE THAT YOU HAVE NOT RELIED ON ANY ORAL OR WRITTEN INFORMATION OR ADVICE,
WHETHER GIVEN BY XILINX, OR ITS AGENTS OR EMPLOYEES. XILINX MAKES NO OTHER WARRANTIES, WHETHER EXPRESS, IMPLIED,
OR STATUTORY, REGARDING THE DESIGN, INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, TITLE, AND NONINFRINGEMENT OF THIRD-PARTY RIGHTS.
IN NO EVENT WILL XILINX BE LIABLE FOR ANY CONSEQUENTIAL, INDIRECT, EXEMPLARY, SPECIAL, OR INCIDENTAL DAMAGES,
INCLUDING ANY LOST DATA AND LOST PROFITS, ARISING FROM OR RELATING TO YOUR USE OF THE DESIGN, EVEN IF YOU HAVE
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE TOTAL CUMULATIVE LIABILITY OF XILINX IN CONNECTION WITH
YOUR USE OF THE DESIGN, WHETHER IN CONTRACT OR TORT OR OTHERWISE, WILL IN NO EVENT EXCEED THE AMOUNT OF FEES
PAID BY YOU TO XILINX HEREUNDER FOR USE OF THE DESIGN. YOU ACKNOWLEDGE THAT THE FEES, IF ANY, REFLECT THE
ALLOCATION OF RISK SET FORTH IN THIS AGREEMENT AND THAT XILINX WOULD NOT MAKE AVAILABLE THE DESIGN TO YOU
WITHOUT THESE LIMITATIONS OF LIABILITY.
The Design is not designed or intended for use in the development of on-line control equipment in hazardous environments requiring fail-safe controls, such as
in the operation of nuclear facilities, aircraft navigation or communications systems, air traffic control, life support, or weapons systems (High-Risk
Applications). Xilinx specifically disclaims any express or implied warranties of fitness for such High-Risk Applications. You represent that use of the
Design in such High-Risk Applications is fully at your risk.
2008 Xilinx, Inc. All rights reserved. XILINX, the Xilinx logo, and other designated brands included herein are trademarks of Xilinx, Inc. PowerPC is a
trademark of IBM, Inc. All other trademarks are the property of their respective owners.
Basic HDL Coding Techniques - 37 2008 Xilinx, Inc. All Rights Reserved
NOTES