MGC Uart
MGC Uart
Version 1.0
9th October 2012
Disclaimer
The UART design RTL is supplied on an ‘as is’ basis and is intended to be used with Verification
Academy Verification Cookbook verification environments to illustrate different aspects of
verification methodology.
Baud
Divisor
Generator
Registers Logic
Line
Status
Register
APB
Signals
Line
Receiver
Control
Logic
Register
Receiver RXD
Receiver
Shift
FIFO
Register
FIFO
Control
Register Transmitter
APB
Logic
bus
Interface
Transmitter TXD
Transmitter
Shift
FIFO
Register
Interrupt
ID
Register IRQ
Interrupt
Logic
Interrupt
Enable
Register
nRTS
Modem nCTS
Status
Register nDTR
nDSR
Modem
Signals
Logic
nDCD
Modem
Control
Register nRI
DIV1 0x1c 8 R/W 16 bit Baud Rate divider – least significant byte
DIV2 0x20 8 R/W 16 bit Baud Rate divider – most significant byte
Writing a logic ‘1’ to any of these interrupt enable bits will enable the interrupt, and writing a logic
‘0’ will disable the interrupt. After reset all interrupts are disabled.
Bit 0 of the register will read back as a logic ‘1’ if no interrupt is pending, otherwise the UART has an
interrupt to be serviced. The valid codes returned in bits 3:0 of the register are described in the
following table:
0x1 - No interrupt - -
0x6 1st Receive Line Status Parity, Overrun or Framing Reading the line status register
errors, or Break Detected
0x4 2nd Receive data RX FIFO trigger level RX FIFO drops below the
available reached trigger level
0xc 2nd Receive timeout At least a character in the Reading from the receive data
RX FIFO, but no character register
has been received by or
read from the RX FIFO for
at least 4 character periods
0x2 3rd Transmitter Empty The transmit FIFO and the Reading the IIR register or
transmit shift register is writing to the transmit data
empty register
0x0 4th Modem Status A change on one of the Reading the modem status
modem input signals: register
CTS, DSR, RI or DCD
Bits 7:4 are unused and are always read back as 0xC
0 W Reserved
1 W If set to logic ‘1’, flushes the content of the RX FIFO, but does not affect the reception
of any character that is in progress when the RX FIFO is flushed.
2 W If set to logic ‘1’, flushes the content of the TX FIFO, but does not affect any in
progress transmission.
5:3 W Reserved
‘00’ – 1 Character
‘01’ – 4 Characters
‘10’ – 8 Characters
‘11’ – 14 Characters
‘00’ – 5 bits
‘01’ – 6 bits
‘10’ – 7 bits
‘11’ – 8 bits
3 RW Parity Enable:
‘0’ – No parity
‘1’ – Parity enabled
7 RW Reserved
0 RW Data Terminal Ready (DTR), the output value is the inverse of the bit value written
1 RW Request To Send (RTS), the output value is the inverse of the bit value written
2 RW Out1 – In loopback mode, connected to the Ring Indicator (RI) signal input
3 RW Out2 – In loopback mode, connected to Data Carrier Detect (DCD) signal input
4 RW Loopback mode:
‘0’ – Normal mode
‘1’ – Loopback mode enabled
7:5 RW Reserved
6 RO Transmit Empty
‘1’ – Both the transmit shift register and the TX FIFO are empty
‘0’ – TX FIFO has at least one character, or the TX shift register is busy
The bit is cleared when a character is written to the TX FIFO
7 RO FIFO Error
‘1’ – At least one parity error, framing error or break interrupt has been received and
are stored in the RX FIFO. The bit is reset on reading the LCR.
‘0’ – No errors
0 RO Delta Clear To Send (DCTS), set to ‘1’ if the CTS input has changed
1 RO Delta Data Set Ready (DDSR), set to ‘1’ if the DSR input has changed
2 RO Trailing Edge of Ring Indicator (TERI), set to ‘1’ on a 1 to 0 transition of the RI input
3 RO Delta Data Carrier Detect (DDCD), set to ‘1’ if the DCD input has changed
Reading back from these registers will return the baud rate divider, not the current value of the
divider counter.
The counter is started, or restarted, when the DIV1 register is written to.