Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2005 Xilinx, Inc. All Rights Reserved This material exempt per Department of Commerce license exception TSU Synthesis Techniques.

Similar presentations


Presentation on theme: "© 2005 Xilinx, Inc. All Rights Reserved This material exempt per Department of Commerce license exception TSU Synthesis Techniques."— Presentation transcript:

1 © 2005 Xilinx, Inc. All Rights Reserved This material exempt per Department of Commerce license exception TSU Synthesis Techniques

2 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 3 Objectives Select a proper coding style to create efficient FPGA designs Specify Xilinx resources that need to be instantiated for various FPGA synthesis tools Identify synthesis tool options that can be used to increase performance Describe an approach to using your synthesis tool to obtain higher performance After completing this module, you will be able to:

3 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 4 Timing Closure

4 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 5 Outline Coding Tips Instantiating Resources Synthesis Options Summary Appendix – Inferring Logic and Flip-Flop Resources – Inferring Memory – Inferring I/Os and Global Resources

5 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 6 Simple Coding Steps Yield 3x Performance Use pipeline stages—more bandwidth Use synchronous reset—better system control Use Finite State Machine optimizations Use inferable resources – Multiplexer – Shift Register LUT (SRL) – Block RAM, LUT RAM – Cascade DSP Avoid high-level constructs (loops, for example) in code – Many synthesis tool produce slow implementations See the Synthesis and Verification Design Guide : toolbox.xilinx.com/docsan/xilinx8/books/docs/sim/sim.pdf

6 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 7 Synthesis Guidelines Use timing constraints – Define tight but realistic individual clock constraints – Put unrelated clocks into different clock groups Use proper options and attributes – Turn off resource sharing – Move flip-flops from IOBs closer to logic – Turn on FSM optimization – Use the retiming option

7 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 8 Basic Performance Tips Avoid high-level loop constructs – Synthesis tools may not produce optimal results Avoid nested if-then-else statements – Most tools implement these in parallel; however, multiple nested if-then-else statements can result in priority encoded logic Use case statements for large decoding – Rather than if-then-else Order and group arithmetic and logical functions and operators – A <= B + C + D + E; should be: A <= (B + C) + (D + E) Avoid inadvertent latch inference – Cover all possible outputs in every possible branch Easily done by making default assignments before if-then-else and case

8 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 9 Targeting Xilinx Some resources must be instantiated or create an IP core (Architecture Wizard and CORE Generator™ software) – FIFO16, ISERDES, OSERDES, and clock resources Certain resources require specific coding – DSP48 registers have synchronous set/reset only – Distributed RAM/ROM and SRL do not have set or reset functionality after configuration Synchronous resets are preferred over asynchronous reset – Xilinx FPGAs have a configuration reset (GSR) that is used during the configuration stage to bring up the FPGA in a known state GSR is also accessible to designers after configuration through the STARTUP block No need for asynchronous initialization power-on reset

9 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 10 State Machine Design Put the next-state logic in one CASE statement – The state register can also be included here or in a separate process block or always block Put the state machine outputs in a separate process or always block – Prevents resource sharing, which can hurt performance S1 S5 S4 S3 S2 State Machine Module Inputs to FSM Next-state logic State register State machine outputs HDL Code

10 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 11 The Perfect State Machine The perfect state machine has: – Inputs: Input signals and state jumps – Outputs: Output states and control and enable signals to the rest of the design – NO arithmetic logic, datapaths, or combinatorial functions inside the state machine State Jumps Only! Input Signals Next State Current State Feedback to Drive State Jumps State Register Output State and Enables

11 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 12 State Machine Encoding Use enumerated types to define state vectors (VHDL) – Most synthesis tools have commands to extract and re-encode state machines described in this way Use one-hot encoding for high-performance state machines – Uses more registers, but simplifies next-state logic – Experiment to discover how your synthesis tool chooses the default encoding scheme Register state machine outputs for higher performance

12 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 13 Coding Flip-Flops Control signal precedence: Clear, Preset, Clock Enable VHDL FF_AR_CE: process(CLK) begin if (CLK’event and CLK = ‘1’) then if (RST = ‘1’) then Q <= ‘0’; elsif (SET = ‘1’) then Q <= ‘1’; elsif (CE = ‘1’) then Q <= D_IN; end if; end process Verilog always @(posedge CLK) if (RST) Q <= 1’b0; else if (SET) Q <= 1’b1; else if (CE) Q <= D_IN;

