uart_16550_pkg

Define types and constants for the 16550 UART core and register map.

Provides AXI-Lite typedefs, frame constants and frame packing helpers, the three register-map selects and register struct types, DMA mode and interrupt ID encodings, and is_pow_of_2 and count_ones, for uart_16550, uart_core, uart_tx, and uart_rx.

reg_addr_t

Alias for logic [RegAddrWidth-1:0]

reg_data_t

Alias for logic [RegDataWidth-1:0]

reg_strb_t

Alias for logic [RegStrbWidth-1:0]

axil_aw_chan_t

Packed struct

Table 1. axil_aw_chan_t
FieldTypeDescription
addrreg_addr_t
protaxi_pkg::prot_t

axil_w_chan_t

Packed struct

Table 2. axil_w_chan_t
FieldTypeDescription
datareg_data_t
strbreg_strb_t

axil_b_chan_t

Packed struct

Table 3. axil_b_chan_t
FieldTypeDescription
respaxi_pkg::resp_t

axil_ar_chan_t

Packed struct

Table 4. axil_ar_chan_t
FieldTypeDescription
addrreg_addr_t
protaxi_pkg::prot_t

axil_r_chan_t

Packed struct

Table 5. axil_r_chan_t
FieldTypeDescription
datareg_data_t
respaxi_pkg::resp_t

axil_req_t

Packed struct

Table 6. axil_req_t
FieldTypeDescription
awaxil_aw_chan_t
aw_validlogic
waxil_w_chan_t
w_validlogic
b_readylogic
araxil_ar_chan_t
ar_validlogic
r_readylogic

axil_resp_t

Packed struct

Table 7. axil_resp_t
FieldTypeDescription
aw_readylogic
w_readylogic
baxil_b_chan_t
b_validlogic
ar_readylogic
raxil_r_chan_t
r_validlogic

uart_16550_reg_map_e

Enum (logic [$clog2( NumRegMaps )-1:0])

Table 8. uart_16550_reg_map_e
ValueNumberDescription
MAIN_REG_MAP2'd0
MAIN_WO_REG_MAP2'd1
DL_REG_MAP2'd2

uart_16550_reg_in_t

Packed struct

Table 9. uart_16550_reg_in_t
FieldTypeDescription
mainuart_16550_main_reg_pkg::uart_16550_main__in_t
main_wouart_16550_main_wo_reg_pkg::uart_16550_main_wo__in_t

uart_16550_reg_out_t

Packed struct

Table 10. uart_16550_reg_out_t
FieldTypeDescription
mainuart_16550_main_reg_pkg::uart_16550_main__out_t
main_wouart_16550_main_wo_reg_pkg::uart_16550_main_wo__out_t
dluart_16550_dl_reg_pkg::uart_16550_dl__out_t

tx_rx_e

//////////////////////

Enum (bit)

Table 11. tx_rx_e
ValueNumberDescription
RX1'b0
TX1'b1

dma_mode_e

1, 4, 8, 14, 32, 64, 128, 256, 512, 1024, 2048, 4096.

Enum (logic)

Table 12. dma_mode_e
ValueNumberDescription
DMA_MODE_01'b0
DMA_MODE_11'b1

interrupt_id_e

////////////////////////

Enum (logic [2:0])

Table 13. interrupt_id_e
ValueNumberDescription
FIFO_ERROR3'b111Highest priority.
RECEIVER_LINE_STATUS3'b011
RECEPTION_TIMEOUT3'b110
RECEIVED_DATA_READY3'b010
TRANSMITTER_HOLDING_REGISTER_EMPTY3'b001
MODEM_STATUS3'b000Lowest priority.

interrupt_reqs_t

Packed struct

Table 14. interrupt_reqs_t
FieldTypeDescription
fifo_errorlogic
receiver_line_statuslogic
reception_timeoutlogic
received_data_readylogic
transmitter_holding_register_emptylogic
modem_statuslogic

get_word_length

Function returning logic [3:0]

Table 15. get_word_length
NameDirectionTypeDescription
word_length_selectinputlogic [1:0]

get_frame_length

Function returning logic [3:0]

Table 16. get_frame_length
NameDirectionTypeDescription
tx_or_rxinputtx_rx_e
word_lengthinputlogic [3:0]
extra_stop_bitinputlogic
parity_eninputlogic

get_tx_frame_from_data

Function returning logic [11:0]

Table 17. get_tx_frame_from_data
NameDirectionTypeDescription
tx_datainputlogic [7:0]
tx_parityinputlogic
word_lengthinputlogic [3:0]
parity_eninputlogic

get_rx_data_from_frame

Function returning logic [7:0]

Table 18. get_rx_data_from_frame
NameDirectionTypeDescription
rx_frameinputlogic [11:0]
word_lengthinputlogic [3:0]
extra_stop_bitinputlogic
parity_eninputlogic

is_pow_of_2

//////////////////////

Function returning bit

Table 19. is_pow_of_2
NameDirectionTypeDescription
numinputint unsigned

count_ones

Function returning logic [5:0]

Table 20. count_ones
NameDirectionTypeDescription
signalinputlogic [31:0]