Pick a function for a value and a task for an activity.
The distinction is not stylistic: a function must complete without consuming simulation time, while a task can synchronize, delay, and return several results through arguments.
Open section →Preparing questions and your practice workspace.
Subroutines, assignments, and scheduler intent
Write executable SystemVerilog whose timing, ownership, and completion semantics remain unambiguous in simulation, synthesis, and foreign-language boundaries.
A detailed guide to tasks, functions, argument passing, lifetime, program and clocking blocks, DPI, blocking and nonblocking assignments, delays, always variants, and case intent.
The language bench / scheduling
// One process, before the edge: a=1, b=0
a <= b;
b <= a;
#0 $display(a, b);
$strobe(a, b);Question-first preparation
Practice a real question, then inspect the mechanism in its section.
One representative prompt from each major mechanism. Open any card in the live question bank.
The RHS is captured now and the LHS commits later in the same time slot.
One statement · four temporal questions
A procedural statement is not fully explained until its inputs, side effects, event region, update time, and caller-visible completion are all explicit.
Establish argument direction, lifetime, and ownership.
Record when the RHS or expression is sampled.
Place the LHS effect in its real region and time slot.
State when the caller or process may continue.
Standards and primary references
Continue preparing