13 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 14 Outline Coding Tips Instantiating Resources Synthesis Options Summary Appendix – Inferring Logic and Flip-Flop Resources – Inferring Memory – Inferring I/Os and Global Resources

14 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 15 Instantiation versus Inference Instantiate a component when you must dictate exactly which resource is needed – The synthesis tool is unable to infer the resource – The synthesis tool fails to infer the resource Xilinx recommends inference whenever possible – Inference makes your code more portable Xilinx recommends using the CORE Generator™ software system to create functions such as Arithmetic Logic Units (ALUs), fast multipliers, and Finite Impulse Response (FIR) filters for instantiation

15 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 16 Instantiation Tips Use instantiation only when accessing device features, increasing performance, or decreasing area is necessary – Exceptions are noted at the end of this section Limit the location of instantiated components to a few source files to make locating these components easier when porting the code

16 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 17 FPGA Resources Can be inferred by all synthesis tools: – Shift register LUT (SRL16/ SRLC16) – F5, F6, F7, and F8 multiplexers – Carry logic – MULT_AND – MULT18x18/MULT18x18S – Global clock buffers (BUFG) – SelectIO™ (single-ended) standard – I/O registers (single data rate) – Input DDR registers Can be inferred by some synthesis tools: – Memories (ROM/RAM) – Global clock buffers (BUFGCE, BUFGMUX, BUFGDLL) Cannot be inferred by any synthesis tools: – SelectIO (differential) standard – Output DDR registers – DCM

17 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 18 Suggested Instantiation Xilinx recommends that you instantiate the following elements: – Memory resources Block RAMs specifically (use the CORE Generator™ software system to build large memories) – SelectIO  standard resources – Clock management resources DCM (use the Architecture Wizard) IBUFG, BUFG, BUFGMUX, and BUFGCE

18 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 19 Suggested Instantiation Why does Xilinx suggest this? – Easier to change (port) to other and newer technologies – Fewer synthesis constraints and attributes to pass on Keeping most of the attributes and constraints in the Xilinx User Constraints File (UCF) keeps it simple—one file contains critical information Create a separate hierarchical block for instantiating these resources – Above the top-level block, create a Xilinx “wrapper” with Xilinx-specific instantiations Top-Level Block Top-Level Block BUFG DCM IBUFG Xilinx “wrapper” top_xlnx IBUF_SSTL2_IOBUF_GTL STARTUP

19 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 20 Outline Coding Tips Instantiating Resources Synthesis Options Summary Appendix – Inferring Logic and Flip-Flop Resources – Inferring Memory – Inferring I/Os and Global Resources

20 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 21 Synthesis Options There are many synthesis options that can help you obtain your performance and area objectives: – Timing-Driven Synthesis – FSM Extraction – Retiming – Register Duplication – Hierarchy Management – Resource Sharing – Physical Optimization XST Constraints are entered in a.xcf file

21 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 22 Timing-Driven Synthesis Synplify, Precision, and XST software Timing-driven synthesis uses performance objectives to drive the optimization of the design – Based on your performance objectives, the tools will try several algorithms to attempt to meet performance while keeping the amount of resources in mind – Performance objectives are provided to the synthesis tool via timing constraints

22 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 23 FSM Extraction Finite State Machine (FSM) extraction optimizes your state machine by re-encoding and optimizing your design based on the number of states and inputs – By default, the tools will use FSM extraction Safe state machines – Be default, the synthesis tools will remove all decoding for illegal states Even if you include VHDL “when others” or Verilog “default” cases – Must be turned on to use “safe” FSM implementation See Notes for more information

23 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 24 Retiming Synplify, Precision, and XST software Retiming: The synthesis tool automatically tries to move register stages to balance combinatorial delay on each side of the registers DQDQDQ Before Retiming After Retiming DQDQDQ

24 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 25 Register Duplication Synplify, Precision, and XST software Register duplication is used to reduce fanout on registers (to improve delays) Register duplication of the output 3-state register is used so that the IOB 3-state register can be moved inside the IOB to reduce clk-to-output delays Xilinx recommends manual register duplication – Most synthesis vendors create signals _rep0, _rep1, etc. Implementation tools pack these signals into the same slice This can prohibit a register from being moved closer to its destination – When manually duplicating registers, do not use a number at the end Example: _0dup, _1dup – Use synthesis options to prevent duplicate registers from being re-merged

