i2c

Wrap the I2C core with AXI-Lite CSRs, SMBus sideband, and DMA ready levels.

Instantiates i2c_core and the i2c_reg register block, both on clk_i. The FIFO depth parameters size the controller and target FIFOs; INPUT_DELAY_CYCLES sets the external input delay the core allows for. debug_o mirrors i2c_core's four debug bits.

Parameters

Table 1. Parameters
NameTypeDefaultDescription
CONTROLLER_TX_FIFO_DEPTHint unsigned64Entries in the controller format (FMT) FIFO; 1 to 4095.
CONTROLLER_RX_FIFO_DEPTHint unsigned64Entries in the controller receive (RX) FIFO; 1 to 4095.
TARGET_TX_FIFO_DEPTHint unsigned64Entries in the target transmit (TX) FIFO; 1 to 4095.
TARGET_RX_FIFO_DEPTHint unsigned268Entries in the target acquisition (ACQ) FIFO; 1 to 4095.
INPUT_DELAY_CYCLESint unsigned0External SCL/SDA input delay in clk_i cycles; lengthens the interference-detection blanking window after each output change.

Ports

Table 2. Ports
NameDirectionTypeDescription
clk_iinputlogicSystem clock.
rst_niinputlogicAsync reset, active-low.
axil_req_iinputaxil_req_tAXI-Lite CSR request.
axil_resp_ooutputaxil_resp_tAXI-Lite CSR response.
scl_iinputlogicSCL pad input, synchronized to clk_i inside i2c_core.
scl_ooutputlogicSCL pad output for an open-drain pad; 0 pulls the line low, 1 releases it.
sda_iinputlogicSDA pad input, synchronized to clk_i inside i2c_core.
sda_ooutputlogicSDA pad output for an open-drain pad; 0 pulls the line low, 1 releases it.
smbus_en_iinputlogicWhen low, masks smbalert_ni so SMBus ALERT reads as deasserted.
smbsus_niinputlogicSMBus SUS pin in, active-low; synchronized and reported in SMBUS_STATUS.
smbsus_nooutputlogicSMBus SUS pin out, active-low; driven from SMBUS_CTRL.SMBSUS in host mode without line loopback, high otherwise.
smbalert_niinputlogicSMBus ALERT pin in, active-low; synchronized, reported in SMBUS_STATUS and raises the SMBALERT interrupt.
smbalert_nooutputlogicSMBus ALERT pin out, active-low; driven from SMBUS_CTRL.SMBALERT in target mode without loopback, high otherwise.
controller_tx_ready_ooutputlogicController TX DMA ready; drops when the FMT FIFO fills and returns once its level falls below the FMT threshold.
controller_rx_ready_ooutputlogicController RX DMA ready; rises when the RX level exceeds the RX threshold and stays high until the FIFO empties.
target_tx_ready_ooutputlogicTarget TX DMA ready; drops when the TX FIFO fills and returns once its level falls below the TX threshold.
target_rx_ready_ooutputlogicTarget RX DMA ready; rises when the ACQ level exceeds the ACQ threshold and stays high until the FIFO empties.
irq_ooutputlogicLevel interrupt; OR of the INTR_STATE sources masked by INTR_ENABLE.
debug_ooutputlogic [3:0]Four-bit debug bus; see i2c_core for field definitions.