Using the GPIO Block

This block defines the functionality of the general-purpose I/O (GPIO) pins. The mode you select determines the GPIO capabilities and which settings you can configure. GPIO modes are: input, output, inout, clkout, and none.

You can assign GPIO to dedicated GPIO resources or to LVDS resources. When you use LVDS resources as GPIO, some features are unavailable, depending on the FPGA. When you check the interface design, the software compares your selections to the resource you assigned to the GPIO block. If the resource does not support your selection(s), the software reports it.

Create a GPIO

To create a new GPIO block, select GPIO in the Design Explorer and then click the Create Block button.

  1. Specify the instance name.
  2. Choose the Mode (input, output, inout, clkout, or none).
  3. Set the options as described in the following sections.
  4. Assign a resource for the signal using the Resource Assigner.
Note: You can set the default state of unused GPIO. Click the GPIO(n) category under Design Explorer. In the Block Editor to the right, select the unused state (input with weak pull up or input with weak pull down).
Note: When using LVDS pins as GPIO, make sure to leave at least 2 pairs of unassigned LVDS pins between any GPIO and LVDS pins in the same bank. This separation reduces noise. The Efinity software issues an error if you do not leave this separation.

Input Mode

Use input mode for input signals.

Table 1. Input Mode Options
Option Choices Description
Connection Type
normal, gclk, gctrl, pll_clkin, mipi_clkin
Some pins have alternate functions, and you use this option to choose the function. (This option only applies to pins that have alternate functions. Refer to the data sheet for your FPGA for pin information.) For example, a PLL can use a GPIO with an alternate connection type as a reference clock.
Note: If you set the connection type to pll_clkin or mipi_clkin, the signal is also available as a regular input to the core.
Register Option register, none Choose whether the input is registered.
For FPGAs that have DDIO, if you choose register:
  • Define an input clock pin name.
  • Turn clock inversion on or off.
  • Under Double Data I/O Option, select one of the following:
    none Do not use double data I/O.
    normal Data is passed to the core on both the positive and negative clock edges
    resync Data is resynchronized to pass both data signals on the positive clock edge. <pin name>_hi is the positive edge and <pin name>_lo is the negative edge.
Pull Option none, weak pullup, weak pulldown Specify if you want a pull option.
Enable Schmitt Trigger On or off Optionally enable a Schmitt trigger.

Output Mode

Use output mode for output signals.

Table 2. Output Mode Options
Option Choices Description
Constant Output none, 1, 0 Choose whether the output is VCC (1) or GND (0). Otherwise, leave this option as none.
Register Option none, register, inv_register Choose whether the output is registered or has an inverted register.
For FPGAs that have DDIO, if you choose register:
  • Define an output clock pin name.
  • Turn clock inversion on or off.
  • Under Double Data I/O Option, select one of the following:
    none Do not use double data I/O.
    normal Data is passed to the core on both the positive and negative clock edges
    resync Data is resynchronized to pass both data signals on the positive clock edge. <pin name>_hi is the positive edge and <pin name>_lo is the negative edge.
The invert register option (inv_register) does not support DDIO.
Drive Strength 1, 2, 3, 4 Choose the drive strength level.
Enable Fast Slew Rate On or off Optionally enable slew rate.

Inout Mode

Use inout mode for bidirectional signals. Inout mode has the same options for the input and output as the input and output modes.

Inout mode also has an output enable signal (optionally registered) to enable or disable the output buffer. The pin name you specify should be the same as the one you use in your RTL design. Setting the output enable signal to high (“1”) in your RTL design enables the output buffer.

Notice: For information on how to create a tri-state buffer, refer to “How do I create a Tri-State Buffer" in the Support Center Knowledgebase.

Clock Output Mode

Use clkout mode for clock output signals. You do not need to name the pin, but you do need to specify the output clock Pin Name.

None

Use none for unused signals. Specify whether the unused signal should have a weak pullup (default) or pulldown.