25 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 26 Hierarchy Management The basic settings are: – Flatten the design: Allows total combinatorial optimization across all boundaries – Maintain hierarchy: Preserves hierarchy without allowing optimization of combinatorial logic across boundaries If you have followed the synchronous design guidelines, use the setting - maintain hierarchy If you have not followed the synchronous design guidelines, use the setting - flatten the design Your synthesis tool may have additional settings – Refer to your synthesis documentation for details on these settings

26 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 27 Hierarchy Preservation Benefits Easily locate problems in the code based on the hierarchical instance names contained within static timing analysis reports Enables floorplanning and incremental design flow The primary advantage of flattening is to optimize combinatorial logic across hierarchical boundaries – If the outputs of leaf-level blocks are registered, there is no need to flatten

27 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 28 Schematic Viewers Allows you to view synthesis results graphically – Check the number of logic levels between flip-flops – Locate net and instance names quickly – View the design as generic RTL or technology-specific components Works best when hierarchy has been preserved during synthesis

28 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 29 Physical Optimization Synplicity Amplify FPGA Physical Optimizer or Mentor Precision Physical software (add-on tools) Based on the critical paths in the design, the tools will attempt to optimize and physically locate the associated logic closely together to minimize the routing delays Essentially, this is a way to provide critical path information to the synthesis tool so that it can attempt to further optimize those paths

29 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 30 Increasing Productivity Use synchronous design techniques Preserve hierarchy during synthesis – Aids in debugging and cross-referencing to report files Use timing-driven synthesis if your tool supports it – Check the synthesis report for performance estimates After implementation, look at timing reports and identify critical paths – Double-check the HDL coding style for these paths – Try some of the synthesis options discussed earlier For paths that continually fail to meet timing, add path-specific constraints during synthesis – Add corresponding path-specific constraints for implementation

30 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 31 Outline Coding Tips Instantiating Resources Synthesis Options Summary Appendix – Inferring Logic and Flip-Flop Resources – Inferring Memory – Inferring I/Os and Global Resources

31 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 32 Summary Your HDL coding style can affect synthesis results Infer functions whenever possible Use one-hot encoding to improve design performance When coding a state machine, separate the next-state logic from the state machine output equations Most resources are inferable, either directly or with an attribute Take advantage of the synthesis options provided to help you meet your timing objectives Use synchronous design techniques and timing-driven synthesis to achieve higher performance

32 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 33 Where Can I Learn More? Synthesis & Simulation Design Guide – www.xilinx.com  Documentation  Software Manuals User Guides – www.xilinx.com  Documentation  User Guides Technical Tips – www.xilinx.com  Support  Tech Tips – Click Xilinx Synthesis Technology, Synopsys FPGA and Design Compiler, or Synplicity Synthesis documentation or online help

33 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 34 Outline Coding Tips Instantiating Resources Synthesis Options Summary Appendix – Inferring Logic and Flip-Flop Resources – Inferring Memory – Inferring I/Os and Global Resources

34 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 35 Shift Register LUT (SRL16) Synplify, Precision, and XST To infer the Shift Register LUT (SRL), the code must have the following primary characteristics: – No set or reset signal – Serial-in, serial-out SRLs can be initialized on power-up via an INIT attribute in the Xilinx User Constraints File (UCF)

35 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 36 SRL16E Example VHDL: process(clk) begin if rising_edge(clk) then if ce = ‘1’ then sr <= din & sr(0 to 14); end if; end process; dout <= sr(15); Verilog: always @ (posedge clk) begin if (ce) sr = {din, sr[0:14]}; end assign dout = sr[15];

36 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 37 Dynamically Addressable SRL Synplify, Precision, and XST SRL16/SRL16E and SRLC16/SRLC16E – SRLC16 has two outputs in Virtex™-II devices: q15 - final output and q - dynamically addressable output

37 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 38 SRLC16E Example VHDL: process(clk) begin if rising_edge(clk) then if CE = ‘1’ then sr <= din & sr(0 to 14); end if; end process; dout <= sr(15); dynamic_out <= sr(addr); Verilog: always @ (posedge clk) begin if (ce) sr <= {din, sr[0:14]}; end assign dout = sr[15]; assign dynamic_out = sr[addr];

