i2c_target_fsm

Answer matched I2C addresses in the target FSM and fill the ACQ FIFO.

Drives SCL stretch for TX underrun, a nearly full ACQ FIFO and ACK-control mode, applies address masks, and pulses events for match, NACK, unexpected STOP, and arbitration loss.

Parameters

Table 1. Parameters
NameTypeDefaultDescription
TARGET_RX_FIFO_DEPTHint unsigned64ACQ FIFO depth.
TargetRxFifoDepthWidthint unsigned$clog2(TARGET_RX_FIFO_DEPTH+1)clog2(depth+1) for ACQ fill.

Ports

Table 2. Ports
NameDirectionTypeDescription
clk_iinputlogicSystem clock.
rst_niinputlogicAsync reset, active-low.
scl_iinputlogicSerial clock input from the I2C bus.
scl_ooutputlogicSerial clock output to the I2C bus.
sda_iinputlogicSerial data input from the I2C bus.
sda_ooutputlogicSerial data output to the I2C bus.
start_detect_iinputlogicSTART from the bus monitor.
stop_detect_iinputlogicSTOP from the bus monitor.
transmitting_ooutputlogicTarget is transmitting SDA (disambiguates high sda_o).
target_enable_iinputlogicEnable target functionality.
tx_fifo_rvalid_iinputlogicTX FIFO has valid data.
tx_fifo_rready_ooutputlogicPop entry from TX FIFO.
tx_fifo_rdata_iinputlogic [TARGET_TX_FIFO_WIDTH-1:0]Byte in TX FIFO to send to the host.
acq_fifo_wvalid_ooutputlogicPush valid data into the ACQ FIFO.
acq_fifo_wdata_ooutputlogic [TARGET_RX_FIFO_WIDTH-1:0]Data to write to the ACQ FIFO.
acq_fifo_depth_iinputlogic [TargetRxFifoDepthWidth-1:0]Fill level of the ACQ FIFO.
acq_fifo_full_ooutputlogicHigh while two or fewer ACQ FIFO entries are free.
acq_fifo_rdata_iinputlogic [TARGET_RX_FIFO_WIDTH-1:0]ACQ peek used only for assertions.
target_idle_ooutputlogicTarget is idle.
t_r_iinputlogic [12:0]Rise time of SDA and SCL in clock units.
tsu_dat_iinputlogic [12:0]Data setup time in clock units.
thd_dat_iinputlogic [12:0]Data hold time in clock units.
nack_timeout_iinputlogic [30:0]Max time the target may stretch until it should NACK.
nack_timeout_en_iinputlogicEnable NACK timeout.
nack_addr_after_timeout_iinputlogicNACK address after timeout.
arbitration_lost_iinputlogicLost arbitration while transmitting.
bus_timeout_iinputlogicBus timed out with SCL held low too long.
unhandled_tx_stretch_event_iinputlogicUnhandled event requests TX stretching.
ack_ctrl_mode_iinputlogicACK Control Mode enabled.
acq_start_stop_en_iinputlogicEnable START/STOP in the ACQ FIFO.
auto_ack_cnt_iinputlogic [8:0]Current TARGET_ACK_CTRL.NBYTES counter value.
auto_ack_cnt_clr_ooutputlogicClear the TARGET_ACK_CTRL.NBYTES counter.
auto_ack_cnt_decr_ooutputlogicDecrement the TARGET_ACK_CTRL.NBYTES counter.
sw_nack_iinputlogicSW pulses high to NACK while stretching in ack_ctrl.
ack_ctrl_stretching_ooutputlogicStretching due to zero Auto ACK count.
acq_fifo_next_data_ooutputlogic [7:0]Next data byte for SW NACK decisions.
target_address0_iinputlogic [6:0]Address 0.
target_mask0_iinputlogic [6:0]Address 0 mask; zero disables address 0.
target_address1_iinputlogic [6:0]Address 1.
target_mask1_iinputlogic [6:0]Address 1 mask; zero disables address 1.
event_address_match_ooutputlogicOne of the target addresses matched.
event_target_nack_ooutputlogicThis target sent a NACK.
event_cmd_complete_ooutputlogicCommand is complete.
event_tx_stretch_ooutputlogicTX transaction is being stretched.
event_unexp_stop_ooutputlogicSTOP during a read addressed to this target without a preceding host NACK.
event_tx_arbitration_lost_ooutputlogicArbitration was lost during a read transfer.
event_tx_bus_timeout_ooutputlogicBus timed out during a read transfer.
event_read_cmd_received_ooutputlogicA read awaits confirmation for TX FIFO release.