uart_core

Bind 16550 TX/RX datapaths, FIFOs, modem status, and interrupts to the register structs.

TX_FIFO_DEPTH and RX_FIFO_DEPTH size the FIFOs; localparams derive baud, FIFO depth/threshold, timeout, and trigger-level types. reg_out_i/reg_in_o are the generated register HW outputs and inputs. Exposes serial, modem, DMA ready, err_o, and irq_o. A zero divisor latch (DLM:DLL) disables both the transmitter and the receiver.

Parameters

Table 1. Parameters
NameTypeDefaultDescription
TX_FIFO_DEPTHint unsigned16Transmit FIFO depth. In uart_16550, a power of 2 from 4 to 4096.
RX_FIFO_DEPTHint unsigned16Receive FIFO depth. In uart_16550, a power of 2 from 4 to 4096.
BaudCntWidthint unsigned16Baud-rate divider counter width.
RxFifoDepthWidthint unsigned$clog2(RX_FIFO_DEPTH + 1)Bits to hold an RX FIFO fill level of 0 to RX_FIFO_DEPTH.
RxFifoThresholdWidthint unsigned$clog2(4096 + 1)Bits to hold the largest RX trigger level, 4096 entries.
TimeoutCntWidthint unsigned$clog2(MaxFrameLen * TimeoutCharCnt)Bits to count baud ticks over four maximum-length frames.
TriggerLevelWidthint unsigned$clog2(NumTriggerLevels)Bits to encode one of the RX trigger levels.

Ports

Table 2. Ports
NameDirectionTypeDescription
clk_iinputlogicSystem clock.
rst_niinputlogicActive-low reset.
reg_out_iinputuart_16550_reg_out_tSoftware-programmed register fields from the generated register block.
reg_in_ooutputuart_16550_reg_in_tHardware-driven inputs to the generated register block.
rx_iinputlogicAsynchronous; two-flop synchronized and 3-sample majority filtered. Ignored in system or line loopback.
tx_ooutputlogicRegistered; low during a set break. Held high in system loopback and equal to rx_i in line loopback.
cts_niinputlogicClear To Send, active-low; synchronized into MSR. Drives rts_no in line loopback.
dsr_niinputlogicData Set Ready, active-low; synchronized into MSR. Drives dtr_no in line loopback.
ri_niinputlogicRing Indicator, active-low; synchronized into MSR. Drives out1_no in line loopback.
dcd_niinputlogicData Carrier Detect, active-low; synchronized into MSR. Drives out2_no in line loopback.
rts_nooutputlogicRequest To Send, active-low; the inverted MCR RTS bit, high in system loopback.
dtr_nooutputlogicData Terminal Ready, active-low; the inverted MCR DTR bit, high in system loopback.
out1_nooutputlogicInverted MCR OUT1 bit, active-low; high in system loopback.
out2_nooutputlogicInverted MCR OUT2 bit, active-low; high in system loopback.
rxrdy_ooutputlogicActive-high DMA receive request: in mode 0 while the RX FIFO is not empty; in mode 1 from the trigger level or a character timeout until the FIFO empties.
txrdy_ooutputlogicActive-high DMA transmit request: in mode 0 while the TX FIFO is empty; in mode 1 until it fills, then again once it drains.
err_ooutputlogicHigh on a data-parity or pointer integrity error in the TX or RX FIFO, or a parity error in the holding register used in non-FIFO mode.
irq_ooutputlogicInterrupt request, active-high; the OR of the enabled interrupt sources.