38 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 39 Virtex-II Device Multiplexers Synplify, Precision, and XST F5MUX, F6MUX, F7MUX, F8MUX primitives – Dedicated multiplexers in the CLB of the Virtex™-II device – Only F5 and F6 available in the Virtex family – 4:1 multiplexer will use one slice – 16:1 multiplexer will use four slices (One Virtex-II FPGA CLB) – 32:1 multiplexer will use eight slices No attribute needed—inferred automatically data(2) F5MUX LUT F6MUX data(0) data(1) data(3) data(4) data(5) data(6) data(7) muxout

39 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 40 VHDL: process(sel, data) begin case (sel) is when “000” => out <= data(0); when “001” => out <= data(1); when “010” => out <= data(2); when “011” => out <= data(3); when “100” => out <= data(4); when “101” => out <= data(5); when “110” => out <= data(6); when “111” => out <= data(7); when others => out <= ‘0’; end case; end process; F5MUX and F6MUX Example Verilog: always @ (sel or data) case(sel) 3'b000: muxout = data[0]; 3'b001: muxout = data[1]; 3'b010: muxout = data[2]; 3'b011: muxout = data[3]; 3'b100: muxout = data[4]; 3'b101: muxout = data[5]; 3'b110: muxout = data[6]; 3'b111: muxout = data[7]; default : muxout = 0; endcase

40 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 41 Flip-Flop Set and Reset Conditions When using asynchronous set and asynchronous reset, reset has priority When using synchronous set and synchronous reset, reset has priority When using any combination of asynchronous set or reset with synchronous set or reset: – Asynchronous set or reset has priority (furthermore, reset has highest priority) – In this mode, the synchronous set, reset, or both is implemented in the LUT – The priority of the synchronous set versus synchronous reset is defined by how the HDL is written

41 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 42 Flip-Flop Example VHDL: process(clk, reset, set) begin if (reset = ‘1’) then q <= ‘0’; elsif (set = ‘1’) then q <= ‘1’; elsif rising_edge(clk) then if (sync_set = ‘1’) then q <= ‘1’; elsif (sync_reset = ‘1’) then q <= ‘0’; elsif (ce = ‘1’) then q <= d; end if; end process; Verilog: always @ (posedge clk or posedge reset or posedge set) if (reset) q <= 0; else if (set) q <= 1; else if (sync_set) q <= 1; else if (sync_reset) q <= 0; else if (ce) q <= d; end

42 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 43 Carry Logic Synplify, Precision, and XST Synthesis maps directly to the dedicated carry logic Access carry logic through adders, subtractors, counters, comparators (>15 bits), and other arithmetic operations – Adders and subtractors (SUM <= A + B) – Comparators (if A < B then) – Counters (COUNT <= COUNT + 1) Note: Carry logic will not be inferred if arithmetic components are built with gates – For example: XOR gates for addition and AND gates for carry logic will not infer carry logic

43 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 44 Carry Logic Examples VHDL: count <= count + 1 when (addsub = ‘1’) else count - 1; if (a >= b) then a_greater_b <= ‘1’; product <= constant * multiplicand; Verilog: assign count = addsub ? count + 1: count - 1; if (a >= b) a_greater_b = 1; assign product = constant * multiplicand;

44 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 45 MULT18x18 Synplify, Precision, and XST Synplicity infers MULT18x18 by default – To use MULT_18x18 set syn_multstyle to “block_mult” (default) Possible values are “block_mult” and “logic”

45 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 46 Synplicity set: syn_multstyle to logic CLB MULT_AND Synplify, Precision, and XST B y+1 A x-1 B y A x DICI LO S MUXCY_L LI CI LO XORCY_L MULT_AND LUT

46 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 47 Multiplier Example VHDL: library ieee; use ieee.std_logic_signed.all; use ieee.std_logic_unsigned.all; … process (clk, reset) begin if (reset = ‘1’) then product ‘0’); elsif rising_edge(clk) then product <= a * b; end if; end process; Verilog: always @ ( posedge clk or posedge reset) begin if (reset) product <= 0; else product <= a * b; end

