GPIO Design Time Configuration

The verilog/rtl/user_defines.v file is the design-time configuration file used to set the Power-On Reset () default mode for the user-accessible  pins () on the Caravel or Caravan chip.

What is user_defines.v Used For?

The Caravel harness uses the settings in this file to program the hardware block during the chip's sequence. This ensures that the pins assume a defined state immediately upon power-up before the internal Management begins executing firmware.

  1. Tapeout/Fabrication: The fabrication flow uses this file to configure the control hardware with your specified defaults.

  2. Run-Time Customization: After , the Management can override these defaults at any time by executing that writes new configurations to the control registers.

Action Required: You must manually edit this file to replace the placeholder with a specific mode macro for every your project uses.

Available Mode Macros

The file itself contains all available mode macros. You must use one of the defined macros for any pin connected to your design.

These macros define the pin's default configuration upon Power-On Reset ().

Macro NameDescription
Management Modes 
Digital Input (from pad) connected to the Management SoC (no internal pull resistors).
Digital Input connected to the Management SoC with an internal pull-down resistor.
Digital Input connected to the Management SoC with an internal pull-up resistor.
Digital Output (to pad) controlled by the Management SoC.
Digital Bidirectional controlled by the Management SoC.
Configures the pad for the Analog signal path, but associated with the Management SoC.
User Project Modes 
Digital Input (from pad) connected to the User Project (no internal pull resistors).
Digital Input connected to the User Project with an internal pull-down resistor.
Digital Input connected to the User Project with an internal pull-up resistor.
Digital Output (to pad) controlled by the User Project.
Digital Bidirectional controlled by the User Project.
Digital Output (to pad) controlled by the User Project with an internal monitor connection.
Configures the pad for the Analog signal path, connected to the User Project (used for /analog projects).

Configuring a Caravel Project

In order to propagate an external input signal to the user area, the gpio should be programmed as one of the following.
GPIO_MODE_MGMT_STD_INPUT_NOPULL
GPIO_MODE_MGMT_STD_INPUT_PULLDOWN
GPIO_MODE_MGMT_STD_INPUT_PULLUP
GPIO_MODE_MGMT_STD_BIDIRECTIONAL

GPIO_MODE_USER_STD_INPUT_NOPULL
GPIO_MODE_USER_STD_INPUT_PULLDOWN
GPIO_MODE_USER_STD_INPUT_PULLUP
GPIO_MODE_USER_STD_BIDIRECTIONAL
GPIO_MODE_USER_STD_OUT_MONITORED
Note that all MGMT input is also input to the user area.
For
GPIO_MODE_USER_STD_INPUT_PULLDOWN
GPIO_MODE_USER_STD_INPUT_PULLUP
The USER must provide the appropriate output on io_out (fixed low for pull down and fixed high for pull up) AND set io_oeb to low.In order to have the user output actually output from the gpio cell, io_oeb should be low and one of the following modes should be used.
GPIO_MODE_USER_STD_OUTPUT
GPIO_MODE_USER_STD_BIDIRECTIONAL
GPIO_MODE_USER_STD_OUT_MONITORED
In these modes, io_oeb high will disable the gpio output buffer (Hi-Z output), which will allow external input in the case of
GPIO_MODE_USER_STD_BIDIRECTIONAL
GPIO_MODE_USER_STD_OUT_MONITORED
In these 2 modes, when io_oeb is low, the user input io_in will follow io_out.
 
For simple input usage:Set  the gpio mode to GPIO_MODE_USER_STD_INPUT_NOPULL and tie io_out and io_oeb high or low to Hi-Z avoid leakage.
 
For simple always enabled output usage:Set  the gpio mode to GPIO_MODE_USER_STD_OUTPUT and tie io_oeb low.

Configuring an Analog Project (Caravan)

When using the  template, targeting Caravan, the internal pin mapping is specialized.

Caravan Mapping for Analog Signals

In the , the internal pins (which include a series resistor) are mapped to a specific subset of the array:

Complete to Wrapper Port Mapping

 

IndexPort Index
 

⚠️ Pre-check Warning: Failure to replace the GPIO_MODE_INVALID placeholder for all GPIO pins your design utilizes will cause the Precheck to fail. Do not submit your project with GPIO_MODE_INVALID definitions for active pins.

Cookie Settings
This website uses cookies

Cookie Settings

We use cookies to improve user experience. Choose what cookie categories you allow us to use. You can read more about our Cookie Policy by clicking on Cookie Policy below.

These cookies enable strictly necessary cookies for security, language support and verification of identity. These cookies can’t be disabled.

These cookies collect data to remember choices users make to improve and give a better user experience. Disabling can cause some parts of the site to not work properly.

These cookies help us to understand how visitors interact with our website, help us measure and analyze traffic to improve our service.

These cookies help us to better deliver marketing content and customized ads.