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
| Name | Type | Default | Description |
|---|---|---|---|
CONTROLLER_TX_FIFO_DEPTH | int unsigned | 64 | Entries in the controller format (FMT) FIFO; 1 to 4095. |
CONTROLLER_RX_FIFO_DEPTH | int unsigned | 64 | Entries in the controller receive (RX) FIFO; 1 to 4095. |
TARGET_TX_FIFO_DEPTH | int unsigned | 64 | Entries in the target transmit (TX) FIFO; 1 to 4095. |
TARGET_RX_FIFO_DEPTH | int unsigned | 268 | Entries in the target acquisition (ACQ) FIFO; 1 to 4095. |
INPUT_DELAY_CYCLES | int unsigned | 0 | External SCL/SDA input delay in clk_i cycles; lengthens the interference-detection blanking window after each output change. |
Ports
| Name | Direction | Type | Description |
|---|---|---|---|
clk_i | input | logic | System clock. |
rst_ni | input | logic | Async reset, active-low. |
axil_req_i | input | axil_req_t | AXI-Lite CSR request. |
axil_resp_o | output | axil_resp_t | AXI-Lite CSR response. |
scl_i | input | logic | SCL pad input, synchronized to clk_i inside i2c_core. |
scl_o | output | logic | SCL pad output for an open-drain pad; 0 pulls the line low, 1 releases it. |
sda_i | input | logic | SDA pad input, synchronized to clk_i inside i2c_core. |
sda_o | output | logic | SDA pad output for an open-drain pad; 0 pulls the line low, 1 releases it. |
smbus_en_i | input | logic | When low, masks smbalert_ni so SMBus ALERT reads as deasserted. |
smbsus_ni | input | logic | SMBus SUS pin in, active-low; synchronized and reported in SMBUS_STATUS. |
smbsus_no | output | logic | SMBus SUS pin out, active-low; driven from SMBUS_CTRL.SMBSUS in host mode without line loopback, high otherwise. |
smbalert_ni | input | logic | SMBus ALERT pin in, active-low; synchronized, reported in SMBUS_STATUS and raises the SMBALERT interrupt. |
smbalert_no | output | logic | SMBus ALERT pin out, active-low; driven from SMBUS_CTRL.SMBALERT in target mode without loopback, high otherwise. |
controller_tx_ready_o | output | logic | Controller TX DMA ready; drops when the FMT FIFO fills and returns once its level falls below the FMT threshold. |
controller_rx_ready_o | output | logic | Controller RX DMA ready; rises when the RX level exceeds the RX threshold and stays high until the FIFO empties. |
target_tx_ready_o | output | logic | Target TX DMA ready; drops when the TX FIFO fills and returns once its level falls below the TX threshold. |
target_rx_ready_o | output | logic | Target RX DMA ready; rises when the ACQ level exceeds the ACQ threshold and stays high until the FIFO empties. |
irq_o | output | logic | Level interrupt; OR of the INTR_STATE sources masked by INTR_ENABLE. |
debug_o | output | logic [3:0] | Four-bit debug bus; see i2c_core for field definitions. |