47 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 48 Outline Coding Tips Instantiating Resources Synthesis Options Summary Appendix – Inferring Logic and Flip-Flop Resources – Inferring Memory – Inferring I/Os and Global Resources

48 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 49 Block SelectRAM Synplify, Precision, and XST Synplicity: Set the attribute syn_ramstyle to “block_ram” Other requirements: – Place the attribute on the output signal that is driven by the inferred RAM – Requires synchronous write – Requires registered read address – Dual-port RAM is inferred if read or write address index is different XST: Based on the size and characteristics of the code, XST can automatically select the best style – Available settings: Auto, Block, and Distributed

49 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 50 Block RAM Inference Notes Synplify, Precision, and XST Synthesis tools cannot infer: – Dual-port block RAMs with configurable aspect ratios Ports with different widths – Block RAMs with enable or reset functionality Always enabled Output register cannot be reset Exception: Synplify Pro software 7.6 can infer reset – Dual-port block RAMs with read and write capability on both ports Block RAMs with read capability on one port and write on the other port can be inferred – Dual-port functionality with different clocks on each port These limitations on inferring block RAMs can be overcome by creating the RAM with the CORE Generator™ system or instantiating primitives

50 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 51 Block RAM Example VHDL: signal mem: mem_array; attribute syn_ramstyle of mem: signal is “block_ram”; … process (clk) begin if rising_edge(clk) then addr_reg <= addr; if (we = ‘1’) then mem(addr) <= din; end if; end process; dout <= mem(addr); Verilog: reg [31:0] mem[511:0] /*synthesis syn_ramstyle = “block_ram”*/; always @ ( posedge clk) begin addr_reg <= addr; if (we) mem[addr] <= din; end assign dout = mem[addr_reg];

51 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 52 Distributed SelectRAM Synplify, Precision, and XST Each LUT can implement a 16x1-bit synchronous RAM Automatic inference when code is written with two requirements: – Write must be synchronous – Read must be asynchronous However, if the read address is registered, the SelectRAM  memory can be inferred and will be driven by a register – Synplicity: Automatically used; turn off by setting the following attribute: syn_ramstyle = registers or block_ram – XST: Specify block or distributed RAM or let XST automatically select the best implementation style

52 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 53 Distributed RAM Example VHDL: signal mem: mem_array; … process (clk) begin if rising_edge(clk) then if (we = ‘1’) then mem(addr) <= din; end if; end process; dout <= mem(addr); Verilog: reg [7:0] mem[31:0]; always @ ( posedge clk) begin if (we) mem[addr] <= din; end assign dout = mem[addr];

53 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 54 ROM Synplify, Precision, and XST Synplicity: Infer ROM primitives with an attribute – Set syn_romstyle to select_rom – Otherwise, Synplify infers a LUT primitive with equations Same implementation, except it is not a ROM primitive XST automatically maps to ROM primitives

54 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 55 Distributed ROM Example VHDL: type rom_type is array(7 downto 0) of std_logic_vector(1 downto 0); constant rom_table: rom_type := (“10”, “00”, “11”, “01”, “11”, “10”, “01”, “00”); attribute syn_romstyle: string; attribute syn_romstyle of rom_table: signal is “select_rom”; … rom_dout <= rom_table(addr); Verilog: reg [1:0] rom_dout /*synthesis syn_romstyle = “select_rom”*/; always @ ( addr) case (addr) 3’b000: rom_dout <= 2’b00; 3’b001: rom_dout <= 2’b01; 3’b010: rom_dout <= 2’b10; 3’b011: rom_dout <= 2’b11; 3’b100: rom_dout <= 2’b01; 3’b101: rom_dout <= 2’b11; 3’b110: rom_dout <= 2’b00; 3’b111: rom_dout <= 2’b10; endcase

55 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 56 Outline Coding Tips Instantiating Resources Synthesis Options Summary Appendix – Inferring Logic and Flip-Flop Resources – Inferring Memory – Inferring I/Os and Global Resources

56 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 57 SelectIO Standard Synplify, Precision, and XST Instantiate in HDL code (required for differential I/O) – For a complete list of buffers, see the following elements in the Libraries Guide : IBUF_selectIO, IBUFDS IBUFG_selectIO, IBUFGDS IOBUF_selectIO OBUF_selectIO, OBUFT_selectIO, OBUFDS, OBUFTDS Synplicity: Use attribute in HDL code Specify in the UCF or XST Constraints File (XCF) Use the Xilinx Constraints Editor – In the Ports tab, check the I/O Configuration Options box

