RTL Studio Open IDE

2.4 · RV SYS CLASS

UART status TX

Connect GPIO ports and load UART program to verify status-based TX transmission.

Video coming soon. This lesson page stays at the same URL when the lecture publishes.

What you practice

UART status TX (2.4). Connect GPIO ports and load UART program to verify status-based TX transmission. It is in UART status poll TX — Part 2 · Peripheral Programs of the RISC-V on SoC & System Masterclass.

The core and the mini-SoC simulate as one workspace in the IDE. Follow MMIO, interrupts, and the program on the Verilator waveform, not only a pass line.

What you will learn

You will learn how to connect peripheral signals to the testbench and load a program that drives the UART transmitter. This lesson focuses on the interface between the CPU and the UART status register.

Learning objectives

  • Connect the gpio_in, gpio_out, and gpio_oe ports in the testbench instance.
  • Load the correct assembly program into the CPU memory.
  • Verify that the UART transmits the expected byte via the uart_seen signal.

Theory

The UART peripheral requires the CPU to check the busy status before writing data to the transmit register. This prevents data loss when the previous byte is still being shifted out. The testbench monitors the uart_tx_valid signal to capture the byte sent by the DUT. You must ensure the testbench ports match the DUT ports exactly for simulation to work.

Practice

Open RtlStudio and select this chapter from the Examples or Lecture list. Confirm that student/tb/tb_top.sv and student/rtl/design.sv appear in the Explore tree. Open student/tb/tb_top.sv in the editor. Locate the dut_i instance block. Replace the __TODO__[0] placeholders for gpio_in, gpio_out, and gpio_oe with the correct signal names (gpio_in, gpio_out, gpio_oe). Locate the $readmemh call in the initial block. Replace the __TODO__ placeholder with the string "tb/programs/02_04_uart_status_tx.hex". Save the file. Click Simulation in the left sidebar and run the simulation. Check the Log panel for the INFO: messages.

Summary

You practiced configuring the UART transmitter by polling the status bit before writing data to the transmit register. This approach ensures that data is not overwritten while previous bytes are still being shifted out. The testbench verified the correct transmission by capturing the output byte in the uart_seen signal. You successfully connected the testbench ports and loaded the appropriate program to achieve a passing simulation.

© 2026 RtlStudio. Licensed under CC BY-NC-ND 4.0. Commercial use and modifications by third parties are not permitted.

Run it in the Verilog IDE

  1. Open the system lesson in the IDE. The RV32I core and the mini-SoC fabric simulate together.
  2. Run Verilator and trace the program through MMIO: address, load/store data, and the peripheral response.
  3. Interrupts and DMA belong on the waveform next to the instruction stream, not only in a pass/fail line.
  4. Edit the integration RTL, resimulate, and run Yosys on the structural block when you want a netlist.

The lesson is done when the simulation matches UART status TX. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.