RTL Studio Open IDE

0.1 · SYSTEMVERILOG CLASS

logic and design.sv

Introduce the unified logic type in SystemVerilog to replace legacy wire/reg in simple combinational logic.

Watch on YouTube

What you practice

logic and design.sv (0.1). Introduce the unified logic type in SystemVerilog to replace legacy wire/reg in simple combinational logic. It is in Hello SystemVerilog — Part 0 · SV Warming Up of the SystemVerilog Masterclass. Move from Verilog to SystemVerilog and get the Verilator simulation flow running.

The same IDE is the SystemVerilog simulator. Slang lints the file, Verilator runs it, and the waveform viewer sits next to the source.

What you will learn

Today you will replace legacy wire and reg declarations with the unified logic type in SystemVerilog, simplifying combinational and registered signal declarations in your RTL.

Learning objectives

  • Understand why logic replaces wire and reg in modern SystemVerilog.
  • Declare DUT ports and internal signals using only the logic type.
  • Verify a combinational logic module using a simple testbench.
  • Run simulation and interpret $display output in the Log panel.

Theory

SystemVerilog introduced the logic type to unify wire (for continuous assignments) and reg (for procedural assignments) into a single, flexible type.

TypeLegacy Use Caselogic Compatibility
wireContinuous assignment (assign)Yes
regProcedural assignment (always)Yes

The logic type works in both contexts and avoids type mismatches between modules. It is the recommended default for all signals in new designs.

Practice

  1. Open this chapter in RtlStudio — files appear automatically in Explore.
  2. In student/rtl/design.sv, replace each __TODO__ placeholder with the logic keyword on the three ports.
  3. Keep the testbench student/tb/tb.sv unchanged — it already uses logic for all signals.
  4. Run Simulation from the left sidebar and check the Log panel for INFO: output.
  5. Confirm the four test cases and final INFO: PASS line appear.

Summary

You practiced replacing legacy wire and reg declarations with the unified logic type in a small combinational DUT. You verified correct behavior through testbench signal dumps and confirmed synthesis success with Yosys. The key takeaway is that logic simplifies RTL coding by unifying net and variable semantics without sacrificing synthesis compatibility.

Run it in the Verilog IDE

  1. Open the lesson in the IDE. The SystemVerilog for this topic is already in the editor.
  2. Lint with Slang before you simulate. It covers both Verilog and SystemVerilog in this IDE.
  3. Run Verilator and inspect the VCD. Interfaces, classes, and assertions count only if the simulator agrees.
  4. Run Yosys when the lesson is synthesizable RTL, and keep testbench-only constructs out of that module.

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