RTL Studio Open IDE

5.4 · SOC CLASS

System-level testbench

Construct a system-level testbench to drive a mini-SoC design with directed sequences and verify GPIO/UART integration.

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

What you practice

System-level testbench (5.4). Construct a system-level testbench to drive a mini-SoC design with directed sequences and verify GPIO/UART integration. It is in System-Level Testbench — Part 5 · Integration & Capstone of the SoC Masterclass. Tie a CPU stub, decode, peripherals, DMA, and IRQ into a mini-SoC capstone.

SoC lessons simulate the fabric and the peripheral together in the IDE. Verilator is the simulator; the waveform is where address and response show up.

What you will learn

You will learn to construct a system-level testbench that drives a complete mini-SoC design. This lesson focuses on directed sequences to verify IP integration and port connectivity. You will practice initializing external interfaces and checking final design states. This skill is essential for validating complex system-on-chip designs before full UVM verification.

Learning objectives

  • Initialize power-on reset and system clock in the testbench.
  • Drive directed stimulus to external DUT ports like GPIO and UART.
  • Verify system behavior by checking output registers after a simulation run.
  • Interpret simulation logs to confirm successful design integration.

Theory

A system-level testbench connects the Design Under Test (DUT) to its external environment. The DUT here wraps a mini_soc_top module, exposing GPIO, UART, and control signals. The testbench must drive inputs that the SoC expects from the outside world. External interfaces like gpio_in and uart_tx_busy often require specific values to allow the internal CPU stub to function correctly. The testbench uses a simple directed sequence rather than random constraints. It applies a reset, waits for stabilization, and then runs the design for a fixed number of cycles. Finally, it checks the output registers to ensure the design performed its task. This approach is fast and effective for verifying basic system connectivity and IP integration.

Practice

  1. Open RtlStudio and select this chapter from the Examples or Lecture list.
  2. Confirm that student/rtl/design.sv and student/tb/tb_top.sv appear in the Explore tree.
  3. Open student/tb/tb_top.sv in the editor.
  4. Locate the assign gpio_in = __TODO__; line in student/tb/tb_top.sv and replace __TODO__ with 8'h00.
  5. Locate the assign uart_tx_busy = __TODO__; line in student/tb/tb_top.sv and replace __TODO__ with 1'b0.
  6. Locate the por_n = __TODO__; line in student/tb/tb_top.sv and replace __TODO__ with 1'b0.
  7. Locate the repeat (__TODO__) @(posedge clk); line in student/tb/tb_top.sv and replace __TODO__ with 5000.
  8. Save the file and run Simulation from the left sidebar.

Summary

You constructed a system-level testbench to verify the integration of IP modules within the SoC design. By implementing directed sequences, you exercised the DUT through reset and operational phases to ensure correct initialization. The successful simulation output confirms that the design reached the expected final state as indicated by the PASS message.

© 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 lesson workspace in the IDE. The fabric and the peripheral are one simulation.
  2. Run Verilator and follow the address, write data, and read response on the waveform.
  3. A passing log is not enough when decode or an IRQ line is the point of the lesson — those show up on the VCD.
  4. Run Yosys on the RTL island you just integrated when you want the mapped cells.

The lesson is done when the simulation matches System-level testbench. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.