57 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 58 SelectIO Standard Verilog: – Instantiate the I/O primitive (buffer or flip-flop) – Use parameter passing VHDL: – Instantiate the I/O primitive (buffer or flip-flop) – Use a generic

58 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 59 SelectIO Standard Example VHDL: ibuf_data_in_inst: IBUF generic map (IOSTANDARD = “HSTL_III”) port map (I => data_in, O => data_in_i); Verilog: /* For primitive instantiations in Verilog you must use UPPERCASE for the primitive name and port names */ IBUF #(.IOSTANDARD(“HSTL_III”) ) ibuf_data_in_inst (.I(data_in),.O(data_in_i));

59 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 60 IOB Registers Synplify, Precision, and XST For single data rate I/O registers: – Set Map Process Properties  Pack I/O Registers/Latches into IOBs – Use the IOB = TRUE attribute in the UCF Example: INST IOB = TRUE; – Synplicity: Automatically packs registers into IOBs based on timing To override default behavior, use the syn_useioff attribute – XST: Automatically packs registers in the IOBs based on timing To override default behavior, under Synthesize  Properties  Xilinx Specific Options tab  Pack I/O Registers into IOBs  Auto, Yes, or No

60 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 61 IOB Register Limitations All registers that are packed into the same IOB must share the same set or reset signal Output and 3-state enable registers that are packed into the same IOB must share the same clock signal Output and 3-state enable registers must have a fanout of one – Synplicity automatically replicates 3-state enable registers to enable packing into IOBs Output 3-state enables must be active LOW

61 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 62 I/O Register Example VHDL: process(clk, reset) begin if (reset = ‘1’) then data_in_i <= ‘0’; data_out <= ‘0’; out_en <= ‘1’; elsif rising_edge(clk) then data_in_i <= data_in; out_en <= out_en_i; if (out_en = ‘0’) then data_out <= data_out_i; end if; end process; Verilog: always @ (posedge clk or posedge reset) if (reset) begin data_in_i <= 0; data_out <= 0; out_en <= 1; end else begin data_in_i <= data_in; out_en <= out_en_i; if (~out_en) data_out <= data_out_i; end

62 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 63 DDR Registers Synplify, Precision, and XST Input double data rate registers can be inferred – Data input must come from a top-level port – DDR registers must use CLK (NOT CLK) with 50-percent duty cycle or DLL outputs CLK0 and CLK180 – Standard flip-flops are inferred during synthesis, but MAP will move them into the IOB Output double data rate registers must be instantiated – See the following elements in the Libraries Guide : OFDDRCPE, OFDDRRSE (for output or 3-state enable flip-flops) OFDDRTCPE, OFDDRTRSE (for output flip-flops)

63 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 64 Input DDR Register Example VHDL: process(clk) begin if (rising_edge(clk)) then data_in_p <= data_in; end if; end process; process(clk) begin if (falling_edge(clk)) then data_in_n <= data_in; end if; end process; Verilog: always @ (posedge clk) data_in_p <= data_in; always @ (negedge clk) data_in_n <= data_in;

64 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 65 Global Buffers BUFG – All synthesis tools will infer on input signals that drive the clock pin of any synchronous element BUFGDLL – Synplicity: Can be inferred through synthesis by setting attribute xc_clockbuftype = BUFGDLL – XST: Must instantiate

65 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 66 DCM Digital Clock Manager – Clock deskew – Frequency synthesis – Phase shifting Must be instantiated – Port names are as shown in the diagram

66 © 2005 Xilinx, Inc. All Rights Reserved For Academic Use Only Synthesis 67 STARTUP_VIRTEX2 Provides three functions: – Global Set/Reset (GSR) – Global Three-State (GTS) for output pins – User-defined configuration clock to synchronize configuration startup sequence Must be instantiated – Port names are GSR, GTS, and CLK Note: Using GSR is not recommended for Virtex™-II device designs – Normal routing resources are faster and plentiful


Download ppt "© 2005 Xilinx, Inc. All Rights Reserved This material exempt per Department of Commerce license exception TSU Synthesis Techniques."

Similar presentations


Ads by Google