This section describes how to configure FPGA IOBs. You must implement some features manually, but FPGA Compiler performs the following optimization functions automatically.
The following functions apply only to FPGAs with I/O flip-flops.
Indicate which ports in your design to use for chip-level I/Os with the Set Port Is Pad command. The Insert Pads command adds the correct buffers to the ports declared as pads, as shown in the following example.
set_port_is_pad *
insert_pads
This section includes general information about IOBs that applies to all supported device architectures.
FPGA Compiler optimizes any flip-flops connected to an input port into the IOB if the flip-flop or latch does not use the Clock Enable, Direct Clear, or Preset pin.
You can configure the buffered input signal that drives the data input of a storage element as either a flip-flop or a latch. You can use the buffered signal in conjunction with the input flip-flop or latch.
A delay buffer added to the signal feeding the data input of the input flip-flop/latch avoids a possible hold time violation. Instantiating a flip-flop or latch, such as an IFD_F or ILD_1F, removes this delay because these cells include a NODELAY attribute. Refer to the XSI Library Primitives appendix for a complete list of primitives that include NODELAY attributes.
FPGA Compiler has the ability to optimize flip-flops attached to output pad in the IOB. However, FPGA Compiler cannot optimize flip-flops in an IOB configured as a bidirectional pad.
The output buffers have a default slow slew rate that alleviates ground-bounce problems and the option of a fast slew rate that reduces the output delay. The SLOW option increases the transition time and reduces the noise level. The FAST option decreases the transition time and increases the noise level.
Synopsys and Xilinx define slew rate using opposite terms. Synopsys uses slew control, whereas Xilinx uses slew rate. For example, the Synopsys HIGH slew control is equivalent to the Xilinx SLOW slew rate.
The XSI libraries contain two types of output buffers. The default output buffer has a slow slew rate. An additional output buffer with a fast slew rate has a FAST attribute assigned to it, OBUF_F (output buffer) and OBUFT_F (3-state output buffer), also in the XSI libraries. To avoid possible ground-bounce problems, use the default SLOW as the slew rate. Assign a FAST slew rate only to output buffers that require additional speed.
FPGA Compiler V3.3 and later versions use a default slew rate of slow.
To change any output port to a FAST slew rate, use the following command. Replace port with the name of the output port.
set_pad_type -slewrate NONE {port}
Set this command before implementing the Insert Pads commands.
Xilinx Slew Rate | Synopsys Slew Control Attribute | FPGA Compiler Command |
---|---|---|
SLOW | HIGH | set_pad_type -slewrate HIGH {port} |
FAST | NONE | set_pad_type -slewrate NONE {port} |
This section describes XC3000A/L and XC3100A/L IOBs.
Select input thresholds globally with TTL/CMOS. Internal pull-up resistors can optionally attach to the I/O pad. You can make inputs registered or latched. You can select register and latch setup time.
In the default configuration, the input register or latch has positive setup and negative hold time (when used in conjunction with a global clock network). Reducing input setup time produces a small positive hold time.
Registered and latched inputs become available simultaneously with direct input. You have no clock or latch-enable or asynchronous set/reset control on input registers and latches, but you can control the initial state of input registers and latches.
You can select the output driver slew rate. The output driver by default uses a slow slew rate setting to reduce system noise and power. A faster slew rate decreases chip-to-out propagation delay.
You can make outputs tristate and you can register them.
You cannot apply clock-enable or asynchronous set/reset control on output registers but you can control the initial state of output registers.
You cannot use internal pull-up resistors in this mode.
You can select the output driver slew rate. The output driver by default uses a slow slew rate setting to reduce system noise and power. A faster slew rate decreases chip-to-out propagation delay.
Select input thresholds globally with TTL/CMOS. Input can be registered or latched and you can select register and latch setup time.
In the default configuration, the input register or latch has positive setup and negative hold time (when used in conjunction with a global clock network). Reducing input setup time slightly increases hold time.
You cannot apply clock or latch-enable or asynchronous set/reset control on input registers and latches. Direct input enables simultaneous availability of registered and latched input.
You can control the initial state of input registers and latches, and you can register output.
You cannot apply clock-enable or asynchronous set/reset control on output registers, but you can control the initial state of output registers.
This section describes XC4000E/L/EX/XL/XLA/XV IOBs.
Select input thresholds globally with TTL/CMOS. Specify an internal pull-up/pull-down resistor that can optionally attach to an I/O pad.
You can make inputs registered or latched and you can select register and latch setup time.
In the default configuration, the input register or latch has positive setup and zero hold time (when used in conjunction with a global clock network). For XC4000 devices, reducing input setup time slightly increases hold time. For XC4000EX/XL/XLA/XV devices, three setup and hold delay adjustments allow setup versus hold parameter tuning.
Direct input enables simultaneous availability of registered and latched input. You cannot apply asynchronous set/reset control on input registers and latches, but you can apply clocks and latches on input register and latches.
FPGA Compiler cannot infer I/O registers and latches with clock and latch-enables.
You can control the initial state of input registers and latches.
You can select the output driver slew rate. By default the output driver uses a slow slew rate setting to reduce system noise and power. A faster slew rate decreases chip-to-out propagation delay
You can register outputs and make them tristate. You cannot enable asynchronous set/reset control on output registers, but you can specify clock-enable on output registers. FPGA Compiler cannot infer I/O registers and latches with clock and latch enables.
You can control the initial state of output registers.
Perform 2-to-1 multiplexing or 2-input function directly in the output path of an IOB (XC4000EX/XL/XV only). You can trade an output register for a 2-input function or multiplexer. Additionally, you must instantiate the following primitives (valid for XC4000EX/XL/XLA/XV/XLT). See the XSI Library Primitives appendix for more details.
FPGA Compiler cannot infer output drivers containing a 2-input function or output multiplexer.
You can select the output driver slew rate. By default the output driver uses a slow slew rate setting to reduce system noise and power. Faster slew rates decrease chip-to-out propagation delay.
Select input thresholds globally with TTL/CMOS. Input can be registered or latched and you can select register and latch setup time.
In the default configuration, the input register or latch has positive setup and negative hold time (when used in conjunction with a global clock network). This corresponds to a full delay. Reducing input setup time slightly increases hold time.
You cannot enable asynchronous set/reset control on input registers and latches. Direct input makes registered and latched input available simultaneously.
You can specify clock and latch-enable on input registers and latches. FPGA Compiler cannot infer I/O registers or latches with clock or latch enables.
You can control initial states of I/O registers and latches. You can register output.
You cannot enable asynchronous set/reset control on output registers, but you can specify clock-enable on output registers. FPGA Compiler cannot infer I/O registers and latches with clock or latch enables.
You can control the initial state of output registers.
Perform 2-to-1 multiplexing or 2-input function directly in the output path of an IOB. You can trade an output register for a 2-input function or multiplexer. FPGA Compiler cannot infer output drivers containing 2-input functions or output multiplexers. Additionally, you must instantiate the OMUX2, ONADN2, ONOR2, and OOR2 primitives. See the XSI Library Primitives appendix for more details.
This section describes XC5200 IOBs.
Select input thresholds globally with TTL/CMOS. Specify an internal pull-up/pull-down resistor that can optionally attach to an I/O pad.
IOBs can contain no input registers, although you can emulate this functionality using the latch/flip-flop in the adjacent CLB. Additionally, CLB registers and latches have clock or latch-enables and asynchronous reset inputs.
The IOB input path has an optional delay with which you can adjust input setup and hold times. By default an input register or latch has a positive setup and negative hold time (when used in conjunction with a global clock network). Reducing input setup time slightly increases hold time.
You can select the output driver slew rate. By default the output driver uses a slow slew rate setting to reduce system noise and power. A faster slew rate decreases chip-to-out propagation delay.
You can make outputs tristate.
IOBs contain no output registers, although you can emulate this functionality using the latch or flip-flop in the adjacent CLB. Additionally, CLB registers and latches have clock or latch-enables and asynchronous reset inputs.
Select input thresholds globally with TTL/CMOS. Have an internal pull-up/pull-down resistor that can optionally attach to an I/O pad.
IOBs contain no input registers, although you can emulate this functionality using the latch/flip-flop in the adjacent CLB. Additionally, CLB registers and latches have clock or latch-enables and asynchronous reset inputs.
The IOB input path has an optional delay with which you can adjust input setup and hold times. By default the input register or latch has a positive setup and negative hold time (when used in conjunction with a global clock network). Reducing input setup time slightly increases hold time.
You can select the output driver slew rate. By default the output driver uses a slow slew rate setting to reduce system noise and power. A faster slew rate decreases chip-to-out propagation delay.
You can make outputs tristate.
IOBs contain no output registers, although you can emulate this functionality using the latch or flip-flop in the adjacent CLB. Additionally, CLB registers and latches have clock or latch-enables and asynchronous reset inputs.
You can specify pad locations in your synthesis script or in a Xilinx User Constraints File (UCF). To assign pad locations in your synthesis DC script, include the following command in your script, replacing pad and pin number with the appropriate values.
set_attribute pad pad_location \
-type string pin number
Refer to The Programmable Logic Data Book, available on the Xilinx Web site at (http://www.xilinx.com), for the locations and name of the pins. For more information on the UCF, refer to the Development System Reference Guide or the Libraries Guide.
FPGA Compiler infers the use of 3-state output flip-flops, such as OFDT, under the following two conditions.
The following sections illustrate a flip-flop that does not directly drive the 3-state signal and one that does directly drive the 3-state signal.
If any logic exists between the flip-flop and the 3-state signal connected to the output flip-flop, FPGA Compiler does not infer a 3-state output flip-flop. The following VHDL and Verilog examples illustrate a flip-flop not directly driving a 3-state output flip-flop. The No Output Register Inferred figure shows a schematic representation.
The three_ex1 VHDL example follows.
library IEEE;
The three_ex1 Verilog example follows.
module three_ex1(BUS_IN, EN, CLK, BUS_OUT);
Figure 3.1 No Output Register Inferred |
The HDL code for the flip-flop must reside in the same process as the 3-state HDL code and must directly drive the 3-state output, as shown in the sync process in the following VHDL and Verilog examples. If the code meets these two conditions, FPGA Compiler infers a registered 3-state output, as illustrated by the Output Register Inferred figure.
Having the flip-flop and the 3-state signal in separate processes causes the insertion of additional logic between the flip-flop and the 3-state signal.
The three_ex2 VHDL example follows.
library IEEE;
The three_ex2 Verilog example follows.
module three_ex2(BUS_IN, EN, CLK, BUS_OUT) ;
Figure 3.2 Output Register Inferred |
FPGA Compiler has the ability to insert non-registered bidirectional ports. Describe the 3-state signal that drives the output buffer in the same hierarchy level as the input signal, as in the bidi_reg.vhd and bidi_reg.v examples in the following section.
The top-level design examples bidi_reg.vhd and bidi_reg.v instantiate a core design, reg4. In these examples, two clock buffers, CLOCK1 and CLOCK2, automatically infer a BUFG buffer. The reset and load signals, RST and LOADA, automatically infer an IBUF when you run the Set Port Is Pad and Insert Pads commands. However, FPGA Compiler cannot automatically infer the OFDT_F (3-state registered output buffers with a FAST slew rate) cells in bidirectional I/Os. Therefore, these cells and the IBUF instantiate into the top-level design.
The bidi_reg.vhd VHDL example follows.
library IEEE;
The bidi_reg.v Verilog example follows.
module bidi_reg (SIGA, LOADA, CLOCK1, CLOCK2, RST) ;
The backslash (\) character shows a line break required for formatting purposes.
Do not use the Set Port Is Pad command for the instantiated I/O cells. For example, in the bidi_reg.vhd example, use the following commands to insert the I/Os for the LOADA, RST, CLOCK1, and CLOCK2 signals only.
set_port_is_pad {LOADA RST CLOCK1 CLOCK2}
insert_pads
Before compiling the design, you must place a Dont Touch attribute on any instantiated I/O cells to prevent their alteration, as shown in the following example.
dont_touch {U0 U1 U2 U3 U6 U7 U8}
The following example shows the script files used to compile bidi_reg.vhd and bidi_reg.v.
The script file for bidi_reg.vhd example follows.
/* =============================================== */
The script file for bidi_reg.v example follows.
In some package and device pairs, not all pads bond to a package pin. You can use these unbonded IOBs and the flip-flops inside them in your design by instantiating them in the HDL code. However, Synopsys cannot infer unbonded primitives.
A _U suffix indicates unbounded primitives. Refer to the XSI Library Primitives appendix for a complete listing of all unbonded cells.
You can apply pull-up and pull-down resistors to chip-level I/O ports and you can use them internally. Use the following command to attach pull-up or pull-down resistors to I/O ports before you issue the Insert Pads command.
set_pad_type {-pullup | -pulldown} port_name
You can only instantiate internal pull-up and pull-down resistors. The following table shows which devices require pull-up/pull-down resistors.
XC3000A/L | XC4000E/L | XC4000EX/XL/XLA/XV | XC5200 |
---|---|---|---|
Pull-up | Pull-up/ Pull-down | Pull-up/ Pull-down | Pull-up/ Pull-down |
Refer to the XSI Library Primitives appendix for a listing of all cells and their pin names for instantiation.
See the Configuring IOBs section in this chapter for more information on pull-up and pull-down resistors for a specific device family.
The input flip-flops and latches have a default delay preceding the data to the input flip-flop or latch. This delay prevents any possible hold-time violations if you have a clock signal that also comes into the device and clocks the input flip-flop or latch.
You can remove this delay by instantiating a cell that includes the NODELAY attribute if you need additional input speed and have no possibility of a hold-time violation. The XSI Library Primitives appendix lists all cells that include a NODELAY attribute. Input flip-flops or latches with an _F suffix have a NODELAY attribute assigned to the cell.
You can initialize IOB flip-flops to either Clear or Preset in XC3000A/L and XC4000E/L/EX/XL/XV FPGAs. The default is Clear. To initialize an I/O flip-flop or latch to Preset, use the following command to attach an INIT=S attribute to the flip-flop.
set_attribute register_name xnf_init \
S type string
Replace register_name with the name of the I/O flip-flop.
You can instantiate I/O cells with the INIT=S attribute already assigned to them. Refer to the XSI Library Primitives appendix for a list of all cells and their pin names for instantiation.