samarth jain
06/14/2025, 5:57 AMMitch Bailey
06/14/2025, 8:31 AMcaravel_user_project/verilog/rtl/user_defines.v file that you must modify.
See the GPIO Configuration section here.
gpio’s that are configured for output or as bidirectional require the corresponding io_oenb to be low when output is enabled.
It is probably a good idea to tie unused io_out and io_oenb signals to power or ground to avoid possible leakage due to unconnected gate input.samarth jain
06/14/2025, 7:14 PMMitch Bailey
06/14/2025, 9:05 PMmpw_precheck.
Here are the 13 predefined gpio configurations
GPIO_MODE_MGMT_STD_INPUT_NOPULL
GPIO_MODE_MGMT_STD_INPUT_PULLDOWN
GPIO_MODE_MGMT_STD_INPUT_PULLUP
GPIO_MODE_MGMT_STD_OUTPUT
GPIO_MODE_MGMT_STD_BIDIRECTIONAL
GPIO_MODE_MGMT_STD_ANALOG
GPIO_MODE_USER_STD_INPUT_NOPULL
GPIO_MODE_USER_STD_INPUT_PULLDOWN
GPIO_MODE_USER_STD_INPUT_PULLUP
GPIO_MODE_USER_STD_OUTPUT
GPIO_MODE_USER_STD_BIDIRECTIONAL
GPIO_MODE_USER_STD_OUT_MONITORED
GPIO_MODE_USER_STD_ANALOG
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.
In summary….
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.