uart·A full-duplex universal asynchronous receiver/transmitter.
This is everything Akrida knew about the design. It never sees the design's code.
uart is a full-duplex universal asynchronous receiver/transmitter. Bytes
written on a valid/ready stream input are sent as serial frames on txd;
serial frames arriving on rxd are turned back into bytes on a valid/ready
stream output. The transmitter and receiver run independently and share
only the clock, reset and baud-rate setting.
+---------------------------------+
s_axis_tdata -->| |
s_axis_tvalid ->| transmitter --- shift out --> |--> txd
s_axis_tready <-| |--> tx_busy
| |
m_axis_tdata <--| |
m_axis_tvalid <-| receiver <--- sample --- |<-- rxd
m_axis_tready ->| |--> rx_busy
| |--> rx_overrun_error
| |--> rx_frame_error
prescale ------>| bit time = 8 * prescale clocks |
+---------------------------------+
| Name | Default | Meaning |
|---|---|---|
| DATA_WIDTH | 8 | Data bits per frame |
The verification target uses the default, 8 data bits.
| Port | Dir | Width | Description |
|---|---|---|---|
| clk | in | 1 | Clock. All signals are sampled on the rising edge. |
| rst | in | 1 | Synchronous reset, active high |
| s_axis_tdata | in | DATA_WIDTH | Byte to transmit |
| s_axis_tvalid | in | 1 | s_axis_tdata is valid |
| s_axis_tready | out | 1 | Transmitter can accept a byte |
| m_axis_tdata | out | DATA_WIDTH | Received byte |
| m_axis_tvalid | out | 1 | m_axis_tdata holds a received byte |
| m_axis_tready | in | 1 | Consumer takes the received byte |
| rxd | in | 1 | Serial input. Asynchronous to clk in a real system. |
| txd | out | 1 | Serial output |
| tx_busy | out | 1 | Transmitter is sending a frame |
| rx_busy | out | 1 | Receiver is receiving a frame |
| rx_overrun_error | out | 1 | One-cycle pulse: a received byte was lost (see REQ-RX-6) |
| rx_frame_error | out | 1 | One-cycle pulse: a frame had a bad stop bit (see REQ-RX-5) |
| prescale | in | 16 | Baud-rate setting. One bit time is 8 × prescale clock cycles. |
prescale clock cycles. prescale is at
least 1 and changes only while both the transmitter and receiver are
idle.s_axis_tvalid and s_axis_tready are both high, and on the output
stream in a cycle where m_axis_tvalid and m_axis_tready are both high.
Once raised, m_axis_tvalid and m_axis_tdata stay unchanged until the
byte is taken, except as described in REQ-RX-6.s_axis_tdata stable and keeps
s_axis_tvalid high until its byte is accepted.txd as
exactly one frame, in the order accepted. No accepted byte is dropped or
sent twice.txd last exactly one bit
time. The stop bit lasts at least one bit time.tx_busy is high from the start bit through the stop bit of
every frame and low while the transmitter is idle.txd is 1 while idle and while rst is high.rxd while the receiver is idle
marks a possible start bit. The receiver samples the line in the middle of
the start bit and of each following bit.rxd is high again when the middle of the start bit is
sampled, the start is false: the receiver returns to idle and produces no
byte and no error. Low pulses shorter than half a bit time are therefore
ignored.m_axis_tdata with m_axis_tvalid high.prescale cycles by up to ±3%.rx_frame_error is high
for exactly one clock cycle and no byte is presented. A byte already
waiting on the output stream is not affected.m_axis_tvalid high and not yet taken), the new byte replaces
the waiting one on m_axis_tdata, m_axis_tvalid stays high, and
rx_overrun_error is high for exactly one clock cycle. The replaced byte is
lost.rx_frame_error
and rx_overrun_error stay low.rx_busy is high while a frame is being received.rst is high, s_axis_tready, m_axis_tvalid,
tx_busy, rx_busy, rx_overrun_error and rx_frame_error are low and
txd is high.Parity, more than one stop bit, flow control (RTS/CTS), break detection and
receive FIFOs are not supported. Metastability on rxd is handled by the
receiver's input register and is not checked in simulation.