SystemVerilog

Learn SystemVerilog

Move from Verilog syntax to reusable classes, constraints, interfaces, assertions, and verification-oriented code.

What you will learn

Study each lesson by reading the concept, running the example, changing one detail, and checking the resulting behavior. These skills form the language foundation for UVM.

Start with the learning path

SystemVerilog adds the data types, object-oriented programming, constrained randomization, interfaces, assertions, and coverage features used by modern verification environments.

Lesson 3 of 8: always_comb and always_ff

Make combinational and sequential intent explicit to the simulator and reviewer.

always_comb begin
  next_state = state;
  if (start)
    next_state = BUSY;
end

always_ff @(posedge clk) begin
  if (!reset_n)
    state <= IDLE;
  else
    state <= next_state;
end

What to notice

  • always_comb automatically tracks its input signals.
  • always_ff states that the block models sequential state.
  • Non-blocking assignment <= is used in always_ff.
Practice: Convert a Verilog always @(*) mux into an always_comb block.

Verification habits to build

SkillHabitWhy it matters in UVM
ClassesKeep data and behavior togetherCreates reusable sequence items and configuration objects
ConstraintsGenerate legal, meaningful valuesExplores scenarios without producing invalid noise
InterfacesBundle signals and directionsGives drivers and monitors a stable DUT boundary
AssertionsState timing rules preciselyCatches protocol violations near their cause
CoverageMeasure planned behaviorShows which verification scenarios still need stimulus